01-16-2012, 07:21 PM
So I have one or two question regarding an NPC "automatic" action. In FF6LE there are 16 possible action that can be used on an NPC. A lot seems to do nothing and the most commonly used is action 3, which makes the NPC walk pseudo-randomly. I don't know what each of the 16 is suppose to do.
So how could I make action for a npc that would follow a pattern or act in a random way? If I do them thru events I could maybe make one infinite loop with a pattern of actions for a NPC and enable the movement of the party while the event is executed. However the game would read the same portion of code over and over so I wouldn't be able to assign other actions to other NPCs or simply continue the event.
The second option would be to edit some of the action numbers. Those actions must be executed when the npc data is read when a map is loaded. I found where the data is read:
This is part of the map loading subroutine and at C0/52A8, it seems each byte of each NPC data are read and the function loop as long as there is NPC to be loaded. Byte 8 of the NPC data hold the movement of the NPC if I'm right and it seems it would be loaded here:
This is where I'm stuck. I don't know where the NPC action is loaded/executed. There should be a subroutine with 15 branchings depending on which action has the NPC or 16 small subroutine, so one for each action. If I could find them I could study them and eventually modify them.
Let's just think of scenarios where I would have a panic event where everyone is running in a different direction or a drunken guy that would do a pseudo random moving pattern while jumping once in a while but those movements would be executed as long as the party is on the map.
So is there an assembly god or a event master to help me solve this issue? Plus, custom NPC moves would be a neat addition for any event creator...
So how could I make action for a npc that would follow a pattern or act in a random way? If I do them thru events I could maybe make one infinite loop with a pattern of actions for a NPC and enable the movement of the party while the event is executed. However the game would read the same portion of code over and over so I wouldn't be able to assign other actions to other NPCs or simply continue the event.
The second option would be to edit some of the action numbers. Those actions must be executed when the npc data is read when a map is loaded. I found where the data is read:
Code:
C0/BFB8: 20A852 JSR $52A8 (Load NPC data)
This is part of the map loading subroutine and at C0/52A8, it seems each byte of each NPC data are read and the function loop as long as there is NPC to be loaded. Byte 8 of the NPC data hold the movement of the NPC if I'm right and it seems it would be loaded here:
Code:
C0/5373: BF171AC4 LDA $C41A17,X (Load byte 8/Graph. action of the NPC data ?)
C0/5377: 290F AND #$0F
C0/5379: 197C08 ORA $087C,Y
C0/537C: 997C08 STA $087C,Y
C0/537F: BF171AC4 LDA $C41A17,X
C0/5383: 2930 AND #$30
C0/5385: 0A ASL A
C0/5386: 0A ASL A
C0/5387: 998C08 STA $088C,Y
C0/538A: BF171AC4 LDA $C41A17,X
C0/538E: 29C0 AND #$C0
C0/5390: 4A LSR A
C0/5391: 196808 ORA $0868,Y
C0/5394: 996808 STA $0868,Y
This is where I'm stuck. I don't know where the NPC action is loaded/executed. There should be a subroutine with 15 branchings depending on which action has the NPC or 16 small subroutine, so one for each action. If I could find them I could study them and eventually modify them.
Let's just think of scenarios where I would have a panic event where everyone is running in a different direction or a drunken guy that would do a pseudo random moving pattern while jumping once in a while but those movements would be executed as long as the party is on the map.
So is there an assembly god or a event master to help me solve this issue? Plus, custom NPC moves would be a neat addition for any event creator...