Graal Forums

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

JkWhoSaysNi 03-18-2005 04:11 PM

Triggeraction
 
I'm trying to trigger an action on a character NPC when a timer runs down. Heres what i have in the triggering NPC.

NPC Code:

]if (created) {
timeout = 20;
}

if (timeout) {
triggeraction 28,12,go,;
}



The co-ordinates are correct too because i've put x=28; y=12; in the NPC witch the action should be triggered.

I read in another thread that something different needs to be done for character NPCs... but I diddnt understand what. What i have works if the NPC is not a showcharacter; NPC if i put in setshape as I read in another thread.

Can someone tell me what needs changing to make it work for showcharacter NPCs?

I_Eat_Plastic 03-18-2005 04:34 PM

Well, I'm not sure if this is right but you might need setshape (like setshape 1,32,32) to give the NPC some area to triggeraction onto. Then you might want to change your x and y to 28.5 and 12.5, so you are sure it is triggeractioning onto the NPC.

JkWhoSaysNi 03-18-2005 05:19 PM

If i use setshape on the NPC it seems to remove all the props. Dont characters have a shape?

Sildae 03-18-2005 06:10 PM

Quote:

Originally Posted by JkWhoSaysNi
Can someone tell me what needs changing to make it work for showcharacter NPCs?

Yup.
The triggeraction needs to hit a part of the NPC that is blocking, not its actual coordinates. On showcharacter NPCs, the top left corner does not block, just like players.

I suggest to triggeraction to the NPC's x+1.5,y+2. This should hit the center of the NPC's blocking part.

JkWhoSaysNi 03-18-2005 06:26 PM

Thanks! Got it working now :D


All times are GMT +2. The time now is 03:50 AM.

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