Users browsing this thread: 1 Guest(s)
Event Bits vs. Memory Address

#1
Posts: 617
Threads: 49
Thanks Received: 0
Thanks Given: 5
Joined: Feb 2017
Reputation: 25
Status
None
I am trying to create some NPCs that only show up after a certain event has been triggered, but I can't figure out how to convert from event bits to memory addresses. 

Let's take an example that I know. In the "Choose a Scenario" screen, the NPC Sabin shows up as long as the following is set:
Memory Address: 1EE5
Memory Bit: 5
When you clear Sabin's scenario, you clear event bit "32A" with the hex code D7-2A. Clearing this causes the NPC to go away.

So how do you get from 32A to 1EE5:5? I can't figure out the conversion.

Specifically, I am looking to have an NPC show up after event bit 048 is set (Terra goes berserk and flies off). I would settle for the Memory Adress/Bit, but I'd like to know how to get between Event Bits and Memory Addresses so I don't have to ask every time.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#2
Posts: 127
Threads: 8
Thanks Received: 21
Thanks Given: 12
Joined: Jan 2012
Reputation: 13
Status
None
Check out the Event Bits document by Novalia Spirit

https://www.ff6hacking.com/wiki/lib/exe/...t_bits.zip

048 89:0 Searching for Terra (affects Narshe, Figaro Castle, South Figaro)

So RAM $1E89, bit nr. 0
  Find
Quote  

#3
Posts: 617
Threads: 49
Thanks Received: 0
Thanks Given: 5
Joined: Feb 2017
Reputation: 25
Status
None
I don't know if that's it. I searched all of Narshe, Figaro, and South Figaro for NPCs affected by Memory Address 1E89:0, and fond none. In fact, most of the Memory addresses for NPCs didn't seem to be covered by Novalia Spirit's document.

Take for example, the ghost at the entrance of Zozo that explains how to use Espers. He shows when Memory Address 1EF0:5 is set, which I believe is Event Bit $385 This is not covered in Novalia's document, and when I look at the event that sets it via ZoneDoctor (the only real event editor I have), it is set by hex D6-85, with the description of
"Set event bit $1E80($3..."
"Address: 1E90"
"Bit: 5"

Now, I know that ZoneDoctor is not to be trusted for anything. I'm just trying to figure out how to get from the hex or event bit number to the memory address.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#4
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
yes, some of those are outside the scope of his document:

Quote:This document contains a full listing of the event bits in the game, with the
exception of activation flags for non-player characters, which are detailed in
a separate document.

[...]

Further note that the event bits are
stored in 96 bytes of RAM from address $1E80 to $1EDF in bank $7E.

but both types are addressed via the same class of instruction:

http://www.angelfire.com/al2/imzogelmo/E...mmands.txt

see Commands D0 thru DD.

how it works:
1) there are multiple commands, each tackling different 32-byte ranges.
2) the 1-byte parameter is the BIT count from Bit 0 of Byte 0 within that 32-byte range.  say we wanted the fourth bit of the second byte.  that'd be Byte 1, Bit 3.  with there being 8 bits in a byte, our parameter would be (1 * 8) + 3 = 11d = 0Bh.

now, putting those together.  say we want overall event Byte 65d, Bit 3 (or an overall bit index of 520d or 208h).  we'd feed Parameter 0Bh to Event Command D4h or D5h.
Quote  
[-] The following 1 user says Thank You to assassin for this post:
  • PowerPanda (12-02-2017)

#5
Posts: 127
Threads: 8
Thanks Received: 21
Thanks Given: 12
Joined: Jan 2012
Reputation: 13
Status
None
(12-01-2017, 07:24 PM)PowerPanda Wrote: I don't know if that's it. I searched all of Narshe, Figaro, and South Figaro for NPCs affected by Memory Address 1E89:0, and fond none. In fact, most of the Memory addresses for NPCs didn't seem to be covered by Novalia Spirit's document.

Take for example, the ghost at the entrance of Zozo that explains how to use Espers. He shows when Memory Address 1EF0:5 is set, which I believe is Event Bit $385 This is not covered in Novalia's document, and when I look at the event that sets it via ZoneDoctor (the only real event editor I have), it is set by hex D6-85, with the description of
"Set event bit $1E80($3..."
"Address: 1E90"
"Bit: 5"

Now, I know that ZoneDoctor is not to be trusted for anything. I'm just trying to figure out how to get from the hex or event bit number to the memory address.

There are a number of things that change with $1E89:0 mostly story events that have taken place are disabled, look for "If ($1E80($048) [$1E89, bit 0] is set)" in the event dump.

" $1EE0-$1F5F NPC Event Bits (to enable/disable NPC's, initialized for new game, all other event bits are cleared) "
 - from https://www.ff6hacking.com/wiki/doku.php...:field_ram

Your example with the ghost in Zozo concerns NPC Event Bits that are used differently from regular/story event bits. NPC event bits will be different for each location so you need to look up the NPC list for each location you're working with.

NPC dump: http://www.angelfire.com/al2/imzogelmo/NPCDataTxt.txt

hex event bit number to memory address would calculate as such: 
RAM Byte = 1E80h + (BITh / 8)
RAM Bit = BITh % 8
  Find
Quote  
[-] The following 1 user says Thank You to m06 for this post:
  • PowerPanda (12-02-2017)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite