View Single Post
  #8104    
Old April 6th, 2013, 08:05 PM
LocksmithArmy's Avatar
LocksmithArmy
Mew!
 
Join Date: Feb 2013
Age: 25
Gender: Male
well its quite simple...
the character you want to follow has a movment sequence... you just have to copy that movement sequence with your character... only one step behind.

if character 1 and character 2 are beside eachother face to face... (character one is on the left)
if character 1s sequence looks like Walk_down walk_down walk_down walk_left
character 2 can be walk_left walk_down walk_down walk_down walk_left

notice how character 2 has a step before the setps that character 1 has... that means he should be following... movement commands are simple really.

you will want to check the players facing most likely... this will tell you weather you are standing above, below, left or right of the character you want to follow, so you know which movements to make to do the following...

I hope that made since...
if not here is an example:
Spoiler:

#org 0x8800190
'-----------------------------------
closemsg
applymovement 0x4 0x8800200 ' walk_right walk_righ...
compare PLAYERFACING UP
if == call 0x8800240 ' Equal To
compare PLAYERFACING DOWN
if == call 0x8800250 ' Equal To
compare PLAYERFACING RIGHT
if == call 0x8800260 ' Equal To
compare PLAYERFACING LEFT
if == call 0x8800270 ' Equal To
pauseevent 0x0
msgbox 0x8800220 ' \v\h01 entered a \ns...
callstd MSG_NOCLOSE ' Non-closing message
closemsg
warp 0x4 0x4 0xFF 0x3 0x4
disappear 0x7
movesprite2 0x4 0x6 0x3
spritebehave 0x4 0x8
end

#org 0x8800240
'-----------------------------------
applymovement PLAYER 0x8800210 ' walk_up walk_right w...
return

#org 0x8800250
'-----------------------------------
applymovement PLAYER 0x8800280 ' walk_down walk_right...
return

#org 0x8800260
'-----------------------------------
applymovement PLAYER 0x8800290 ' walk_right walk_righ...
return

#org 0x8800270
'-----------------------------------
applymovement PLAYER 0x88002A0 ' walk_up look_down wa...
return


#org 0x8800220
= \v\h01 entered a \nsecret passage!

#org 0x8800200(Oak walks this way)
M walk_right walk_right walk_right walk_right walk_right walk_right hide end

#org 0x8800210(I am facing UP, so I am below Oak, to follow I must walk up then follow)
M walk_up walk_right walk_right walk_right walk_right walk_right walk_right hide end

#org 0x8800280(I am facing DOWN, so I am above Oak, to follow I must walk down then follow)
M walk_down walk_right walk_right walk_right walk_right walk_right walk_right hide end

#org 0x8800290(I am facing right, so I am to the left of Oak, to follow I must walk right then follow)
M walk_right walk_right walk_right walk_right walk_right walk_right walk_right hide end

#org 0x88002A0(I am facing left, so I am to the right of Oak, to follow I must get out of oaks way by going up, then back down... then follow)
M walk_up look_down walk_down walk_right walk_right walk_right walk_right walk_right hide end

(another option would have been to check playerfacing before moving oak, then at each result (up down left right) move Oak and the player, this way instead of having the player get out of oaks way, Oak could walk around the player...)


This is my example from when (in my hack) the player chooses to catch their own starting pokemon... you talk to Oak, (after he offers you his 3 choices) and he offers you the chance to catch your own starter... you say yes and upon selecting yes this script is run (he walks and the player follows, depending on the players location or which way he is facing oak)
__________________
~Current Project:

~Completed Projects:



Last edited by LocksmithArmy; April 6th, 2013 at 08:33 PM.