Graal Forums  

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

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 09-24-2002, 02:28 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
putnpc2

Ive been having real trouble trying to put variables from an npc that uses the putnpc2 command into the npc that got put on the level using putnpc2..

Can anyone tell me why?

I tried level.vars i tried this.vars and i tried normal vars but not one works! :grrr:
__________________
- R0bin
  #2  
Old 09-24-2002, 02:45 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
well im doing this basically:

NPC Code:

if (actionserverside) {
putnpc2 playerx+3,playery,{
setstring num,#p(0);
setgif door.png;
message #s(num);
}
}



I dont think that is right, but i dont know how x.x

::EDIT

Someone suggested doing:

NPC Code:

with (getnpc(npcscount-1)) {
setstring num,#p(0);
}

__________________
- R0bin
  #3  
Old 09-24-2002, 03:39 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
it seems so inefficient.. i doubt thats how they did it with the 2k2 item trading..
__________________
- R0bin
  #4  
Old 09-24-2002, 04:06 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
well no, you should be able to use #p params from the serverside in putnpc2...

or like

putnpc3 x,y,param0,param1,etc,{
showcharacter;
message #p(0);
}
__________________
- R0bin
  #5  
Old 09-24-2002, 04:30 AM
Graal2001_NAT Graal2001_NAT is offline
Registered User
Join Date: Sep 2002
Posts: 241
Graal2001_NAT is on a distinguished road
level strings don't exist last time i checked =/
__________________
GONE, BAI
  #6  
Old 09-24-2002, 07:26 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
level.vars
__________________
- R0bin
  #7  
Old 09-25-2002, 11:03 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Jagen when's the last time you checked? Level.strings are part of the NPC Server x.X Like this.string for D/B NPC's, level.strings are for that level only. Means don't update the level :P Using this.strings in the Control-NPC or equivalent may be just as good though if not better.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
  #8  
Old 09-26-2002, 02:35 AM
Graal2001_NAT Graal2001_NAT is offline
Registered User
Join Date: Sep 2002
Posts: 241
Graal2001_NAT is on a distinguished road
actually I just tested it, had one npc
setstring level.test,asdf;
had another npc
sendtorc hello #s(level.test);
(i had it do a sleep first to give it time just in case it would lag before setting the string) and the RC result was
'hello'
when is the last time you tested it?
__________________
GONE, BAI
  #9  
Old 09-26-2002, 04:54 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
Quote:
Originally posted by Graal2001_NAT

(i had it do a sleep first to give it time just in case it would lag before setting the string)
It doesn't lag on the server, more or less, it would lag because it needs time to get to the client. To the server its just another day in the park.
__________________

subliminal message: 1+1=3
  #10  
Old 09-26-2002, 05:08 AM
Graal2001_NAT Graal2001_NAT is offline
Registered User
Join Date: Sep 2002
Posts: 241
Graal2001_NAT is on a distinguished road
Quote:
Originally posted by Falcor

It doesn't lag on the server, more or less, it would lag because it needs time to get to the client. To the server its just another day in the park.
I know, but just in case it took any time at all to set the string before the next npc loaded, I was doing that because I didn't want someone to say 'well the string must not have set before that npc loaded' after I said level.strings dont work/exist
__________________
GONE, BAI
  #11  
Old 09-26-2002, 08:54 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road


Bah someone lied to me again.. and if i find out who it was....


I will r0x0rz their s0x0rz.
__________________
- R0bin
  #12  
Old 09-26-2002, 11:09 PM
BinaryCrash BinaryCrash is offline
No memory dump.
Join Date: Jul 2002
Location: Brazil
Posts: 70
BinaryCrash is on a distinguished road
Send a message via ICQ to BinaryCrash Send a message via MSN to BinaryCrash
that putnpc3 exists?
can someone pm me about it please?
i'd like to learn it.
  #13  
Old 09-27-2002, 12:24 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
putnpc3 doenst exist.

putnpc image,textfile,x,y;

putnpc2 x,y,{Script};
__________________
- R0bin
  #14  
Old 09-27-2002, 11:15 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
I was curious as to where {Script} comes from. I take it basically putting out something from the Weapons List, I never played with it, more important things to do, lolz.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
  #15  
Old 09-28-2002, 07:46 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
You type it in *******
NPC Code:

NPC Code:

if (weaponfired) {
putnpc2 playerx+5,playery,{setimg bush.png; message R0bin owns you;};
}



__________________
- R0bin
  #16  
Old 09-28-2002, 04:36 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally posted by R0b1n-NPC
You type it in *******
NPC Code:

if (weaponfired) {
putnpc2 playerx+5,playery,{setimg bush.png; message R0bin owns you;};
}

Yes, you type it in, but you do not type it in clientside -.-
Also, you do not use script commands outside of if clauses with events.

NPC Code:

if (actionserverside)
tokenize #v(playerdir);
putnpc2 playerx+vecx(playerdir)*2,playery+vecy(playerdir)* 2,{
if (created) {
showcharacter;
dir = (strtofloat(#t(0))+2)%4;
setcharani sword,;
sleep 1;
destroy;
}
};
}
//#CLIENTSIDE
if (weaponfired)
triggeraction 0,0,serverside,Stupidy;

  #17  
Old 09-29-2002, 03:40 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
according to your script.. you can tokenize something in the serverside script.. then use a token in the putnpc2 script.. if thats tru then i bloody wub you :P
__________________
- R0bin
  #18  
Old 09-29-2002, 03:53 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
You can
But the better way probably is to do...

NPC Code:
putnpc2 x,y,{
if (created) message #s(this.text);
};
with (npcs[npcscount-1]) setstring this.text,Hi :O;

  #19  
Old 09-29-2002, 04:02 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
ok, i bloody wub you

the problem with that is when you do that, the npc your aiming for might not be the last npc put.. the npc server does lag a tiny bit
__________________
- R0bin
  #20  
Old 09-29-2002, 04:28 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
It only lags between serverside and clientside. It does not lag at all here.
  #21  
Old 09-29-2002, 04:30 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
i dunno, i would feel safer using the tokens
__________________
- R0bin
  #22  
Old 09-29-2002, 04:33 AM
Graal2001_Developer1 Graal2001_Developer1 is offline
Registered User
Join Date: Sep 2002
Location: Germany - Lübeck
Posts: 17
Graal2001_Developer1 is on a distinguished road
Send a message via ICQ to Graal2001_Developer1
You can also use callnpc for this

NPC Code:

if (actionserverside) {
putnpc2,playerx,playery, {
if (created) {
showcharacter;
setcharani sword,;
sleep 1;
destroy;
}
if (thedir) dir = (strtofloat(#p(0))+2)%4;
};
callnpc npcscount-1,thedir,#v(playerdir);
}
//#CLIENTSIDE
if (weaponfired) triggeraction 0,0,Sillyweapon,serverside;



would work the same way and doesn't lagg too
__________________
This is TDO
Nothing to say.. just need a webhost for images
  #23  
Old 10-03-2002, 11:00 AM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by R0b1n-NPC
i dunno, i would feel safer using the tokens
I wouldn't. The if (created) will just be called in the next frame, so imagine what would happen if some other script did tokenize.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
  #24  
Old 10-03-2002, 07:59 PM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
If two npcs were dropped using putnpc2 at EXACTLY the same time, npcscount-1 might not be the one you are aiming for.


^ is possible.. kinda
__________________
- R0bin
  #25  
Old 10-03-2002, 08:28 PM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
What is the case then?
__________________
- R0bin
  #26  
Old 10-04-2002, 01:25 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
Ah ok.
__________________
- R0bin
  #27  
Old 10-04-2002, 04:40 AM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by R0b1n-NPC
If two npcs were dropped using putnpc2 at EXACTLY the same time, npcscount-1 might not be the one you are aiming for.


^ is possible.. kinda
It is not possible, but let's assume it would be. You would use tokenize.
How would that help? Tokenize overwrites the last tokenize, so you'd have the same problem.
Even worse, because the result of tokenize would be read in the if (created) event, and this event will be processed one frame later, so it is even more possible that some other call to tokenize happend.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
  #28  
Old 10-04-2002, 04:50 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
You confuse me greatly :|
__________________
- R0bin
  #29  
Old 10-04-2002, 10:36 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Quote:
Originally posted by R0b1n-NPC
You confuse me greatly :|
Okay.
You tokenize something.
You have #t(0) and #t(1).
You tokenize something else, they overwrite that.

Correct me if I'm wrong someone. I didn't really pay attention to this thread that much.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
  #30  
Old 10-05-2002, 07:35 PM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
yea... but you can save the tokens to a string, that way they'd be saved :-D
__________________
- R0bin
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 05:54 AM.


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