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 08-07-2001, 02:23 AM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 will become famous soon enough
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
strings...

can someone show me some basic's of strings... and how to use server flags...
__________________
Reply With Quote
  #2  
Old 08-07-2001, 02:59 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
use a string by setting

setstring string name,content;

so if you want a string named 'bob' to contain the text 'is cool'

setstring bob,is cool;

you can call a string by have #s(stringname)

so well use bob here

message HELLO! BOB #s(bob);

the NPC would say "HELLO! BOB is cool"

Serer flags are things that dont effects the person alone but the whole server. IF you set a server.flag from one lvl . It can be called from another lvl.
__________________

subliminal message: 1+1=3
Reply With Quote
  #3  
Old 08-07-2001, 09:16 PM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 will become famous soon enough
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
Thankz man, im sill i but confused, but ill get the hang of them some day..
__________________
Reply With Quote
  #4  
Old 08-07-2001, 11:15 PM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
How is that cofusing. I will try to explain but Falcor did a good job.

Ok here is an example. Say you wanted a door to appear shut if a player enters and is not a certain class. And lets say the classes are god, robot, and plant man (whoever the idiot was who made these)And you only want the god to enter so. When the player chose to be a god you would have it do this:

if(playertouchsme){
set god;
}

then in the level with the door that only should open for gods put

if(playertouchsme){
if(god){
hidelocal;
else
show;
}
}

I think I messed up and it might be if(god=true) but i cant remember off the top of my head. If you use this it prolly wont work without changing a few things I messed up on but thats the basic Idea.

You set a string or flag (which makes it true) then you can use that to decide things in the game.

To set a server flag just put server.god I think. I never really use those so I dont know.

__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #5  
Old 08-08-2001, 04:30 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
Quote:
Originally posted by ownerofbabylon
How is that cofusing. I will try to explain but Falcor did a good job.

Ok here is an example. Say you wanted a door to appear shut if a player enters and is not a certain class. And lets say the classes are god, robot, and plant man (whoever the idiot was who made these)And you only want the god to enter so. When the player chose to be a god you would have it do this:

if(playertouchsme){
set god;
}

then in the level with the door that only should open for gods put

if(playertouchsme){
if(god){
hidelocal;
else
show;
}
}

I think I messed up and it might be if(god=true) but i cant remember off the top of my head. If you use this it prolly wont work without changing a few things I messed up on but thats the basic Idea.

You set a string or flag (which makes it true) then you can use that to decide things in the game.

To set a server flag just put server.god I think. I never really use those so I dont know.

he said strings not flags

strings would be like
if (playerchats&&strequals(#c, )) {
setstring server.chat,#c;
setstring server.player,#n;
}

to display it would be like

if (playerenters) {timeout=.5;}
if (timeout) {
message #s(server.player): #s(server.chat);
timeout=.5;}


so if you say hey and your nick is Merlin
it would say

Merlin: hey
__________________

ICQ: 117881194
AIM: TehWizad
E-Mail: [email protected]
Reply With Quote
  #6  
Old 08-09-2001, 12:57 AM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 will become famous soon enough
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
ok, i get it now..... thankz alot
__________________
Reply With Quote
  #7  
Old 08-09-2001, 01:27 AM
Luigi223 Luigi223 is offline
Registered User
Join Date: Jul 2001
Posts: 192
Luigi223 is on a distinguished road
this is strings ... i think

i think this is a string or something like that ....


if (playertouchsme) {
toweapons Horse Changer;
}
if (firedonhorse) {
setplayerprop #5,#c.gif;}



get on a horse say the name of a gif then fire the weapon and the horse changes to that gif
__________________

ph33r me and my l33t jump rope!
Don't hate me cause i'm beutiful.
Reply With Quote
  #8  
Old 08-09-2001, 02:52 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
well a string is diff. then a variable. so dont confuse the 2 ..
a string can hold letters and numbers.
variables just hold numbers .. and they have a limit . if u read the limit u get some crap like E.601 or something .. some error thing ..
a server string is just like a string but it starts with server.
and it saves into the server strings. which can be changed with RC.
here is a few way to use strings.

NPC Code:

if (playertouchsme) {
setstring mystring, hi;
}


that would set a string called mystring and would contain hi

NPC Code:

if (playertouchsme) {
setstring server.mystring, hi;
}


that would set a server string called server.mystring and would contain hi

and so on ..
also learn #s() and #v() and strtofloat() . those are important
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
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 02:53 AM.


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