I have the following code:
Code: Select all
if(read NPC(NPC at spot (x, y), NPCstat:pushability) == true)) then(
...do stuff
)
Moderators: marionline, SDHawk
Code: Select all
if(read NPC(NPC at spot (x, y), NPCstat:pushability) == true)) then(
...do stuff
)
Code: Select all
if(read NPC(NPC at spot (x, y), NPCstat:pushability) == NPCpush:full)) then(
...do stuff
)
Code: Select all
variable(ref)
ref := NPC at spot (x, y)
if(ref == false) then(
show string(string sprintf(0, $1="No NPC at %d,%d", x, y))
)else(
# Found an NPC at x, y
if(read NPC(ref, NPCstat:pushability) == NPCpush:full)) then(
show string(string sprintf(0, $1="NPC is fully pushable"))
)else(
show string(string sprintf(0, $1="NPC was found, but is not fully pushable"))
)
)
Alright so I went ahead and debugged it and was able to construct the correct code to check if NPC at (x,y) is fully pushable. However I am still having an issue with using this code in my Line of Sight script.Bob the Hamster wrote:Anyway, what you want is...
Code: Select all
if ((read zone (21, xNPC, yNPC--2) == true)
|| (((NPC at spot (xNPC, yNPC--2) <> 0)) && (read NPC(get NPC ID(NPC at spot (xNPC, yNPC--2)), NPCstat:pushability) == NPCpush:full))
) then(continue)
else if ((xMe == xNPC) && (yMe == yNPC--2)) then(
...CHASE THE HERO
Oh yeah by mistake. The continue has another purpose and the break comes later on. It's been a while since I wrote this so I kind of forgot. I'm pretty sure the overall structure of the code works properly up until I added the NPC at spot check.TMC wrote:'continue' doesn't escape out of a for loop, 'break' does.
Unfortunately I seem to be getting the same result after switching my code to this. I'm going to review the LOS script on the Wiki as I may be able to easily modify it for what I'm doing.TMC wrote:To do that, replace 'NPC at spot' with NPC at pixel(x * 20 + 10, y * 20 + 10)