Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Hiding an NPC (https://forums.graalonline.com/forums/showthread.php?t=134259093)

xAndrewx 05-08-2010 07:59 PM

Hiding an NPC
 
If you were to hide an NPC from the player view, but would still need to send triggeractions to this NPC, how would you do it?

Using
HTML Code:

this.hide();
prevents the use of triggeractions to the NPC.

Setting the NPC to an image can be manipulated by the player [clientside]- which isn't good!

What would you recommend? thanks

fowlplay4 05-08-2010 08:02 PM

maybe, this.alpha = 0;

cbk1994 05-08-2010 08:18 PM

setShape?

DustyPorViva 05-08-2010 08:26 PM

Quote:

Originally Posted by cbk1994 (Post 1574895)
setShape?

My experience, only 1 works(it'd be nice if 0 was able to set a shape detectable by scripts, but not by wall checks)... and I get the feeling he doesn't want it blocking at the same time.

xAndrewx 05-08-2010 08:31 PM

Quote:

Originally Posted by fowlplay4 (Post 1574889)
maybe, this.alpha = 0;

Doesn't work on images. :[

Quote:

Originally Posted by cbk1994 (Post 1574895)
setShape?

It has a setshape (server & clientside), but it's not detected when the object is hidden.

Quote:

Originally Posted by DustyPorViva (Post 1574897)
My experience, only 1 works(it'd be nice if 0 was able to set a shape detectable by scripts, but not by wall checks)... and I get the feeling he doesn't want it blocking at the same time.

It's not blocked, you can walk over it.

Loving multiquote =D

DustyPorViva 05-08-2010 08:34 PM

this.actor.alpha = 0?

xAndrewx 05-08-2010 09:08 PM

Quote:

Originally Posted by DustyPorViva (Post 1574900)
this.actor.alpha = 0?

Nope :[

I could maybe make it showcharacter I suppose... any other suggestions before I do this?

salesman 05-08-2010 09:13 PM

Could try drawing the image via TShowImg and show/hide that instead of the NPC?

Deas_Voice 05-08-2010 09:35 PM

if u got an image that needs to showd, just remove it when you are "hiding" it?

xAndrewx 05-08-2010 10:05 PM

Quote:

Originally Posted by salesman (Post 1574908)
Could try drawing the image via TShowImg and show/hide that instead of the NPC?

That could work =O

Quote:

Originally Posted by Deas_Voice (Post 1574922)
if u got an image that needs to showd, just remove it when you are "hiding" it?

What? o_o

Switch 05-08-2010 10:06 PM

Quote:

Originally Posted by salesman (Post 1574908)
Could try drawing the image via TShowImg and show/hide that instead of the NPC?

Was about to suggest this.

napo_p2p 05-08-2010 10:13 PM

Quote:

Originally Posted by xAndrewx (Post 1574932)
What? o_o

I think he means set the image of the NPC to something that is "invisible". As long as the shape is set, it should still trigger.

xAndrewx 05-08-2010 10:14 PM

Works a charm @ Salesman, thank you :)

xAndrewx 05-08-2010 10:15 PM

Quote:

Originally Posted by napo_p2p (Post 1574935)
I think he means set the image of the NPC to something that is "invisible". As long as the shape is set, it should still trigger.

Ahh, wouldn't work. I think the triggeraction needs an image to bounce from x-x

coreys 05-08-2010 10:29 PM

this.image = ""; ? o.o

Deas_Voice 05-08-2010 11:11 PM

Quote:

Originally Posted by coreys (Post 1574941)
this.image = ""; ? o.o

i would do setimg(" "); but yeah that was my idea (too?) .

xAndrewx 05-08-2010 11:12 PM

Quote:

Originally Posted by coreys (Post 1574941)
this.image = ""; ? o.o

try it- wouldn't hide it :[

ffcmike 05-08-2010 11:34 PM

Are you hiding the NPC Serverside?
Maybe it could work if the NPC was visible serverside but hidden Clientside. (assuming it's a matter of client -> server)

xAndrewx 05-09-2010 12:32 AM

Quote:

Originally Posted by ffcmike (Post 1574952)
Are you hiding the NPC Serverside?
Maybe it could work if the NPC was visible serverside but hidden Clientside. (assuming it's a matter of client -> server)

That would more than likely work! It's just effort to do this though (shouldn't have to be complicated, more than likely involving an attr with a timeout)

And yes- it is serverside ^^ lol

napo_p2p 05-09-2010 01:08 AM

Quote:

Originally Posted by xAndrewx (Post 1574937)
Ahh, wouldn't work. I think the triggeraction needs an image to bounce from x-x

I used to use a 32x32 "nothing.png" that was basically an invisible image, and it worked. But, the showimg solution is probably better anyways.

xAndrewx 05-09-2010 10:14 AM

Quote:

Originally Posted by napo_p2p (Post 1574968)
I used to use a 32x32 "nothing.png" that was basically an invisible image, and it worked. But, the showimg solution is probably better anyways.

Yeah, but if the player modifies the nothing.png to something, it'd be pointless in hiding it... lol


All times are GMT +2. The time now is 12:45 AM.

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