View Single Post
  #1  
Old 11-04-2003, 03:08 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
triggeraction/callnpc barrier

Why am I unable to do a triggeraction with params to one NPC that will do a triggeraction back with params? I've tried the combination of doing triggeraction and responding with callnpc but nothing happens. The purpose of this is to create something of a pathnode system which I can send NPCs to run along. I'm sure there are better ways of having an NPC get from point A to point B. This is just the way I chose.

*note
This is a crude script at the moment. All I'm doing is testing my idea without too much success .

<sending NPC>
NPC Code:

...

if (timeout) {

for (lag=0; lag<10; lag++) {
if (dir==3) {
//showimg lag,brick.png,x+lag+vecx(dir)*2,y+1+vecy(dir)*2;
triggeraction x+lag+vecx(dir)*2,y+1+vecy(dir)*2,path,#v(id),#v(l ag);
}
sleep .1;
}
timeout = 0.45;
}

if (node) {
setcharprop #c,PING!;
distx = strtofloat(#p(0));
disty = strtofloat(#p(1));
disttime = strtofloat(#s(path.latency));
}



<recieving NPC>
NPC Code:
if (playerenters) {
setshape 1,48,48;
dontblock;
}

if (actionpath) {
setstring path.npcindex,#p(0);
setstring path.latency,#p(1);
setcharprop #c,FOUND!;
//play quickbm.wav;
callnpc strtofloat(#s(path.npcindex)),node,#v(x),#(y);
}



'lag' is used to determine the actual time distance (in tiles). The 'recieving NPC' works. I just can't get the sender to respond to the callnpc sent to it. showimg is so I know where its triggering :]
__________________
Reply With Quote