Urgh. I'm still learning, and it looks like I still have problems with AI scripting -__-
I spent a lot of time trying to pull this off, tonight. Here is your script translated in words I understand more easily (= no POP, PUSH, MASK or STACK for me
) :
02 2060 -> Load value of Target=Self
00 4003 -> Load value of Status=Poison
80 -> Combine the two above (Self+Poison)
70 002D -> If the above is not true, Jump to the address 0x02D. If true, continue with script:
02 00E0 -> Load value of {VAR E0}
60 00 -> Call for value : 00
44 -> Greater than (meaning of those 3 lines : if value of {VAR E0} is greater than 0)
70 001E -> If the above is not true, Jump to 0x01E. If true ({VAR E0}>0), continue with script :
12 00E0 -> Load address of {VAR E0}
02 2060 -> Target = self
02 4180 -> MaxHP
80 -> Combine the two above (Self+MaxHP)
90 -> Put value (Self+MaxHP) into address of {VAR E0}
12 2060 -> Load address of Target=Self
12 4180 -> Load address of MaxHP
80 -> Combine the two above (Self+MaxHP)
02 2060 -> Load value of Target=Self
02 4160 -> Load value of HP
80 -> Combine the two above (Self+HP)
90 -> Put value (Self+HP) into address (Self+MaxHP)
As you said this isn't complete, since when Poison is cleared, the value we saved into {VAR E0} needs to be inserted back into the address of (Self+MaxHP). This is the easy part. But what I don't get is why do we need to set the value of {VAR E0} to zero when Poison is cured (at the first jump address ?), since MaxHP will only drop again (when Cloud gets Poisoned again) if {VAR E0} is greater than zero...
I understand the logic, but here is my problem : in the beginning of your script, we need the value of {VAR E0} to be greater than 0, but we didn't set it to anything beforehand. Do all variables like this one have an initial value of 1 or something ?... ...It would have made more sense if variables had an initial value of zero (this is the case in FFVI, since, to make enemies talk once at the start of a battle, the script would look like this :
If {VAR E0} is 0,
Display message : "Go guys ! Ha Ha ha... ...Give up ?"
Set {VAR E0} to 1,
End if
Variables like this one always being 0 at the start of a battle, it ensures the dialog box only displays once, since we set it to 1 before the condition ends. End of the FFVI parenthesis)
Sooo, because of the fact that {VAR E0} is not 0 right from the start, I fail to see how we can use it as a condition, since the other value we will load into it is also greater than 0 (Cloud's maxHP ; ie 2500).
Anyways, since my attempts at creating a working script with the above ended up with Cloud's maxHP becoming 0 (when I set {VAR E0} to 0
) and thus killing him, I tried to use Bosola's idea instead : using NullRestorative. So I made this script (with my very-personal-and-not-very-accurate AI translation
) :
02 2060 -> self
00 4003 -> poison
80 -> combine
70 XXXX -> if not, jump to end of script
12 2060 -> load self
10 42A9 -> load nullrestorative
80 -> combine
60 01 -> activate !
90 -> Go ! :P
LOL-worthy translation, ain't it ?
And I bet you guys already see the problem ^^;
...It works, but when Cloud is healed from Poison, the NullRestorative doesn't go away... I looked through your help files in Wall Market and brainstormed until I got a headache, but I don't see how I can make use of the "if" statement to tell the game :
"don't nullify Restorative if Cloud doesn't have the Poison status anymore, you retard". God, this sure isn't easy, especially for someone like me who never followed programming lessons. How frustrating.