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 04-07-2006, 06:14 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
Simple Scripting Question(s)

In reference to server.string and client.string

How do I read them in a script? Do I use strequels or what, 'cause I can never get it to work.

Like if (strequals(#s,client.string),1) {
I'm sure I've tried that before and it didn't work.

If anyone would be so kind as to give me a simple script, like -

if (read the string=0) {
show;
}
if (read the string=1) {
hide;
}
if (read the string=2) {
sleep .5;
}

Just something simple so I know what to do in the future please.

Thanks
Reply With Quote
  #2  
Old 04-07-2006, 08:26 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
server.strings can only be read clientside
client strings can be read both client/serverside
so you would do
In GS1
NPC Code:

setstring(client.foo,bar);


In GS2
NPC Code:

client.foo="bar";

Reply With Quote
  #3  
Old 04-07-2006, 08:30 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
Ah, and how would I read the string in GS2?
Reply With Quote
  #4  
Old 04-07-2006, 10:08 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
a way to check if client.foo equals bar is this
GS1
NPC Code:

strequals(#s(client.foo),bar)


GS2
NPC Code:

client.foo=="bar";

Reply With Quote
  #5  
Old 04-07-2006, 11:16 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Warcaptain
server.strings can only be read clientside
server. strings are only usable on the serverside. They are not sent to the client.

serverr. strings are readable on the clientside, but are only writable on the serverside.
__________________
Skyld
Reply With Quote
  #6  
Old 04-07-2006, 11:36 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Warcaptain
In GS1
NPC Code:

setstring(client.foo,bar);

Actually, old gscript is more like:

PHP Code:
setstring client.foo,bar
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #7  
Old 04-08-2006, 04:08 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Yes sorry, you are both correct

Its been a long time since I used both things.
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:45 AM.


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