Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   String question... (https://forums.graalonline.com/forums/showthread.php?t=51510)

Fhqwhgads 03-06-2004 02:29 AM

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

R0bin 03-06-2004 02:32 AM

User serverr.string and change it serverside.

Fhqwhgads 03-06-2004 02:41 AM

umm thats what im using
NPC Code:
message #s(server.ppb);


server.pbb or server.string

R0bin 03-06-2004 02:49 AM

serverr.string

the double r is NOT a typo.
it means it is readable clientside, and read-writable serverside.

Nappa 03-06-2004 03:00 AM

God. Serverr strings are annoying and a waste of space.

Avoid using them when possible, theirs other ways to do things.

R0bin 03-06-2004 03:05 AM

They are probably the fastest option for having a persistant global string.

Fhqwhgads 03-06-2004 03:08 AM

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?

-Ramirez- 03-06-2004 04:40 AM

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.

Nappa 03-06-2004 04:46 AM

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.

DarkShadows_Legend 03-06-2004 05:08 AM

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;
}


Fhqwhgads 03-06-2004 05:56 AM

I LOVE YOU GUYS!!! Thanks for all the help! I figured out what i was doing wrong! :D Thanks again!

WanDaMan 03-06-2004 11:26 AM

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..

R0bin 03-06-2004 04:17 PM

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.

Fhqwhgads 03-06-2004 04:34 PM

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

R0bin 03-06-2004 04:52 PM

Yes you should.

setstring string,#v(strtofloat(#s(string))+1);

WanDaMan 03-06-2004 05:02 PM

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!

Fhqwhgads 03-06-2004 05:04 PM

::Loves Robin::
Thanks man! I seriously gotta stop scripting BASIC on my TI and learn graalscript more XD...
now to figure out putnpc...

WanDaMan 03-06-2004 05:04 PM

Putnpc isn't bad... It's like a regular statement..

Fhqwhgads 03-06-2004 05:12 PM

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

WanDaMan 03-06-2004 05:15 PM

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..

Fhqwhgads 03-06-2004 05:21 PM

aight i know what im doing.. u have to upload the scrit.txt into the scripts folders im guessing for putnpc... am i right?

WanDaMan 03-06-2004 05:22 PM

yep:}
Edit by Loriel: Hell no.

R0bin 03-06-2004 05:32 PM

wan, please dont help.

To check two strings for equality you can do

if (strequals(#s(string),#s(string2)) {
}

Fhqwhgads 03-06-2004 05:35 PM

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?

WanDaMan 03-06-2004 06:06 PM

I don't want to mess up again, best r0bin help you out :p

Fhqwhgads 03-06-2004 06:36 PM

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?

Python523 03-06-2004 06:41 PM

putnpc is disgusting

Fhqwhgads 03-06-2004 06:56 PM

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.. :(

Loriel 03-06-2004 07:40 PM

putnpc has been deprecated for long, and not ever been supported on the NPC Server.

Use putnpc2 x, y, { script };

Fhqwhgads 03-06-2004 08:30 PM

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...

WanDaMan 03-06-2004 09:53 PM

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.. :p

Fhqwhgads 03-07-2004 10:08 PM

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?

Python523 03-07-2004 10:13 PM

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

Loriel 03-08-2004 01:04 AM

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 :|

WanDaMan 03-08-2004 09:45 AM

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:\

Loriel 03-08-2004 05:29 PM

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.

Fhqwhgads 03-09-2004 05:03 AM

OK!!! THANK YOU PYTHON!!!
Quote:

putnpc2 is serverside only you fool
<3 <3 <3 :D I got it..

Kristi 03-09-2004 05:17 AM

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.

Fhqwhgads 03-09-2004 05:20 AM

thanks kristi, but no.. he made me realise a lot of stuff, and i take that as help not an insult...

Kristi 03-09-2004 05:48 AM

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


All times are GMT +2. The time now is 05:11 AM.

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