Movement - Forum
Main My profile Registration Log out Login
Pokemon Hacking
Saturday
10.12.2016
11:19 PM
Welcome Guest | RSS LoginRegistrationMain
[ New messages · Members · Forum rules · Search · RSS ]
Page 1 of 11
Forum moderator: fuzzyketchup 
Forum » Tools » Pokescript » Movement (How to make an NPC, and/or the Player move)
Movement
fuzzyketchupDate: Thursday, 2012-10-04, 6:26 PM | Message # 1
Private
Group: Administrators
Messages: 14
Status: Offline
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.

................................[]<--Grunt -->Exit
<--Exit Player-->[][][][]

We want the grunt to walk over to the Player and talk to him.

#org $rocket
lock
faceplayer
checkflag 0x1204
if b_true goto $done
message $1
$1 1 = Grunt: Hey you!
boxset 6
applymovement 0x01 $move
$move
#raw 0x10 0x12 0x12 0xFE
pausemove 0
message $2
$2 1 = You're not a member of Team Rocket!\nGet out of here!
boxset 6
applymovement 0xFF $move1
$move1
#raw 0x12 0x03 0xFE
pausemove 0
applymovement 0x01 $move2
$move2
#raw 0x13 0x13 0x11 0xFE
pausemove 0
release
end

#org $done
lock
faceplayer
applymovement 0x1 $move4
$move4
#raw 0x62 0xFE
pausemove 0
message $3
$3 1 = Oh no! It's that kid who beat the\nboss!
boxset 6
applymovement 0x1 $move5
$move5
#raw 0x13 0x13 0x13 0x13 0x13 0xFE
pausemove 0
removesprite 0x1
setflag 0x1205
release
end

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

 
Forum » Tools » Pokescript » Movement (How to make an NPC, and/or the Player move)
Page 1 of 11
Search:


Copyright FuzzyketchupTuts © 2016
Create a free website with uCoz
Scratch Project