Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-03-2012, 02:56 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Triggeraction Difficulties

I have been playing around with a script, but I am having problems. I try to drag the NPC using this script but it only triggers if I mouseup on the same spot it origonally was.. which is odd.. and when it triggers.. it triggers every NPC that is joined to the class.. anyone got any ideas whats wrong o.O

PHP Code:
function onActionServerside(commandnxny) {
  
chat command;
}

//#CLIENTSIDE
function onCreated() {
  
this.catchEvent(GraalControl"onMouseDragged""onMouseDragged");
  
setshape2(1getimgwidth(this.image), getimgheight(this.image));
}

function 
onMouseDown() {
  if ( 
mousex in |x,x+getimgwidth(this.image)/16| && mousey in |y,y+getimgheight(this.image)/16| ) {
    
this.ox mousex x;
    
this.oy mousey y;
    
this.candrag true;
    
// clicked on it
  
}
}

function 
onMouseUp() {
  
this.candrag false;
  
triggeraction(mousexmousey"Serverside""test");
}

function 
onMouseDragged(objmodmxmy) {
  if ( 
this.candrag true ) {
    
//triggeraction(x, y, "Serverside", "test");
    
mousex this.ox;
    
mousey this.oy;
  }

I have tried triggering at the following cords:
PHP Code:
this.oxthis.oy
mousex
mousey
x

With no luck, both before and after updating the x/y values.
Reply With Quote
  #2  
Old 09-03-2012, 03:01 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
You need to be triggering within the shape of the NPC at the serverside position, you seem to be triggering the new coordinate rather than the existing one.
Reply With Quote
  #3  
Old 09-03-2012, 03:04 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by ffcmike View Post
You need to be triggering within the shape of the NPC at the serverside position, you seem to be triggering the new coordinate rather than the existing one.
Well I tried setshape on both clientside and serverside.. But im confused what you exactly mean by existing one? The old x/y ?
Reply With Quote
  #4  
Old 09-03-2012, 03:05 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by scriptless View Post
Well I tried setshape on both clientside and serverside.. But im confused what you exactly mean by existing one? The old x/y ?
The position inwhich you expect the NPC to reside serverside.
The problem could also be that you're triggering edge-on with the NPC's shape, afaik you need to be within its shape, such as this.x + 0.5, this.y + 0.5.
Reply With Quote
  #5  
Old 09-03-2012, 03:07 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by ffcmike View Post
The position inwhich you expect the NPC to reside serverside.
The problem could also be that you're triggering edge-on with the NPC's shape, afaik you need to be within its shape, such as this.x + 0.5, this.y + 0.5.
well, what im trying to do is change it's x/y serverisde to follow the mouse.

so when i put the npc using putnpc2, it has an x and a y serverside... when i go to trigger it even tho clientside it changes x and y, i would need to trigger it at the origonal position i placed it?
Reply With Quote
  #6  
Old 09-03-2012, 03:10 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by scriptless View Post
i would need to trigger it at the origonal position i placed it?
Yes. Then send the new X and Y positions as a parameter.

PHP Code:
function onActionServerSide(temp.xtemp.y){
  
this.temp.x;
  
this.temp.y;
}

//#CLIENTSIDE
function updatePosition(){
  
triggeraction(this.origx 0.5this.origy 0.5"Serverside"mousexmousey);

Reply With Quote
  #7  
Old 09-03-2012, 03:22 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Doesn't seem to be working, at all now.

PHP Code:
function onActionServerside(commandnxny) {
  
chat command;
  
this.chat command;
}

function 
onCreated() {
  
setshape2(1getimgwidth(this.image), getimgheight(this.image));
  
this.oox this.x;
  
this.ooy this.y;
}

//#CLIENTSIDE
function onCreated() {
  
this.catchEvent(GraalControl"onMouseDragged""onMouseDragged");
  
setshape2(1getimgwidth(this.image), getimgheight(this.image));
  
this.oox this.x;
  
this.ooy this.y;
}

function 
onMouseDown() {
  if ( 
mousex in |x,x+getimgwidth(this.image)/16| && mousey in |y,y+getimgheight(this.image)/16| ) {
    
this.ox mousex x;
    
this.oy mousey y;
    
this.candrag true;
  }
}

function 
onMouseUp() {
  if ( 
this.candrag == true ) {
    
triggeraction(this.oox .5this.ooy +.5"Serverside""test");
    
this.candrag fasle;
  }
}

function 
onMouseDragged(objmodmxmy) {
  if ( 
this.candrag == true ) {
    
mousex this.ox;
    
mousey this.oy;
  }

"this.oox" and "this.ooy" are the x and y when created serverrside, it sets shape both clientisde and serverside.. it triggers at the first x/y values serverside.. and now it wont even work retardedly.. =/

I am guessing I am going to need to "showimg()" where it will be shown while dragging, THEN update the x and y?
Reply With Quote
  #8  
Old 09-03-2012, 03:25 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
You shouldn't be using triggeraction for this anyway, it's unreliable, especially when you're doing something that involves moving the NPCs. Generally a better way is to setup some way of uniquely identifying your NPCs (easy if they're DB NPCs/putnpcs).
__________________
Reply With Quote
  #9  
Old 09-03-2012, 03:29 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Problem might be that you're using 'setshape2' instead of 'setshape'. Setshape2 is for modifying the tiletype's beneath an NPC.
Reply With Quote
  #10  
Old 09-03-2012, 03:30 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by cbk1994 View Post
You shouldn't be using triggeraction for this anyway, it's unreliable, especially when you're doing something that involves moving the NPCs. Generally a better way is to setup some way of uniquely identifying your NPCs (easy if they're DB NPCs/putnpcs).
They are put npc's,

PHP Code:
function onActionServerside(command) {
  if ( 
params[0] == "puts" ) {
    
temp.obj putnpc2(params[1], params[2], "");
    
temp.obj.image "block.png";
    
temp.obj.join("personal_mewtoo18_test");
  }
}
//#CLIENTSIDE
function onWeaponFired() {
  
triggerServer("gui"this.name"puts"player.xplayer.y); 

Is how they are being placed currently. I want to make them draggable, and showing there current position while dragged to other players.. I know Tig has something like this using WNPC's for player dragging but certain commands like "this.trigger()" didn't seem to be working on putnpc's for me.

Quote:
Originally Posted by ffcmike View Post
Problem might be that you're using 'setshape2' instead of 'setshape'. Setshape2 is for modifying the tiletype's beneath an NPC.
And that, ladies and gentlemen, solved my problem. I was not aware of the difference in setshape() vs setshape2().
Reply With Quote
  #11  
Old 09-03-2012, 03:34 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by scriptless View Post
PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  
triggerServer("gui"this.name"puts"player.xplayer.y); 

While that would be fine for a weapon script, there is no 'this.name' within a local NPC on Clientside. You can however store it as an attr Serverside. The first parameter should also be 'npc' rather than 'gui'.

PHP Code:
function onCreated(){
  
this.attr[1] = this.name;
}
//#CLIENTSIDE
function sendTrigger(){
  
triggerserver("npc"this.attr[1], mousexmousey);

Reply With Quote
  #12  
Old 09-03-2012, 03:44 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by ffcmike View Post
While that would be fine for a weapon script, there is no 'this.name' within a local NPC on Clientside. You can however store it as an attr Serverside. The first parameter should also be 'npc' rather than 'gui'.

PHP Code:
function onCreated(){
  
this.attr[1] = this.name;
}
//#CLIENTSIDE
function sendTrigger(){
  
triggerserver("npc"this.attr[1], mousexmousey);

I was using it in a Weapon Script. I was just showing how I was placing them.. now oddly. I can drag the npc.. it changes the chat above the npc.. but its not sending the right cords or something.. every time i move it it says the same x/y...

PHP Code:
function onActionServerside(commandnxny) {
  if ( 
command == "move" ) {
    
nx;
    
ny;
    
chat "moved" SPC nx SPC ny;
  }
}


//#CLIENTSIDE
function onCreated() {
  
this.catchEvent(GraalControl"onMouseDragged""onMouseDragged");
  
setshape(1getimgwidth(this.image), getimgheight(this.image));
  
this.oox this.x;
  
this.ooy this.y;
}

function 
onMouseDown() {
  if ( 
mousex in |x,x+getimgwidth(this.image)/16| && mousey in |y,y+getimgheight(this.image)/16| ) {
    
this.ox mousex x;
    
this.oy mousey y;
    
this.candrag true;
  }
}

function 
onMouseUp() {
  if ( 
this.candrag == true ) {
    
this.candrag fasle;
    
triggeraction(this.oox .5this.ooy +.5"Serverside""move"this.nnxthis.nny);
  }
}

function 
onMouseDragged(objmodmxmy) {
  if ( 
this.candrag == true ) {
    
mousex this.ox;
    
mousey this.oy;
    
this.nnx mousex this.ox;
    
this.nny mousey this.oy;
  }

First time it's moved it fine after that it breaks.
Reply With Quote
  #13  
Old 09-03-2012, 03:50 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by scriptless View Post
I was using it in a Weapon Script. I was just showing how I was placing them.. now oddly. I can drag the npc.. it changes the chat above the npc.. but its not sending the right cords or something.. every time i move it it says the same x/y...

PHP Code:
function onActionServerside(commandnxny) {
  if ( 
command == "move" ) {
    
nx;
    
ny;
    
chat "moved" SPC nx SPC ny;
  }
}


//#CLIENTSIDE
function onCreated() {
  
this.catchEvent(GraalControl"onMouseDragged""onMouseDragged");
  
setshape(1getimgwidth(this.image), getimgheight(this.image));
  
this.oox this.x;
  
this.ooy this.y;
}

function 
onMouseDown() {
  if ( 
mousex in |x,x+getimgwidth(this.image)/16| && mousey in |y,y+getimgheight(this.image)/16| ) {
    
this.ox mousex x;
    
this.oy mousey y;
    
this.candrag true;
  }
}

function 
onMouseUp() {
  if ( 
this.candrag == true ) {
    
this.candrag fasle;
    
triggeraction(this.oox .5this.ooy +.5"Serverside""move"this.nnxthis.nny);
  }
}

function 
onMouseDragged(objmodmxmy) {
  if ( 
this.candrag == true ) {
    
mousex this.ox;
    
mousey this.oy;
    
this.nnx mousex this.ox;
    
this.nny mousey this.oy;
  }

First time it's moved it fine after that it breaks.
It looks like it would be fine to send mousex and mousey as coordinate parameters, rather than using this.nnx and this.nny.
Also should use this.ox and this.oy to store this.x and this.y rather than factoring in the mouse position.

It's also worth mentioning that if the image hasn't been downloaded to your client yet, getimgwidth() and getimgheight() would return 0.
Reply With Quote
  #14  
Old 09-03-2012, 03:57 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
I send those parameters and then it breaks.. im thinking i need to reupdate the cord im triggering at maybe?

also, thanks for letting me know that about getimg...()... does that only apply to clientside or serverside as well?


EDIT: (Fixed, and working, now to clean it up)

PHP Code:
function onActionServerside(commandnxny) {
  if ( 
command == "move" ) {
    
nx;
    
ny;
    
this.oox this.x;
    
this.ooy this.y;
    
chat "moved" SPC nx SPC ny;
  }
}


//#CLIENTSIDE
function onCreated() {
  
this.catchEvent(GraalControl"onMouseDragged""onMouseDragged");
  
setshape(1getimgwidth(this.image), getimgheight(this.image));
  
this.oox this.x;
  
this.ooy this.y;
}

function 
onMouseDown() {
  if ( 
mousex in |x,x+getimgwidth(this.image)/16| && mousey in |y,y+getimgheight(this.image)/16| ) {
    
this.ox mousex x;
    
this.oy mousey y;
    
this.candrag true;
  }
}

function 
onMouseUp() {
  if ( 
this.candrag == true ) {
    
this.candrag fasle;
    
triggeraction(this.oox .5this.ooy +.5"Serverside""move"mousexmousey);
    
this.oox mousex;
    
this.ooy mousey;
  }
}

function 
onMouseDragged(objmodmxmy) {
  if ( 
this.candrag == true ) {
    
mousex this.ox;
    
mousey this.oy;
    
this.nnx mousex this.ox;
    
this.nny mousey this.oy;
  }

I had to set new cord's when i moved it, and then it worked fine.
Reply With Quote
  #15  
Old 09-03-2012, 04:08 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by scriptless View Post
im thinking i need to reupdate the cord im triggering at maybe?
Yeah.

Quote:
Originally Posted by scriptless View Post
also, thanks for letting me know that about getimg...()... does that only apply to clientside or serverside as well?
Only clientside.

I just noticed this too:

Quote:
Originally Posted by scriptless View Post
PHP Code:
  if ( this.candrag == true ) {
    
this.candrag fasle
Reply With Quote
  #16  
Old 09-03-2012, 04:21 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Yeah, if it's true, it does stuff and makes it not true. That way it wont let me do it again. Nothing wrong with that. However in the first post, I did "if ( this.candrag = true ) {" by mistake. I need to go ahead and clean the script up now that I have learned some new things about triggeractions, setshape, and image sizes.

Thanks for the help. Much appreciated.
Reply With Quote
  #17  
Old 09-03-2012, 04:23 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
I was referring to a slight typo of 'fasle'.
Reply With Quote
  #18  
Old 09-03-2012, 04:30 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Opps. Yeah I noticed that earlier, and fixed it. Broke the script and pasted the one from the forums I had posted previous but I guess I failed to fix it. Thanks for pointing that out.
Reply With Quote
  #19  
Old 09-03-2012, 05:25 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by scriptless View Post
They are put npc's
In that case just use the NPC's name to identify it and don't try to trigger at some position which is inherently unreliable.
__________________
Reply With Quote
  #20  
Old 09-03-2012, 05:34 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by cbk1994 View Post
In that case just use the NPC's name to identify it and don't try to trigger at some position which is inherently unreliable.
Could you elaborate just a bit more? Putnpc NPC's have names?
Reply With Quote
  #21  
Old 09-03-2012, 06:12 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by scriptless View Post
Putnpc NPC's have names?
Yes. A putnpc is just a more temporary database NPC. If you know an NPC's name, you can easily trigger it:

PHP Code:
triggerServer("npc"npc.attr[2], "poke"); 
note that the npc's name isn't available clientside (iirc) so you'll need to stuff it in an attribute or similar so that you can access it clientside (just do this.attr[2] = this.name serverside in onCreated).

Now you no longer have to worry about shapes or overlapping or any of that other junk.
__________________
Reply With Quote
  #22  
Old 09-03-2012, 06:15 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by cbk1994 View Post
Yes. A putnpc is just a more temporary database NPC. If you know an NPC's name, you can easily trigger it:

PHP Code:
triggerServer("npc"npc.attr[2], "poke"); 
note that the npc's name isn't available clientside (iirc) so you'll need to stuff it in an attribute or similar so that you can access it clientside (just do this.attr[2] = this.name serverside in onCreated).

Now you no longer have to worry about shapes or overlapping or any of that other junk.
Interesting to know, thanks. However, didn't you say there would be a better way then using triggeractions to do this? Because I'm not sure what you would be referring to. Unless you ment "triggeraction" being changed to "triggerserver" ?

And rather then a new thread for a 2 second fix, I have the above code also setting a variable after joining:

PHP Code:
temp.obj.placedby player.account
The variable reads serverside from the class, but not clientside. Any idea other then a serverside to clientside trigger?

It seems attr's work but was wondering if theres any other way.

Last edited by scriptless; 09-03-2012 at 07:15 PM..
Reply With Quote
  #23  
Old 09-03-2012, 09:43 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by scriptless View Post
Interesting to know, thanks. However, didn't you say there would be a better way then using triggeractions to do this? Because I'm not sure what you would be referring to. Unless you ment "triggeraction" being changed to "triggerserver" ?
There is a big difference between triggering at a coordinate and praying that it hits the NPC you're aiming for, and triggering the NPC by name.
__________________
Reply With Quote
  #24  
Old 09-04-2012, 12:36 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by cbk1994 View Post
There is a big difference between triggering at a coordinate and praying that it hits the NPC you're aiming for, and triggering the NPC by name.
All I asked was a yes or no question. Pretty sure the answer was yes tho.

And actually, there were to be multiple npc's placed in the level. Ounce clicked they would do something. So mouse down it still needs to know which one is to be focused on. So I don't know how you were suggesting graal determin "what I was clicking" based on one of many copies of the same npc in the level.
Reply With Quote
  #25  
Old 09-04-2012, 12:54 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by scriptless View Post
All I asked was a yes or no question. Pretty sure the answer was yes tho.
If you're going to be a pedantic ****, at least do it right. I said there is a way to do it without triggeraction, not without triggers:

Quote:
Originally Posted by cbk1994 View Post
You shouldn't be using triggeraction for this anyway
Quote:
Originally Posted by scriptless View Post
And actually, there were to be multiple npc's placed in the level. Ounce clicked they would do something. So mouse down it still needs to know which one is to be focused on. So I don't know how you were suggesting graal determin "what I was clicking" based on one of many copies of the same npc in the level.
Not sure what you're saying or how that affects anything I said about triggering by name; with multiple NPCs in a level my point is even more valid since they provide additional things to get in the way of a coordinate trigger reaching its intended destination.
__________________
Reply With Quote
  #26  
Old 09-04-2012, 01:04 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by cbk1994 View Post
If you're going to be a pedantic ****, at least do it right. I said there is a way to do it without triggeraction, not without triggers:





Not sure what you're saying or how that affects anything I said about triggering by name; with multiple NPCs in a level my point is even more valid since they provide additional things to get in the way of a coordinate trigger reaching its intended destination.
I asked you to elaborate earlier and you didn't really. Which is why I asked specifically triggeraction or trigger.. Because all triggers, are actions o.O.

And you still wont elaborate "how does graal know which npc I click" if not by the mousex and y? Does it just guess? I ask for help you flame me when I ask to elaborate and you don't. Wth man.

Point being said, the mouse has to click anywhere on the npc.. then the npc judges where at you clicked, so it doesnt mess up where the npc is in relation to the mouse, as being dragged. If I just did a trigger for when the mouse is clicked I don't even begin to comprehend how graal is suspose to know "which" npc was clicked.
Reply With Quote
  #27  
Old 09-04-2012, 02:39 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by scriptless View Post
Because all triggers, are actions o.O.
wat

Quote:
And you still wont elaborate "how does graal know which npc I click" if not by the mousex and y? Does it just guess? I ask for help you flame me when I ask to elaborate and you don't. Wth man.
Just because an NPC appears somewhere on your screen doesn't mean it's necessarily there or that it will still be there when the trigger reaches the server. When the mouse is clicked, figure out if one of your NPC's is being clicked on, get the NPC's name (stored in an attr), then trigger it.
__________________
Reply With Quote
  #28  
Old 09-04-2012, 04:04 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by cbk1994 View Post
When the mouse is clicked, figure out if one of your NPC's is being clicked on, get the NPC's name (stored in an attr), then trigger it.
Can't get any simpler then that.
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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