Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 08:40 PM.


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