Users browsing this thread: 1 Guest(s)
Events: NPC scripts
07-31-2013, 04:32 PM
So, early early in the game, I am working on NPC scripts for some NPCs that walk around, the problem I'm having is that when I enter a battle or even my menu window, when I come back the NPC script starts over from whatever position the NPC was in ending in the NPC traveling outside of where it is supposed to go.
There has got to be a setting or an override bit or something that remembers where the NPC is in the code so when the screen is restored, it doesn't start the script over. I just don't know what that bit or setting might be.
A little help?
There has got to be a setting or an override bit or something that remembers where the NPC is in the code so when the screen is restored, it doesn't start the script over. I just don't know what that bit or setting might be.
A little help?
Let's Hack FF6 Stream: https://www.twitch.tv/b_run_
FFVI - Children of Vector: http://www.ff6hacking.com/forums/showthr...p?tid=2386
Monster AI Upgrade Patch: http://www.ff6hacking.com/forums/showthr...p?tid=2673
MMMMMagic 2.0: http://www.ff6hacking.com/forums/showthr...p?tid=3330
Ah yes, this is the bit you seek here:
1B6 B6:6 Maintains the state of NPCs (after a battle, for instance)
Needs to go in the entrance event.
1B6 B6:6 Maintains the state of NPCs (after a battle, for instance)
Needs to go in the entrance event.
We are born, live, die and then do the same thing over again.
07-31-2013, 07:58 PM
(07-31-2013, 05:51 PM)Gi Nattak Wrote: Ah yes, this is the bit you seek here:
1B6 B6:6 Maintains the state of NPCs (after a battle, for instance)
Needs to go in the entrance event.
Thanks again Mike! Does it need to be set every time or is it persistent until i clear it?
Let's Hack FF6 Stream: https://www.twitch.tv/b_run_
FFVI - Children of Vector: http://www.ff6hacking.com/forums/showthr...p?tid=2386
Monster AI Upgrade Patch: http://www.ff6hacking.com/forums/showthr...p?tid=2673
MMMMMagic 2.0: http://www.ff6hacking.com/forums/showthr...p?tid=3330
Hey np, glad I can help. =)
And yeah, it will stay persistent working as long as it's being set there in the maps entrance event. I've never used it outside of that. I'm still a little confused on how the bit works - like if you have it being set in a cetain map for an NPC(s) movement script, it does not effect any other maps NPC's movement scripts - so it seems to get cleared some other way I guess outside of the entrance event, as opposed to how most bits are set. Hm. Maybe it's one that is cleared on each step, which is why it would be used in the E.E., as to just stay set while on that map.
And yeah, it will stay persistent working as long as it's being set there in the maps entrance event. I've never used it outside of that. I'm still a little confused on how the bit works - like if you have it being set in a cetain map for an NPC(s) movement script, it does not effect any other maps NPC's movement scripts - so it seems to get cleared some other way I guess outside of the entrance event, as opposed to how most bits are set. Hm. Maybe it's one that is cleared on each step, which is why it would be used in the E.E., as to just stay set while on that map.
We are born, live, die and then do the same thing over again.
07-31-2013, 09:42 PM
So it doesn't seem to be working. I set the bit, ive got the RAM opened and can verify that I am looking at the correct byte and correct bit, and it is definitely set... but when I go to the menu and back my sprites are still starting their scripts over... the sprites themselves stay exactly where they should be... just the scripts start over (which is exactly what it was doing before). Thoughts?
Let's Hack FF6 Stream: https://www.twitch.tv/b_run_
FFVI - Children of Vector: http://www.ff6hacking.com/forums/showthr...p?tid=2386
Monster AI Upgrade Patch: http://www.ff6hacking.com/forums/showthr...p?tid=2673
MMMMMagic 2.0: http://www.ff6hacking.com/forums/showthr...p?tid=3330
Ah my bad, I forgot what it needs is a check for the bit instead of setting it - so like this:
C0 B6 81 B3 5E 00
= C0 If ($1E80($1B6) [$1EB6, bit 6] is set), branch to $CA5EB3 (simply returns)
Also to be safe make sure it's the first thing in the entrance event, but yeah that should do it now. Sorry about that =)
C0 B6 81 B3 5E 00
= C0 If ($1E80($1B6) [$1EB6, bit 6] is set), branch to $CA5EB3 (simply returns)
Also to be safe make sure it's the first thing in the entrance event, but yeah that should do it now. Sorry about that =)
We are born, live, die and then do the same thing over again.
07-31-2013, 10:05 PM
OOOOOOOHHHHH! That makes sense! because it runs the entrance event every time the screen loads for any reason... so by sending it to return, you are skipping the games queue to start the script over again! Thanks!
Let's Hack FF6 Stream: https://www.twitch.tv/b_run_
FFVI - Children of Vector: http://www.ff6hacking.com/forums/showthr...p?tid=2386
Monster AI Upgrade Patch: http://www.ff6hacking.com/forums/showthr...p?tid=2673
MMMMMagic 2.0: http://www.ff6hacking.com/forums/showthr...p?tid=3330
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)