Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Player as a blocking object? (https://forums.graalonline.com/forums/showthread.php?t=134256838)

oo_jazz_oo 11-07-2009 12:39 AM

Player as a blocking object?
 
Ok, my problem...I have an npc that moves around a level and detects walls.

When it gets next to a player, it detects that player as a wall. (When using onwall())

I could get around this by detecting if the npc is near a player, and such, but I was wondering if there is another way to make it so the npc doesn't detect players as a wall.

I've seen a function before that makes it so the npc doesnt detect players as blocking...somethign like noplayeronwall(). But I can't find anything of the sorts. =/

cbk1994 11-07-2009 12:44 AM

Quote:

Originally Posted by oo_jazz_oo (Post 1536972)
noplayeronwall().

That's the function you can use it like so:

(script of some DB NPC or so)
PHP Code:

function onCreated() {
  
setCharAni("idle", NULL); // show the character or whatever
  
  
noplayeronwall();
} 

then to move, just use the standard onwall/onwall2 and it should work.

oo_jazz_oo 11-07-2009 01:51 AM

Is it a serverside only script? o.o

When I use it clientside, it returns an error in the f2 window.
And if I use it serverside, the client still detects players as blocking.

cbk1994 11-07-2009 01:59 AM

Quote:

Originally Posted by oo_jazz_oo (Post 1536979)
Is it a serverside only script? o.o

When I use it clientside, it returns an error in the f2 window.
And if I use it serverside, the client still detects players as blocking.

It only works serverside. If you need to achieve the same effect clientside, you'll want to use a combination of findAreaNPCs and tileType (see Dusty's recent thread).

oo_jazz_oo 11-07-2009 02:30 AM

Ah, thanks. ^_^

tileType worked perfectly. :D


All times are GMT +2. The time now is 11:19 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.