View Single Post
  #8154    
Old May 7th, 2013 (09:26 AM).
hinkage's Avatar
hinkage hinkage is offline
Go make some new disaster
Gold Tier
 
Join Date: Aug 2010
Age: 19
Posts: 378
Quote:
Originally Posted by LaDestitute View Post
Okay, thanks, it worked fine. :D

Although, some questions.
What does the Unknown value do?
How do I get the NPC to actually move to the player's front position, say if they step on the left or right script event instead of the middle one? It looks a bit odd with the NPC moving to the middle, otherwise. I could just have one script event, though, I guess. That works too, I'm just curious.
If you have multiple scriptboxes and want the NPC to walk up to you... uh, it's just easier to show through example:

Spoiler:
#org @set
lock
setvar 0x4001 0xX (1 for first scriptbox, 2 for second, etc. this is a temp var, it resets after leaving the map.)
jump @main (your main script)

#org @main
compare 0x4001 0x1
if == call @comp1 (if 0x1 is set then call this. "comp1" stands for "comparison 1")
compare 0x4001 0x2
if == call @comp2 (if 0x2 is set...)
compare 0x4001 0x3
if == call @comp3 (if 0x3 is set... and on and on, for each scriptbox you have)
pauseevent 0x0
--your script ---
release
end

#org @comp1
applymovement 0xX @move1 (should move sprite X to put sprite in front of player according to the first scriptbox -- you have to define @move1, @move2, @move3, etc., yourself)
return

#org @comp2
applymovement 0xX @move2 (should move sprite X to put sprite in front of player according to the second scriptbox)
return

#org @comp3
applymovement 0xX @move3 (same as other two)
return


Check out your rival's scripts. They do it too, and it might be easier for you to understand if you actually see it in action.
(ღ˘⌣˘ღ)