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 03-06-2004, 02:29 AM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
String question...

ok im trying to make a sign that displays the server string, like says the score in the event.. and i can't figure out what im doing wrong.. heres the script:
NPC Code:
message #s(server.ppb);


i mean it does show it.. but when i change the server.ppb, it doesnt update itself... like i made the script where you go /setscore # , and that works.. it changes the string in the server flag, but when you do that the
NPC Code:
message #s(server.ppb);

doesnt update itself.. it stays what the old one was, and you have to update the level.. i know a script where u have to do if playerchats blah blah blah and then message #s(server.ppb);, but i dont want people to have to say that, i just want them to be able to see it.. kind of like the score on UN's CTF
Reply With Quote
  #2  
Old 03-06-2004, 02:32 AM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
User serverr.string and change it serverside.
Reply With Quote
  #3  
Old 03-06-2004, 02:41 AM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
umm thats what im using
NPC Code:
message #s(server.ppb);


server.pbb or server.string
Reply With Quote
  #4  
Old 03-06-2004, 02:49 AM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
serverr.string

the double r is NOT a typo.
it means it is readable clientside, and read-writable serverside.
Reply With Quote
  #5  
Old 03-06-2004, 03:00 AM
Nappa Nappa is offline
The Great Nappa
Nappa's Avatar
Join Date: Sep 2003
Location: Florida
Posts: 1,911
Nappa is on a distinguished road
Send a message via AIM to Nappa
God. Serverr strings are annoying and a waste of space.

Avoid using them when possible, theirs other ways to do things.
__________________
Reply With Quote
  #6  
Old 03-06-2004, 03:05 AM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
They are probably the fastest option for having a persistant global string.
Reply With Quote
  #7  
Old 03-06-2004, 03:08 AM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
hmm i did both
NPC Code:
//#SERVERSIDE
message #s(serverr.ppb);


and
NPC Code:
message #s(serverr.ppb);

but neither of them would show anything.. am i missing some part of the script here?

Last edited by Fhqwhgads; 03-06-2004 at 03:21 AM..
Reply With Quote
  #8  
Old 03-06-2004, 04:40 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Are you saying the count isn't being updated after it's modified via RC or another script? You need to have it in a timeout for it to update itself.
__________________
Kat
Reply With Quote
  #9  
Old 03-06-2004, 04:46 AM
Nappa Nappa is offline
The Great Nappa
Nappa's Avatar
Join Date: Sep 2003
Location: Florida
Posts: 1,911
Nappa is on a distinguished road
Send a message via AIM to Nappa
Quote:
Originally posted by R0bin
They are probably the fastest option for having a persistant global string.
If he is using a gamescript, it can easily be done with triggeractions and variables.
__________________
Reply With Quote
  #10  
Old 03-06-2004, 05:08 AM
DarkShadows_Legend DarkShadows_Legend is offline
Cult of the Winky
DarkShadows_Legend's Avatar
Join Date: Apr 2003
Location: Florida
Posts: 614
DarkShadows_Legend is on a distinguished road
Send a message via AIM to DarkShadows_Legend
You can use a serverr.string and display the message in a timeout loop

example:
NPC Code:

//#CLIENTSIDE
if(playerenters || timeout){
message #s(serverr.message);
timeout = 1;
}

__________________
- Criminal X

"I rather be hated for being myself, than be liked for being what you like best. I go above the influence, not under." - Me
Reply With Quote
  #11  
Old 03-06-2004, 05:56 AM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
Talking

I LOVE YOU GUYS!!! Thanks for all the help! I figured out what i was doing wrong! Thanks again!
Reply With Quote
  #12  
Old 03-06-2004, 11:26 AM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Strings rock :P
I like them to boot people off servers:
NPC Code:

//#CLIENTSIDE
if(created) setstring this.allowed,WanDaMan,Snakeandy7,Etrican;
if(playertouchsme){
if(!strconains(#s(this.allowed),#a)){
triggeraction 0,0,serverside,onlinestartlocation.nw,30,30;
} else{
say2 welcome #s(this.allowed);
}



Smeh it's been some time..
__________________
V$:CONFL16T
Reply With Quote
  #13  
Old 03-06-2004, 04:17 PM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
There is no such thing as //#SERVERSIDE.

Scripts are like this





/* Serverside script here */

//#CLIENTSIDE

/* Clientside script here */


Capish?

Quote:
Originally posted by Nappa


If he is using a gamescript, it can easily be done with triggeractions and variables.

Please shut up about things you have no clue about.
Reply With Quote
  #14  
Old 03-06-2004, 04:34 PM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
ok, i get that part, but in graalscript, is there any way to add to server strings? like
#s(server.string)+=1.. that doesnt work or
server.string+=1.. that doesnt work either lol.. or even
setstring server.string+=1. or something like that?

i should really learn more graalscript... :o
Reply With Quote
  #15  
Old 03-06-2004, 04:52 PM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
Yes you should.

setstring string,#v(strtofloat(#s(string))+1);
Reply With Quote
  #16  
Old 03-06-2004, 05:02 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Quote:
Originally posted by R0bin
Yes you should.

setstring string,#v(strtofloat(#s(string))+1);
So that's what strtofloat is for ;O, thanks lol!
__________________
V$:CONFL16T
Reply With Quote
  #17  
Old 03-06-2004, 05:04 PM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
::Loves Robin::
Thanks man! I seriously gotta stop scripting BASIC on my TI and learn graalscript more XD...
now to figure out putnpc...
Reply With Quote
  #18  
Old 03-06-2004, 05:04 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Putnpc isn't bad... It's like a regular statement..
__________________
V$:CONFL16T
Reply With Quote
  #19  
Old 03-06-2004, 05:12 PM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
what can you use to check server strings? like i want it to be
if (server.string = server.string2){<command>}
but that doesnt work, cause even if they dont equal it still does the <command>.. ive tried many different ways and i still cant get it....

oh and
Quote:
Putnpc isn't bad... It's like a regular statement..
well i mean i want it to put the npc, but the actual script of the npc contains a "," so you cant do that, because then the putnpc goes to the next command which is x then y... so i cant figure out how to put in the script in putnpc .. well ill get it eventually
Reply With Quote
  #20  
Old 03-06-2004, 05:15 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Quote:
Originally posted by Fhqwhgads
what can you use to check server strings? like i want it to be
if (server.string = server.string2){<command>}
but that doesnt work, cause even if they dont equal it still does the <command>.. ive tried many different ways and i still cant get it....

oh and
well i mean i want it to put the npc, but the actual script of the npc contains a "," so you cant do that, because then the putnpc goes to the next command which is x then y... so i cant figure out how to put in the script in putnpc .. well ill get it eventually
if(this.string(string)){
do something here;
}
(I think )!...

Well for the other part post the script so I know what your doing..
__________________
V$:CONFL16T
Reply With Quote
  #21  
Old 03-06-2004, 05:21 PM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
aight i know what im doing.. u have to upload the scrit.txt into the scripts folders im guessing for putnpc... am i right?
Reply With Quote
  #22  
Old 03-06-2004, 05:22 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
yep:}
Edit by Loriel: Hell no.
__________________
V$:CONFL16T

Last edited by Loriel; 03-06-2004 at 07:37 PM..
Reply With Quote
  #23  
Old 03-06-2004, 05:32 PM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
wan, please dont help.

To check two strings for equality you can do

if (strequals(#s(string),#s(string2)) {
}
Reply With Quote
  #24  
Old 03-06-2004, 05:35 PM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
ok wan check what i did wrong..
first i tried this:
NPC Code:
if (created){
canbecarried;
drawoverplayer;
}
//#CLIENTSIDE
if (wasthrown){
sleep 1;
destroy;
putnpc,ppball.txt,30,30;
}


and the txt file was the same.... then I tried
NPC Code:
if (created){
canbecarried;
drawoverplayer;
}
if(actionserverside){
putnpc block.png,ppball.txt,30,30;
}
//#CLIENTSIDE
if (wasthrown){
sleep 1;
destroy;
triggeraction 0,0,serverside;
}


and then i tried it with actionclientside.. i dont know why im using triggeraction, just thought it might work.. so can u help me out?
Reply With Quote
  #25  
Old 03-06-2004, 06:06 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
I don't want to mess up again, best r0bin help you out
__________________
V$:CONFL16T
Reply With Quote
  #26  
Old 03-06-2004, 06:36 PM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
ok, if u can just warp the npc i wouldnt need putnpc.. so is there any way to like warp the npc? like setlevel or something?
Reply With Quote
  #27  
Old 03-06-2004, 06:41 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
putnpc is disgusting
Reply With Quote
  #28  
Old 03-06-2004, 06:56 PM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
yep i know.. but is there any other way to put an npc somewhere? like im working an an event... and its kinda like football... where u carry the ball and throw it into the goal area... well after u throw it in.. how can it warp back to the place? like UN's CTF... if u die with the flag or score, it goes back to where it was in the beginning.. thats what im trying to do..
Reply With Quote
  #29  
Old 03-06-2004, 07:40 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
putnpc has been deprecated for long, and not ever been supported on the NPC Server.

Use putnpc2 x, y, { script };
Reply With Quote
  #30  
Old 03-06-2004, 08:30 PM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
that wouldnt work because the script is
NPC Code:
if (created){
canbecarried;
drawoverplayer;
}
//#CLIENTSIDE
if (wasthrown){
sleep 1;
destroy;
}


and if i would put in putnpc2.. the script would have to keep going on and on and on.... maybe it could be triggeractioned.. but im not sure how do that... and maybe that wont work either...
Reply With Quote
  #31  
Old 03-06-2004, 09:53 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
if(actionserverside){
playerkills+=100;
}
//#CLIENTSIDE
if(weaponfired){
putnpc2 x, y, {
if(hasweapon(soandso)){
//do stuff like
triggeraction 0,0,serverside,weaponname;
};
}

That's off my head, I gues it's wrong..
__________________
V$:CONFL16T
Reply With Quote
  #32  
Old 03-07-2004, 10:08 PM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
ok heres the script again:
NPC Code:
if (created){
canbecarried;
drawoverplayer;
}
//#CLIENTSIDE
if (wasthrown){
sleep 1;
destroy;
}


so under the if wasthrown, after the destroy, i would put putnpc2, it wouldnt work because of this
NPC Code:
if (created){
canbecarried;
drawoverplayer;
}
//#CLIENTSIDE
if (wasthrown){
sleep 1;
destroy;
putnpc2 30,30,{ <-- here the code would repeat itself, thus making another putnpc2 which would reapeat itself, this making another npc2.. Thats the problem..


I pointed out with an arrow what the problem is.. so my question is that is there any other way to make this work?
Reply With Quote
  #33  
Old 03-07-2004, 10:13 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
STOP.

Stop even attempting to script, stop asking questions as you get further in the script, stop doing whatever the hell you're doing. Actually make an effort to learn by using your OWN mind instead of asking a countless ammount of questions. Read documents as you obviously haven't done.



putnpc2 is serverside only you fool
Reply With Quote
  #34  
Old 03-08-2004, 01:04 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
Do not stop trying to script, but stick to things that will help you more learn more. Things that you can do with little help, things that will not just get something done but make it obvious to you how scripting works :|
Reply With Quote
  #35  
Old 03-08-2004, 09:45 AM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
You globalls don't really act like them, he's new give him credit. God you both was like it at one point calm down
__________________
V$:CONFL16T
Reply With Quote
  #36  
Old 03-08-2004, 05:29 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
Nope.
I used to suck at scriping of course, and relatively still do, but I do not ask about things I have no clue of but rather try to work with things I can do, and learn that way.
Reply With Quote
  #37  
Old 03-09-2004, 05:03 AM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
OK!!! THANK YOU PYTHON!!!
Quote:
putnpc2 is serverside only you fool
<3 <3 <3 I got it..
Reply With Quote
  #38  
Old 03-09-2004, 05:17 AM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally posted by Python523
STOP.

Stop even attempting to script, stop asking questions as you get further in the script, stop doing whatever the hell you're doing. Actually make an effort to learn by using your OWN mind instead of asking a countless ammount of questions. Read documents as you obviously haven't done.



putnpc2 is serverside only you fool
Not trying to attack you, but you could have asked that more nicely. His goal is still to get better, even if he's going about it the wrong way. That is a very upsetting reply to get.
__________________
Reply With Quote
  #39  
Old 03-09-2004, 05:20 AM
Fhqwhgads Fhqwhgads is offline
Registered User
Join Date: Nov 2003
Location: Chicago
Posts: 57
Fhqwhgads is on a distinguished road
Send a message via AIM to Fhqwhgads
thanks kristi, but no.. he made me realise a lot of stuff, and i take that as help not an insult...
Reply With Quote
  #40  
Old 03-09-2004, 05:48 AM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally posted by Fhqwhgads
thanks kristi, but no.. he made me realise a lot of stuff, and i take that as help not an insult...
=P i see him reply snappy a lot, i chose to address it here XD
__________________
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 06:39 PM.


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