Open Steinny opened 5 months ago
@Steinny i use it in my script.
Move a NPC where there no map(black zone) it will return 1.
Place boulder rock around. Shoule work too.
How do you test it?
and only underground withour ARGN!! - shows 1
Seem to only check static item.... Spawn NPC on a mountain and it work. Maybe we should evaluate added in game item...
is the castle wall not static enough?
ON a quick check, server only evaluate if player can move... Static and in game intem shoud change nothing
bool CChar::IsStuck(bool fFreezeCheck)
{
CPointMap pt = GetTopPoint();
if ( fFreezeCheck && OnFreezeCheck() )
return true;
return !( CanMoveWalkTo(pt, true, true, DIR_N) || CanMoveWalkTo(pt, true, true, DIR_E) || CanMoveWalkTo(pt, true, true, DIR_S) || CanMoveWalkTo(pt, true, true, DIR_W) );
}
as I see it without arguments
ISSTUCK R Returns 1 if the character cannot walk in any direction.
this is not how this function works it checks for a specific!!!! tile where you stay on passability!!!
this is not how this function works it checks for a specific!!!! tile where you stay on passability!!!
Don't mad, what you propose? For me it's clear. When you char cannot move in any direction it return 1.
Apparently canmovewalkto do not consider some item on the path.
I use it on my custom spawn point. After I spawn a NPC, I check isstuck. If npc is spawned on water or on black area map, it return 1.(So it work correct on specific case)
the function does not work as described
my self-written function where I just make the npc run in all directions works better and how it described in wiki ))
ISSTUCK isn't check the dir you are entering, it only checks if you can move in North, West, South or East, if you can walk any of these direction, it returns 0.
For Underground check, LLama can only not walk to left, so he can move other 3 directions, so yes return 0 is correct. For the half blocks, they are walkable, so llama can walk on them, so yes he can walk all directions 0 is correct. While you are in an item/wall/table etc. that blocks you to walk any side, it returns 1.
ISSTUCK means you can't walk any direction. Maybe you thought it shows only if he can walk to any direction but it's not for it. it's CANMOVE dir
ISSTUCK isn't check the dir you are entering, it only checks if you can move in North, West, South or East, if you can walk any of these direction, it returns 0.
but it doesn't even work that way. he checks the passibility of the tile according to my test. look last screen
ISSTUCK isn't check the dir you are entering, it only checks if you can move in North, West, South or East, if you can walk any of these direction, it returns 0.
but it doesn't even work that way. he checks the passibility of the tile according to my test. look last screen
I am testing it on my sphere, and it works fine for me, it doesn't return 0 when I am in a table, do you have any function named ISSTUCK that overrides default behaviour?
Strange. NO. I do all my functions like f_function
Okay, I think I find out the issue, let me check, Okay I will take a note for this issue, I will check it in next pr.
I see no issue.
IsStuck-> If npc can walk on any direction, it is not stuck, so it return 0
Im not sure if thoose are walls. I think they are consider as stairs ("bridge" in tiledata) I think if u say "all come" npc can walk on it even if players is not able. Did not test it and not sure but I think npcs can climb thoose.
No args accepted for isstuck as werswood said.
Okay, I think I find out the issue, let me check, Okay I will take a note for this issue, I will check it in next pr.
What did you find?
Is this height related?
is correct that isStuck always check OnFreezeCheck()?
27-09-04, Vjaka
does not work