Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-29-2003, 01:54 AM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Triggeraction....

When i try to do a triggeraction from clientside to serverside on a normal npc, it works, but if i do it more, it wont work...

It only works once...

Anyone have an idea about what's wrong?
__________________
-Kjetil Valen
Reply With Quote
  #2  
Old 07-29-2003, 05:10 AM
Tseng Tseng is offline
Sublime
Tseng's Avatar
Join Date: Jan 2003
Location: California
Posts: 0
Tseng is on a distinguished road
Re: Triggeraction....

Quote:
Originally posted by VeX_RaT_Boy
When i try to do a triggeraction from clientside to serverside on a normal npc, it works, but if i do it more, it wont work...

It only works once...

Anyone have an idea about what's wrong?
Posting the bit of code wherein you use the triggeraction, as well as how the serverside action is handled, would be very beneficial. Otherwise, one can only guess what you are doing wrong.
__________________
Funny Things:
Quote:
Originally posted by Stefan
I didn't ban you, I only played a little bit with my RC.
-----
Reply With Quote
  #3  
Old 07-29-2003, 11:13 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
::fully agrees::
We're assuming this is a weapon right?
---Shifter
__________________
Who has time for life these days?
Reply With Quote
  #4  
Old 07-29-2003, 02:03 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Quote:
Originally posted by Projectshifter
::fully agrees::
We're assuming this is a weapon right?
---Shifter
No weapon, just a normal NPC in a level.

NPC Code:

if (timeout) {
if (this.dir=0) y-=0.3;
if (this.dir=2) y+=0.3;
if (this.dir=1) x-=0.3;
if (this.dir=3) x+=0.3;
message #v(this.dir);

timeout=0.5;
}

if (actionmove) {
this.dir=strtofloat(#p(0));
timeout=1;
}
//#CLIENTSIDE
if (timeout) {
if (keydown(1)&&!this.dir=1) {triggeraction x,y,move,1;this.dir=1;}
if (keydown(3)&&!this.dir=3) {triggeraction x,y,move,3;this.dir=3;}
if (keydown(0)&&!this.dir=0) {triggeraction x,y,move,0;this.dir=0;}
if (keydown(2)&&!this.dir=2) {triggeraction x,y,move,2;this.dir=2;}
timeout=0.05;
}



This is NOT the whole script. Also, the player is attached to it.

EDIT: It wont triggeraction AFTER the first timeout=1; serverside. I have no idea why.
__________________
-Kjetil Valen

Last edited by VeX_RaT_Boy; 07-29-2003 at 02:35 PM..
Reply With Quote
  #5  
Old 07-29-2003, 04:46 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
NPC Code:

if(created||timeout){
if(this.dir=0&&y>0) y-=0.5;
if(this.dir=2&&x>0) y+=0.5;
if(this.dir=1&&x<64) x-=0.5;
if(this.dir=3&&y<64) x+=0.5;
message #v(this.dir);
timeout=0.5;
}

if(actionmove){
this.dir=strtofloat(#p(0));
timeout=0.5;
}

//#CLIENTSIDE
//Fixed by *osrs

if(created){
setimg block.png;
this.max=4;
timeout=0.05;
}

if(timeout||playerenters){
for(k=0;k<this.max;k++){
if(keydown(k)&&k!=this.m){
triggeraction x,y,move,#v(k);
this.m=strtofloat(#v(k));
}
}
timeout=0.05;
}



I think there is no need to trigger the npc every time when the position is changed,i tested the script online and worked fine.

PS:It's not the whole code,Kai
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #6  
Old 07-29-2003, 11:09 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Quote:
Originally posted by osrs

I think there is no need to trigger the npc every time when the position is changed,i tested the script online and worked fine.

PS:It's not the whole code,Kai
Ok, thank you that worked

[edit]
NPC Code:

if(this.dir=0&&y>0) move 0,-1,0.5,0;
if(this.dir=2&&x>0) move 0,+1,0.5,0;
if(this.dir=1&&x<64) move -1,0,0.5,0;
if(this.dir=3&&y<64) move +1,0,0.5,0;


I tested it with move... and its not working... why?
[/edit]


Also, I have another problem with triggeraction...

Its a weapon, triggering something clientside. I have a NPC on a level checking for it serverside if (action...), but it won't work! Strangly, it works clientside, but not serverside!
(Weapon Clientside to NPC Serverside)

Please respond if you know the problem.
__________________
-Kjetil Valen

Last edited by VeX_RaT_Boy; 07-29-2003 at 11:53 PM..
Reply With Quote
  #7  
Old 07-30-2003, 01:43 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally posted by VeX_RaT_Boy


Ok, thank you that worked

[edit]
NPC Code:

if(this.dir=0&&y>0) move 0,-1,0.5,0;
if(this.dir=2&&x>0) move 0,+1,0.5,0;
if(this.dir=1&&x<64) move -1,0,0.5,0;
if(this.dir=3&&y<64) move +1,0,0.5,0;


I tested it with move... and its not working... why?
[/edit]


Also, I have another problem with triggeraction...

Its a weapon, triggering something clientside. I have a NPC on a level checking for it serverside if (action...), but it won't work! Strangly, it works clientside, but not serverside!
(Weapon Clientside to NPC Serverside)

Please respond if you know the problem.
About the triggeraction,read newfeatures,Stefan made a hammer script,that would be helpful.
About the move thing,i'm not sure,i rarely use move '
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #8  
Old 07-30-2003, 02:57 AM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
but the mining thing doesn't say how to use it from a clientside weapon to a serverside npc!
__________________
-Kjetil Valen
Reply With Quote
  #9  
Old 07-30-2003, 03:36 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
I think its not working because the local NPC moves every time,saving the npc position would work (I think x_o)
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #10  
Old 07-30-2003, 01:16 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Its not a local NPC, it's a normal NPC in a level. But if i do the if (action...) clientside, it works!

Help anyone? clientside weapon > triggeraction to a serverside npc.
__________________
-Kjetil Valen
Reply With Quote
  #11  
Old 07-30-2003, 04:52 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally posted by VeX_RaT_Boy
Its not a local NPC, it's a normal NPC in a level. But if i do the if (action...) clientside, it works!

Help anyone? clientside weapon > triggeraction to a serverside npc.
Normal NPC in a level = local NPC,i believe o_x'
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #12  
Old 07-30-2003, 05:40 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Quote:
Originally posted by osrs


Normal NPC in a level = local NPC,i believe o_x'
I thought local NPC was a npc made with putnpc, putnpc2 ETC...
__________________
-Kjetil Valen
Reply With Quote
  #13  
Old 07-30-2003, 11:07 PM
Alexander Alexander is offline
Registered User
Join Date: Apr 2003
Location: California
Posts: 246
Alexander is on a distinguished road
Send a message via AIM to Alexander
Quote:
Originally posted by osrs


Normal NPC in a level = local NPC,i believe o_x'
I thought local NPC was a NPC that was clientside o.O

Quote:
Originally posted by VeX_RaT_Boy
Its not a local NPC, it's a normal NPC in a level. But if i do the if (action...) clientside, it works!

Help anyone? clientside weapon > triggeraction to a serverside npc.
Do a setshape or setshape2 serverside then try the trigger
Reply With Quote
  #14  
Old 07-30-2003, 11:13 PM
Androk Androk is offline
Registered User
Androk's Avatar
Join Date: Apr 2003
Posts: 614
Androk is on a distinguished road
You can't have something done on Clientside effect something on serverside, they don't mix, only variables transfer between the two. I am a newbie at scripting, so I might be wrong.
__________________

Name: Androk
Reply With Quote
  #15  
Old 07-30-2003, 11:16 PM
Alexander Alexander is offline
Registered User
Join Date: Apr 2003
Location: California
Posts: 246
Alexander is on a distinguished road
Send a message via AIM to Alexander
Quote:
Originally posted by Androk
You can't have something done on Clientside effect something on serverside, they don't mix, only variables transfer between the two. I am a newbie at scripting, so I might be wrong.
Yes you can -.-
Reply With Quote
Reply


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:47 PM.


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