|fuzzyketchup||Date: Thursday, 2012-10-04, 6:26 PM | Message # 1|
|Alright this is pretty cool, and it is an important part to make a game look very professional. |
For this we will assume that sprite 1 is a Rocket Grunt who is 1 block up, and 3 blocks right of the player. It is important to know that sprite 0xFF is the player sprite. The player is exactly 2 steps from the entrance.
We want the grunt to walk over to the Player and talk to him.
if b_true goto $done
$1 1 = Grunt: Hey you!
applymovement 0x01 $move
#raw 0x10 0x12 0x12 0xFE
$2 1 = You're not a member of Team Rocket!\nGet out of here!
applymovement 0xFF $move1
#raw 0x12 0x03 0xFE
applymovement 0x01 $move2
#raw 0x13 0x13 0x11 0xFE
applymovement 0x1 $move4
#raw 0x62 0xFE
$3 1 = Oh no! It's that kid who beat the\nboss!
applymovement 0x1 $move5
#raw 0x13 0x13 0x13 0x13 0x13 0xFE
Alright so a whole lot of new stuff all thrown together in this one. Let's see if I can walk you through it.
applymovement 0x1 $move: This selects the sprite you wish to have move (0x1). In this case, it's te Team Rocket Grunt. It assigns the movement to $move
$move:: This tells the game where the actual commands are located in the script.
#raw 0x10 0x12 0x12 0xFE: This tells the game the directions to have the Team Rocket Grunt move in this case it's 1 down (0x10) and then 2 left (0x12) so that he is facing the player, but not standing on the player.
pausemove 0: This tells the game the movement code has ended and that it can continue with the script.
applymovement 0xFF $move1: This tells the game to move sprite 0xFF (the player). It moves him to the left a space (0x12) and then turns him facing right (0x03).
applymovement 0x01 $move2: This is just like applymovement 0x1 $move just moving back to where he started.
After an event has been finished when you enter the area the Team Rocket Grunt will have an [!] box pop up above his head then say "Oh no! It's that kid who beat the boss!" and then run away.
applymovement 0x1 $move4: This is just the command for the [!] box (0x62).
applymovement 0x1 $move 5 has him run off the screen (we know he is 3 blocks away so he needs to move MORE than 7 away. 3+5=8. 8 > 7.
removesprite 0x1: Alright since he's off screen, we need to get rid of him. removesprite and then the player number (0x1) will remove the sprite of the Rocket Grunt, but it will not KEEP him removed, he will reappear the instant you take a step.
setflag 0x1205: This is a little more complicated than the regular flag for one reason only. We need to remove the character with this flag. To to this we need to set his Player ID to 1205
Player ID is in the picture in the link above. It is located in the events menu on Advance Map while clicked on the person you want to edit.
That's actually it for movement.
Here is a list of movements.
Creator of http://pkmnhacking.ucoz.com