Jump to content

Eventing and Variables


Klokinator
 Share

Recommended Posts

So I'm pretty sure that single number variables are doable in romhacking with simple eventing ("Simple" meaning not-ASM), but I'm not sure how flexible they are.

How does one set a variable?

Can the variable be a negative number?

Can you set a maximum and minimum for that variable, ie: -10 to +10?

Can that variable be used for IF events, like saying "IF variable is -7, recruit this unit"?

Can that variable be a range of numbers? "IF variable is -3 to +2, recruit this unit"?

I'm assuming most of these are doable but I'd like to get confirmation and maybe a short explanation of how to event them.

Link to comment
Share on other sites

if you could find some random address of free memory it would be very simple to just write some asm to add or subtract from the value stored there

it probably wouldn't survive a hard reset [ie turning the game off and back on] though

Link to comment
Share on other sites

FE8 definitely uses variables with its memory slot system (ex. giving items and money, changing AI), but I don't know if any of the memory slots actually persist between chapters or through a hard reset.

You might be able to do some kerjiggery with permanent event IDs; perhaps you could write to the byte used by one of them and just never invoke that given ID for anything else, but again, I don't know how the game would react to fiddling around with them.

(I may or may not be taking a total shot in the dark here!)

Link to comment
Share on other sites

Hmm, now that you mention it, Event ID's may have been the old system I used before. All I really need is something with a number I can change via events and use for IF commands to see if something is doable or not. Like if I set this theoretical number to 3 and list that "IF this number is 3 then you can do this". Also, if I can't make this morality system use something resembling a variable, then I can just use classes by saying "If player unit 01 is a mage, this happens, but if that character is a shaman, this happens" or etc.

Link to comment
Share on other sites

Hmm, now that you mention it, Event ID's may have been the old system I used before. All I really need is something with a number I can change via events and use for IF commands to see if something is doable or not. Like if I set this theoretical number to 3 and list that "IF this number is 3 then you can do this".

doesn't exist in fe7 without asm

Also, if I can't make this morality system use something resembling a variable, then I can just use classes by saying "If player unit 01 is a mage, this happens, but if that character is a shaman, this happens" or etc.

no you can't
Link to comment
Share on other sites

it probably wouldn't survive a hard reset [ie turning the game off and back on] though

there's random bits of free space (pun not intended... at first) here and there such as the tactician's name/gender/birthmonth bits and potentially unused bits in character data, of course if you actually use those that's an issue but they're not too hard to avoid (read: get rid of the tactician creation and you have several bytes of free space in the memory... though it's still not any grand amount)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...