Post new topic    
Slime Knight
Send private message
Suggestions for new read commands in battle 
 PostThu Jul 09, 2020 6:39 am
Send private message Reply with quote
Starting a new thread merely for organization. The scope of this thread is limited to suggestions on what kind of `read` commands could be added relating to battles. Whether someone decides to roll up their sleeves and do this themselves, or tmc ends up doing it himself eventually, it could be a convenient list to refer to. (If you wish to debate the idea of battlescripting itself, please add your opinions here: https://www.slimesalad.com/forum/viewtopic.php?t=8026)

Tmc in the "Let's talk about battlescripting" thread:

Quote:
If you're willing to write FreeBASIC code, adding new script commands to read attack data would be very helpful. Currently you can only get attack names and captions. Adding script commands is read existing data is easy, requires almost no knowledge of the codebase, and we even have an article explaining how to do it.


How to add a new script command:
https://rpg.hamsterrepublic.com/ohrrpgce/How_to_add_a_new_script_command

Quote:
But do discuss it before starting.

So let's discuss it.

Wishlist so far:
Command to read foemap data at a certain tile - Foxley
Access to item data - Kyle

-------tmc (read his post a few posts down for context):
read foemap (not sure if this is different from Foxley's request)
equippable in slot
get equip slot # Would only return first slot. This is very similar to "equip where" but doesn't check hero
get equip stat bonus
get equip elemental resist as int
equip elemental resist as int # alias, for consistency with herobaseelementalresistasint, enemyelementalresistasint
get item value
get item consumed
get weapon picture
get weapon palette
get weapon attack
get item attack as weapon
get item attack in battle
get item attack out of battle

-------bob votes for ("item" instead of "equip")
get item stat bonus
get item elemental resist as int
Liquid Metal Slime
Send private message
 
 PostThu Jul 09, 2020 7:44 am
Send private message Reply with quote
The only get item ___ commands are get item name, get item description, and get item maximum stack size. All other item data needs access in scripts (can edit with a comprehensive list later).
Ps. I love my wife
Metal King Slime
Send private message
 
 PostThu Jul 09, 2020 1:33 pm
Send private message Reply with quote
Adding a command just to read the foemap would be easy, since it's just
Code:
   battle_formation_set = readblock(foemap, x, y, 0)

(that's FB code) where 0 is the default for out-of-range x/y values.

A while back... a year ago... I started on adding a command to write foemaps, which is far harder because of saving map state and Test Game, etc. But I didn't get as far as adding actual script commands, so anyone is welcome to add a "read foemap" command and there won't be any redundant wok. Finishing "write foemap" isn't a priority for me right now.

Item commands are prime examples of ones where the naming and semantics need discussion. Here's the list of commands that I came up with (just the "get" versions):
Code:
equippable in slot
get equip slot   # Would only return first slot. This is very similar to "equip where" but doesn't check hero
get equip stat bonus
get equip elemental resist as int
equip elemental resist as int   # alias, for consistency with herobaseelementalresistasint, enemyelementalresistasint
get item value
get item consumed
get weapon picture
get weapon palette
get weapon attack
get item attack as weapon
get item attack in battle
get item attack out of battle

Script commands are named quite inconsistently, so naming is always a stumbling block for me.
Note that although they all act on items, the proposed name contains either "item", "equip" or "weapon" to distinguish different item subtypes, but you could argue for "get item weapon picture", etc, instead. I was trying to shorten the names. In particular, maybe "get equip slot" is too confusing a name.
Liquid Metal King Slime
Send private message
 
 PostSat Jul 11, 2020 11:46 pm
Send private message Reply with quote
Sure...
and the OTHER thread is the one that gets deleted....
V
What is even happening in this thread?

How about we all just make games quietly and post on here when we have an update on progress, to tell someone how their update looks cool, or to let everyone know your game is ready to be played?


oh and TMC
Code:
get equip slot   # Would only return first slot. This is very similar to "equip where" but doesn't check hero

So get equip slot would return the item id of the weapon the hero is holding?
Or.. what exactly is it returning?
I assume to get the hero's weapon you'd do
Code:
Get hero equipment ([hero order ID], [equipment slot])

and it would return an item id
Metal King Slime
Send private message
 
 PostMon Jul 13, 2020 1:05 am
Send private message Reply with quote
This thread has a point. It's about engine development, not game development.
I deleted the posts where Bena and Sword bicker about the thread title, because it was derailing the thread.

Quote:
So get equip slot would return the item id of the weapon the hero is holding?

No, all the commands I listed are to read data from item definitions. But your confusion lends weight to the concern that the name is too confusing. So maybe they should be named:
Code:
get item equip slot
get item equip stat bonus
get item equip elemental resist as int

or
Code:
get item stat bonus
get item elemental resist as int

I can't decide.

BTW, the command to read a hero's equipment already exists, it's called "check equipment". Another example of an irregular name.
Liquid Metal King Slime
Send private message
 
 PostMon Jul 13, 2020 2:42 am
Send private message Reply with quote
I vote for

Code:
get item stat bonus
get item elemental resist as int


I think it is a good balance between length and specificity
Liquid Metal King Slime
Send private message
 
 PostMon Jul 13, 2020 3:19 pm
Send private message Reply with quote
yes I like item more as the keyword there
equip, to me anyways, means the item is equipped and on a hero
Metal King Slime
Send private message
 
 PostWed Jul 15, 2020 3:04 am
Send private message Reply with quote
Sounds good. But what about the weapon commands? My suggestions:
Code:
get weapon picture
get weapon palette
get weapon attack   # Alias to "get item attack as weapon"
get item attack as weapon

were inconsistent, I suppose those should be
Code:
get item weapon picture
get item weapon palette
get item weapon attack

A complication is that I'd like to allow items equipped in slots other than the Weapon slot to also add attacks directly to the hero battle menu. For example, "Shield bash" or some talisman that can be invoked for a spell. How you define that in the hero battle menu editor is a tricky detail, but I guess such pieces of equipment can still be called "weapons" even if they aren't in the "weapon" slot.
Metal King Slime
Send private message
 
 PostFri Jul 17, 2020 10:50 am
Send private message Reply with quote
I'm adding alternative commands to "fade screen in" and "fade screen out" which don't pause the engine during the fade, and which don't require a "wait(1)" beforehand. There'll be a new "wait for fade" command too. I think it's better not to just add another argument to "fade screen in/out" because they will behave so completely different to the original commands that it would be unhelpful to conflate them, and lists of arguments aren't very readable/self-documenting.

But what to call them?
Code:
fade in no wait
fade out no wait

fade in
fade out

start fade in
start fade out

start fade screen in
start fade screen out

fade to palette
fade to color

OK, I have some favourites. Didn't think of them until I wrote this up.
Liquid Metal King Slime
Send private message
 
 PostFri Jul 17, 2020 11:23 am
Send private message Reply with quote
Code:
fade in no wait
fade out no wait
Metal Slime
Send private message
 
 PostFri Jul 17, 2020 9:29 pm
Send private message Reply with quote
The current command is "fade screen in". I propose a fadeless transition be called "fadeless screen in" and fadeless screen out"
To friends long gone, and those I've yet to meet - thank you.
Liquid Metal King Slime
Send private message
 
 PostFri Jul 17, 2020 10:00 pm
Send private message Reply with quote
These are my favorites:

Code:

fade to palette
fade to color
Chemical Slime
Send private message
 
 PostFri Jul 17, 2020 11:08 pm
Send private message Reply with quote
Fenrir-Lunaris wrote:
The current command is "fade screen in". I propose a fadeless transition be called "fadeless screen in" and fadeless screen out"
/

yes this. or possibly even screen in/out, or screen on/off or similar
"Fantasy abandoned by reason produces impossible monsters:
united with reason, is the mother of the arts and the origin of their marvels."
Metal King Slime
Send private message
 
 PostSat Jul 18, 2020 5:51 am
Send private message Reply with quote
Everyone has a different preference! Mine is "start fade in/out", because I think it makes the difference from "fade screen in/out" clear and lets you remember which is which, and IMO that's the most important thing. "fade screen in/out" is easily the most misunderstood script command; I see that even a lot of people who have been using the engine for decades don't realise that it pauses the game and happens immediately, and it's traumatised generations of users into sprinkling all their scripts with unnecessary waits.

"fadeless"? Well, it still fades. But I am thinking of adding another command ("set fade state"?) which immediately changes to a partial faded out state (e.g. 20% faded out to blue). Basically, it's like "tweak palette" except that it also affects any 24-bit color (nonpaletted) sprites. Or maybe I should instead double-purpose "tweak palette" to do that.
Slime Knight
Send private message
 
 PostSat Jul 18, 2020 7:01 am
Send private message Reply with quote
Unless I'm not understanding something fundamental, I just thought a 'wait for fade screen' command would be appropriate, while removing the inherent/inconsistently placed wait. (Does this pertain to battles? If not, let's pace ourselves)
Display posts from previous: