ff3:ff3us:tutorial:events:action

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
ff3:ff3us:tutorial:events:action [2018/05/06 16:23]
lockirby2 [Our First Action Queue]
ff3:ff3us:tutorial:events:action [2018/05/06 16:53]
lockirby2 [The Actions]
Line 26: Line 26:
 This is the meat of the action queue, containing the actions that you want the character to perform.  There is a list of actions [[ff3:ff3us:doc:asm:codes:movement_codes|here.]]  The vast majority of these are self-explanatory.  Many just tell the character to strike a pose or walk somewhere.  The commands between $C0 and $C4 allow you to change how fast the character walks when they move.  Ignore the commands related to branching or setting event bits for now; these will be covered in later sections of the tutorial. This is the meat of the action queue, containing the actions that you want the character to perform.  There is a list of actions [[ff3:ff3us:doc:asm:codes:movement_codes|here.]]  The vast majority of these are self-explanatory.  Many just tell the character to strike a pose or walk somewhere.  The commands between $C0 and $C4 allow you to change how fast the character walks when they move.  Ignore the commands related to branching or setting event bits for now; these will be covered in later sections of the tutorial.
  
-By default, a character will actually take footsteps when they are told to move somewhere.  If you execute the $80 command (Move character up 1 tile)then the $82 command (Move character down 1 tile), the character will take one step upwards and one step downwards.  If your intention was to make a character float up and down while facing towards the camera, these footsteps would need to be disabled by placing a $C7 command in the character's action queue.  In other words, the middle of your action queue might contain the following commands: CE C7 80 82.+By default, a character will actually take footsteps when they are told to move somewhere.  If you execute the $80 command (Move character up 1 tile) and then the $82 command (Move character down 1 tile), the character will take one step upwards and one step downwards.  If your intention was to make a character float up and down while facing towards the camera, these footsteps would need to be disabled by placing a $C7 command in the character's action queue.  In other words, the middle of your action queue might contain the following commands: CE C7 80 82.
  
 You should also take note of the $E0 command.  Delays tend to be important in action queues because it takes a very short amount of time for characters to strike poses.  Let's say that you want a character to shake their head back and forth.  You may be tempted to alternate between the $23 and $63 commands.  Unfortunately, the character will alternate so quickly between the "Front, head turned (left)" and "Front, head turned (right)" poses that the player won't be able to see it!  Inserting a short delay between these poses will fix the issue.  Instead of using 23 63 23 63, you might want to use 23 E0 01 63 E0 01 23 E0 01 63.  Unfortunately, even the shortest delay ($01) is too long for some purposes.  To create a very tiny delay, we can create four tiny action queues in a row, instead of creating one action queue with all four head-shaking poses in it.  You will see an example of this below. You should also take note of the $E0 command.  Delays tend to be important in action queues because it takes a very short amount of time for characters to strike poses.  Let's say that you want a character to shake their head back and forth.  You may be tempted to alternate between the $23 and $63 commands.  Unfortunately, the character will alternate so quickly between the "Front, head turned (left)" and "Front, head turned (right)" poses that the player won't be able to see it!  Inserting a short delay between these poses will fix the issue.  Instead of using 23 63 23 63, you might want to use 23 E0 01 63 E0 01 23 E0 01 63.  Unfortunately, even the shortest delay ($01) is too long for some purposes.  To create a very tiny delay, we can create four tiny action queues in a row, instead of creating one action queue with all four head-shaking poses in it.  You will see an example of this below.
Line 47: Line 47:
 ===== A Larger Example ===== ===== A Larger Example =====
  
-Right now, the event uses a red flash to indicate that the guards are approaching.  To improve on this, we can script some guards to physically approach the party.  Since the battle includes two guards, we want two guards to be part of the event as well.+Right now, the event uses a red flash to indicate that the guards are approaching.  This would be improved if guards were to physically approach the party.  Since the battle includes two guards, we want two guards in the event as well.
  
 As before, our first goal is to determine which action queue to begin.  The guards are NPCs, so we definitely need to use a command between $10 and $2F.  To narrow it down further, we need to look in FF6LE.  It might not be obvious at first glance, but the map that we need to look at is "[013] Narshe, Outside, Beginning (WOB)" This map is loaded at the beginning of the game, and it is distinct from the map that is usually loaded when you enter Narshe. As before, our first goal is to determine which action queue to begin.  The guards are NPCs, so we definitely need to use a command between $10 and $2F.  To narrow it down further, we need to look in FF6LE.  It might not be obvious at first glance, but the map that we need to look at is "[013] Narshe, Outside, Beginning (WOB)" This map is loaded at the beginning of the game, and it is distinct from the map that is usually loaded when you enter Narshe.
Line 57: Line 57:
 Now we can cross-reference this with the Event Commands Document, which states that we can use $10 to move NPC #0 and $11 to use NPC #1.  We will need to create a separate action queue for each of the two guards. Now we can cross-reference this with the Event Commands Document, which states that we can use $10 to move NPC #0 and $11 to use NPC #1.  We will need to create a separate action queue for each of the two guards.
  
-First of all, we need to move the two guards to the bottom of the screen, which can be accomplished by using the $D5 command in the action queue.  Playing around with the LE and the emulator, I determined that I want to place the guards at (37, 58) and (39, 58).  Then I want the guards to walk onscreen from the south.  You can use the LE to see the tiles that these coordinates point to.  These coordinates become ($25, $3A) and ($27, $3A) when converted to hexadecimal.  The final commands are D5 25 3A and D5 27 3A.+First of all, we need to move the two guards to the bottom of the screen, which can be accomplished by using the $D5 command in the action queue.  By playing around with the LE and the emulator, I determined that I want to place the guards at (37, 58) and (39, 58).  Then I want the guards to walk onscreen from the south.  You can use the LE to see the tiles that these coordinates point to.  These coordinates become ($25, $3A) and ($27, $3A) when converted to hexadecimal.  The final commands are D5 25 3A and D5 27 3A.
  
 Presumably, the guards would be running towards the Magitek Armour, ready for attack.  We should set their movement speed to "fast" with the $C3 command. Presumably, the guards would be running towards the Magitek Armour, ready for attack.  We should set their movement speed to "fast" with the $C3 command.
Line 90: Line 90:
 === Finishing up === === Finishing up ===
  
-Now that we have the action queues themselves sorted out, we need to look at some of the nuts and bolts to make it all work.  Before the action queues are started, the NPCs need to be "created", which presumably loads their data into the game's memory.  This is done with the $3D command.  We also need to use the $41 command to make their sprites visible to the player.+Now that we have the action queues sorted out, we need to look at some of the nuts and bolts to make it all work.  Before the action queues are started, the NPCs need to be "created", which presumably loads their data into the game's memory.  This is done with the $3D command.  We also need to use the $41 command to make their sprites visible to the player.
  
-After the queues have been run, there is one issue to be sorted out.  We want to wait for both guards to reach the player before initiating the dialogue box.  As of yet, we don't know which guard's actions will finish first.  If NPC #0 finishes first, the game will wait for NPC #1 to finish anyways because we added $80 to the second byte of NPC #1's action queue.  Howeverif NPC #1 finishes first, the dialogue will start before NPC #0 is in position.  You might prefer this as a stylistic choice anyways, but if you don't, you can use the $35 command to wait for NPC #0's action queue to finish before continuing.+After the queues have ended, there is one issue to be sorted out.  We want to wait for both guards to reach the player before initiating the dialogue box.  We wait for NPC #1's action queue to finish before continuing, but we don't wait for NPC #0.  For all we know, NPC #will still be walking when NPC #1 finishes moving.  You might prefer this as a stylistic choice anyways, but if you don't, you can use the $35 command to wait for NPC #0's action queue to finish before continuing.
  
 Finally, we want to erase the NPCs after the battle is fought.  We can delete the NPCs using the 3E command.  This should be done before fading in the screen with the $96 command. Finally, we want to erase the NPCs after the battle is fought.  We can delete the NPCs using the 3E command.  This should be done before fading in the screen with the $96 command.
  • ff3/ff3us/tutorial/events/action.txt
  • Last modified: 5 years ago
  • (external edit)