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 06-19-2001, 11:18 PM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
Question Server-Wide Strings (HELP ME)

Ok, this is kinda a n00b question, but here goes...
how do initalize a server-wide string, and would it work offline?
Reply With Quote
  #2  
Old 06-19-2001, 11:59 PM
Marco2002 Marco2002 is offline
Registered User
Join Date: Jun 2001
Location: Germany
Posts: 77
Marco2002 is on a distinguished road
Send a message via ICQ to Marco2002
easy:
setstring server.<stringname>,string;
and yes,it works offline
__________________
Reply With Quote
  #3  
Old 06-20-2001, 12:00 AM
T-Squad T-Squad is offline
Banned
T-Squad's Avatar
Join Date: Mar 2001
Location: United States of America
Posts: 1,733
T-Squad is on a distinguished road
grrrrr
Reply With Quote
  #4  
Old 06-20-2001, 12:16 AM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
cool... im trying to make a radio station that brodcasts all over the server... thanks man
oh yeah... and to display it would be
setcharprop #c, #s(server.blahblah);
right?
Reply With Quote
  #5  
Old 06-20-2001, 12:21 AM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
no cause if u want to display a string u gotta use the setcharprop, i think...
oh yeah... that doesent work...
how do i display a string as a message above the npc like the text box
Reply With Quote
  #6  
Old 06-20-2001, 12:31 AM
Guest
Posts: n/a
message #v(server.string);

you used #s, but use #v
Reply With Quote
  #7  
Old 06-20-2001, 01:25 AM
vergil vergil is offline
Registered User
vergil's Avatar
Join Date: Mar 2001
Posts: 1,408
vergil will become famous soon enough
Send a message via ICQ to vergil
yeah message() is the exact same as setcharprop
its just the equivalent in function like
NPC Code:
if (playerenters) {
function sayradiothing() {
setcharprop #c,#s(server.radio);
}
setstring server.radio,blah;
sayradiothing();
}


whereas sayradiothing() is just the exact same as message() so it doesnt matter whether you use message or setcharprop

anyone know how to supply the function definition an argument? i keep getting a syntax error =\
it would be really nice if you were doing lots of lines of messages with the same beginngin like a game show "And the question is..."
so you would be able to redefine message (orwhatevr you want it) as
NPC Code:
function gameshowquestion(beginning,end) {
message #v(beginning),#v(end);
}
setstring begin,"And the question is...";
setstring question1,"who is the president of the US?";
gameshowquestion(begin,question1);
setstring question2,"do you like cheese?";
gameshowquestion(begin,question1);


Last edited by vergil; 06-20-2001 at 01:34 AM..
Reply With Quote
  #8  
Old 06-20-2001, 01:34 AM
vergil vergil is offline
Registered User
vergil's Avatar
Join Date: Mar 2001
Posts: 1,408
vergil will become famous soon enough
Send a message via ICQ to vergil
Quote:
Originally posted by Kaimetsu
First, functions can't take arguments.

Second, your script wouldn't work.

Third, I bet there are at least some differences between using message and using a raw setcharprop. There always are.
which one? works for me =\

Why shouldnt functions be able to take arguements? what kind of language is this? that's half the reason they're there..
Reply With Quote
  #9  
Old 06-20-2001, 01:40 AM
vergil vergil is offline
Registered User
vergil's Avatar
Join Date: Mar 2001
Posts: 1,408
vergil will become famous soon enough
Send a message via ICQ to vergil
Kaimetsu it does work, why dont you open up Graal and try it before you jump to conclusions? =\

The only reason I put it inside an event is because i was fooling around obviously you wouldn't want a radio to turn itself on and tune into a station as soon as you entered the room
Reply With Quote
  #10  
Old 06-20-2001, 01:49 AM
vergil vergil is offline
Registered User
vergil's Avatar
Join Date: Mar 2001
Posts: 1,408
vergil will become famous soon enough
Send a message via ICQ to vergil
Quote:
Originally posted by Kaimetsu


Me at college. No Graal. Besides, just because it works doesn't mean it's right. Look, you should separate the function definitions.



No, but that's not my point. You should put the function definition separately.
a script being unorganized does not mean it doesnt work as you had put it =\

if youre at college why are you messing around with a game language so inferior compared to others its laughable? why arent you programming with other things? most of these people are under 15.
Reply With Quote
  #11  
Old 06-20-2001, 01:54 AM
vergil vergil is offline
Registered User
vergil's Avatar
Join Date: Mar 2001
Posts: 1,408
vergil will become famous soon enough
Send a message via ICQ to vergil
it's just an example I'm not mr. perfect when I script Graal NPCs especially when its just to ask/answer a question.
Reply With Quote
  #12  
Old 06-20-2001, 03:11 AM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
Ow... my head... can someone just post the script?
Reply With Quote
  #13  
Old 06-20-2001, 03:18 AM
vergil vergil is offline
Registered User
vergil's Avatar
Join Date: Mar 2001
Posts: 1,408
vergil will become famous soon enough
Send a message via ICQ to vergil
...thats exactly why i dislike this forum
half the topics are GIV MI DIS PLZ BYE
Reply With Quote
  #14  
Old 06-20-2001, 03:22 AM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
oh well, without some help we would never learn, now would we????
Reply With Quote
  #15  
Old 06-20-2001, 03:33 AM
vergil vergil is offline
Registered User
vergil's Avatar
Join Date: Mar 2001
Posts: 1,408
vergil will become famous soon enough
Send a message via ICQ to vergil
"helping" isnt saying 'here' and posting the script for you to copy and paste
Reply With Quote
  #16  
Old 06-20-2001, 08:14 AM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
ok fine... just tell me the right way to make a string and to display it on a NPC in another level
Reply With Quote
  #17  
Old 06-20-2001, 09:10 AM
Cybnext_Design Cybnext_Design is offline
Registered User
Join Date: Jun 2001
Posts: 244
Cybnext_Design is on a distinguished road
Send a message via AIM to Cybnext_Design
Radio Script

I have never made an NPC like this but ill give it a shot:

this would be for like a DJ Booth:
NPC Code:

if (playerchats && strequals(#g,DJ)) {
setstring server.radio,#c;
}



this would be for all of the other radios:
NPC Code:

if (created) {
timeout=.05;
}

if (timeout) {
setcharprop #c,#s(server.radio);
timeout=.05;
}



Like I said im not sure if this will work.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #18  
Old 06-20-2001, 09:10 PM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
hmm... where is the chatstring from the DJ get converted to the server string? oh wait i think i see it...
yah nevermind im just a stupid n00b
Reply With Quote
  #19  
Old 06-22-2001, 12:26 AM
CrazedMerlin CrazedMerlin is offline
Some Guy :\
Join Date: Apr 2001
Posts: 3,619
CrazedMerlin is on a distinguished road
Send a message via AIM to CrazedMerlin Send a message via Yahoo to CrazedMerlin
Ill help
if (weaponfired&&!weaponon) {setplayerprop #c,On.;
set radioon;}
else
if (weaponfired&&weaponon) {setplayerprop #c,Off.;
unset radioon;}
if (radioon&&playerchats(#c, )) {setstring server.radio,#c;
setstring server.radionick,#n;
}


and to display them in another NPC

timeout=0.1;
if (timeout) {message #s(server.radionick)#s(server.radio);
}
__________________

ICQ: 117881194
AIM: TehWizad
E-Mail: [email protected]
Reply With Quote
  #20  
Old 06-22-2001, 01:15 AM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
WOW MAN U R KOOL I HAV DIS NOW AND I MA NOT STOOD NOW... OH YAH I NEED DIS KAY? BY
Reply With Quote
  #21  
Old 06-22-2001, 01:27 AM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
hehehe... that was kool
OK I HAVE DIS BUT WHAR IS MA ODER SKRIPT? I NED TI NWO!
Reply With Quote
  #22  
Old 06-22-2001, 01:47 AM
CrazedMerlin CrazedMerlin is offline
Some Guy :\
Join Date: Apr 2001
Posts: 3,619
CrazedMerlin is on a distinguished road
Send a message via AIM to CrazedMerlin Send a message via Yahoo to CrazedMerlin
*confused*
__________________

ICQ: 117881194
AIM: TehWizad
E-Mail: [email protected]
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 11:02 PM.


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