#1 - If the npc is walking in a direction other than right at you, it can cause them to misalign from tiles, causing their movement to be out of whack (and sometimes cause them to be stuck) RESOLVED
#2 - This script is written intended to only knock back a single npc (and only when it is in range). For some reason though, it will occasionally knock back any npc that is behind and in line with the target npc being knocked back.
RESOLVED
Any suggestions would be much appreciated. Here's some code:
Code:
[/b]
if (key is pressed(45)) then (
play sound (7,false,false)
if (hero direction (0) == up ,and, hero y (0) >= npc y (1) + 1 ,and, hero x (0) == npc x (1)) then (
walk npc (1,up,2)
)
if ( hero direction (0) == down ,and, hero y (0) >= npc y (1) -- 1 ,and, hero x (0) == npc x (1)) then (
walk npc (1,down,2)
)
if ( hero direction (0) == right ,and, hero x (0) >= npc x (1) -- 1 ,and, hero y (0) == npc y (1)) then (
walk npc (1,right,2)
)
if ( hero direction (0) == left ,and, hero x (0) >= npc x (1) + 1 ,and, hero y (0) == npc y (1)) then (
walk npc (1,left,2)
)
if ( hero direction (0) == up ,and, hero y (0) >= npc y (2) + 1 ,and, hero x (0) == npc x (2)) then (
walk npc (2,up,2)
)
if ( hero direction (0) == down ,and, hero y (0) >= npc y (2) -- 1 ,and, hero x (0) == npc x (2)) then (
walk npc (2,down,2)
)
if ( hero direction (0) == right ,and, hero x (0) >= npc x (2) -- 1 ,and, hero y (0) == npc y (2)) then (
walk npc (2,right,2)
)
if ( hero direction (0) == left ,and, hero x (0) >= npc x (2) + 1 ,and, hero y (0) == npc y (2)) then (
walk npc (2,left,2)
)
if ( hero direction (0) == up ,and, hero y (0) >= npc y (3) + 1 ,and, hero x (0) == npc x (3)) then (
walk npc (3,up,2)
)
if ( hero direction (0) == down ,and, hero y (0) >= npc y (3) -- 1 ,and, hero x (0) == npc x (3)) then (
walk npc (3,down,2)
)
if ( hero direction (0) == right ,and, hero x (0) >= npc x (3) -- 1 ,and, hero y (0) == npc y (3)) then (
walk npc (3,right,2)
)
if ( hero direction (0) == left ,and, hero x (0) >= npc x (3) + 1 ,and, hero y (0) == npc y (3)) then (
walk npc (3,left,2)
)
)
play sound (7,false,false)
if (hero direction (0) == up ,and, hero y (0) >= npc y (1) + 1 ,and, hero x (0) == npc x (1)) then (
walk npc (1,up,2)
)
if ( hero direction (0) == down ,and, hero y (0) >= npc y (1) -- 1 ,and, hero x (0) == npc x (1)) then (
walk npc (1,down,2)
)
if ( hero direction (0) == right ,and, hero x (0) >= npc x (1) -- 1 ,and, hero y (0) == npc y (1)) then (
walk npc (1,right,2)
)
if ( hero direction (0) == left ,and, hero x (0) >= npc x (1) + 1 ,and, hero y (0) == npc y (1)) then (
walk npc (1,left,2)
)
if ( hero direction (0) == up ,and, hero y (0) >= npc y (2) + 1 ,and, hero x (0) == npc x (2)) then (
walk npc (2,up,2)
)
if ( hero direction (0) == down ,and, hero y (0) >= npc y (2) -- 1 ,and, hero x (0) == npc x (2)) then (
walk npc (2,down,2)
)
if ( hero direction (0) == right ,and, hero x (0) >= npc x (2) -- 1 ,and, hero y (0) == npc y (2)) then (
walk npc (2,right,2)
)
if ( hero direction (0) == left ,and, hero x (0) >= npc x (2) + 1 ,and, hero y (0) == npc y (2)) then (
walk npc (2,left,2)
)
if ( hero direction (0) == up ,and, hero y (0) >= npc y (3) + 1 ,and, hero x (0) == npc x (3)) then (
walk npc (3,up,2)
)
if ( hero direction (0) == down ,and, hero y (0) >= npc y (3) -- 1 ,and, hero x (0) == npc x (3)) then (
walk npc (3,down,2)
)
if ( hero direction (0) == right ,and, hero x (0) >= npc x (3) -- 1 ,and, hero y (0) == npc y (3)) then (
walk npc (3,right,2)
)
if ( hero direction (0) == left ,and, hero x (0) >= npc x (3) + 1 ,and, hero y (0) == npc y (3)) then (
walk npc (3,left,2)
)
)
Cornbread Chemist



