101
Gameplay / Re: Unused/useless variables safe to use in savemap? (PSX)
« on: 2014-10-27 16:03:48 »It might be the method being used to adjust HP. One thing you should do is have an English scene.bin you can open up and have a look at the AI in; I learned a lot from looking at the default game's enemy AI and how they work. So for HP, I looked at how Bizarro and Safer determine and adjust their HP before the battle starts (because it rises/drops depending on previous battles, player level, etc.)Thanks for the code, many cool things to learn from trying this out! I'll do it shortly.
This is a portion from a test group I had for adjusting enemy stats; I can confirm this works in the scene.bin, but the enemy is applying this to itself (which is why it uses Self.) so you'd need to use a different mask.Code: [Select]13 01A0
61 2710
90
12 2060
13 4180
80
03 01A0
90
12 2060
13 4160
80
02 2060
03 4180
80
90
Which looks like this:
LocalVar:01A0 <- 10000
Self.MHP <- LocalVar:01A0
Self.HP <- Self.MHP
Thing to note there is that we're using 61 instead of 60 for the number being pushed into 01A0. We can't put a number like that into [1][80] because it's a one-byte address (and we can't get battle to read [2], which is where 2-byte stuff is read from). For stats like Strength and Magic Attack, you can apparently just push a value in directly but enemies I've seen do it this way for HP. What we need to do now is change the mask so that it applies to the enemy. There's two ways to try, but one I've not tested yet:Code: [Select]Enemy ID
12 0100
02 2050
02 4120
80
60 16 [Scorp's Enemy ID]
40
90
By Bit (untested)
12 0100
60 03
87
90
With that loaded into the 0100 variable, you'd then replace the 2060s in this code with 0100 for:
LocalVar:01A0 <- 10000
LocalVar:0100.MHP <- LocalVar:01A0
LocalVar:0100.HP <- LocalVar:0100.MHP
Ideally, if the second one works (Bit) then it could be applied to any single enemy. Give it a whirl and see what happens; but if it doesn't work inside the IF thing then there must be something wrong with the way I set it up originally. You could perhaps get rid of the top IF bit because pre-battle only runs once so that part is now obsolete.
And yes, I'm already looking through scene.bin. I'll also just mention again that the Guard Scorpion's HP WAS lowered when I didn't use your If statement, does this still fall under "It might be the method being used to adjust HP?" would it need to be different method just because its in that if statement?