Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Bug Report (https://forums.graalonline.com/forums/forumdisplay.php?f=193)
-   -   triggeraction (https://forums.graalonline.com/forums/showthread.php?t=134259097)

xAndrewx 05-09-2010 12:37 AM

triggeraction
 
Triggeraction only seems to work if any object has a visible kind of image/gani in the place. (Complicated- I know)

If you make a script with an image of any color which is 5x5 pixels, it won't detect the npc if it has a setshape of 32x32.

It's depending on the image pixels (as far as I am aware of) instead of the setshape.

Can you please investigate. thank you

oo_jazz_oo 05-09-2010 12:42 AM

1 Attachment(s)
I don't think thats true?

I've done a triggeraction with npcs that have a setshape, but no image...

Edit: Yep, checked it.

I have a npc that has an image that is 5x5, but the trigger action still works.

Script:
PHP Code:

function onCreated() {
  
setimg("jazz_dot.png");
  
this.setshape(13232);
}
function 
onActionDooblyDoo() {
  
this.chat "Success!";
}
//#CLIENTSIDE
function onCreated() {
  
triggeraction(this.x+.5this.y+.5"DooblyDoo"nil);


Check attachment for image. :P

salesman 05-09-2010 01:17 AM

Quote:

Originally Posted by oo_jazz_oo (Post 1574967)
stuff

are you german?

cbk1994 05-09-2010 01:20 AM

You can also do

PHP Code:

function onCreated() {
  
this.level.tapThis this;
}

function 
onPow() {
  
this.chat "ouch!";
}

//#CLIENTSIDE
function onPlayerChats() {
  
triggerServer("npc""TriggerControl""Trigger"this.level.name"tapThis""Pow");


and then in an NPC TriggerControl

PHP Code:

function onActionTrigger(levelNamenpcNamecommand) {
  
findLevel(levelName).(@ npcName).trigger(command);


Though you'd want to add some security features. Usually something like this is preferable since you never know if a trigger will be received when using x/y.

Seeya 05-09-2010 02:38 AM

Quote:

Originally Posted by cbk1994 (Post 1574971)
You can also do

-script-

Though you'd want to add some security features. Usually something like this is preferable since you never know if a trigger will be received when using x/y.



+rep!!! u so cool!!

xAndrewx 05-09-2010 10:51 AM

Quote:

Originally Posted by cbk1994 (Post 1574971)
You can also do

PHP Code:

function onCreated() {
  
this.level.tapThis this;
}

function 
onPow() {
  
this.chat "ouch!";
}

//#CLIENTSIDE
function onPlayerChats() {
  
triggerServer("npc""TriggerControl""Trigger"this.level.name"tapThis""Pow");


and then in an NPC TriggerControl

PHP Code:

function onActionTrigger(levelNamenpcNamecommand) {
  
findLevel(levelName).(@ npcName).trigger(command);


Though you'd want to add some security features. Usually something like this is preferable since you never know if a trigger will be received when using x/y.



That's a good idea =o


I made an NPC with an image / setshape, once I sent the triggeraction it found it the first time, I changed the image to "no-shield.png" (an image with nothing in it) and I tried to send the triggeraction again and it wouldn't work.
I've fixed the problem now by using showimg() (thanks to salesman) but this needs to be fixed, I assumed it was because of this.


All times are GMT +2. The time now is 09:18 AM.

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