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-10-2007, 09:57 PM
shadowjones shadowjones is offline
**** Scripter xD
Join Date: Apr 2007
Posts: 24
shadowjones is on a distinguished road
Making sense of "else"

No matter what I do, whenever I type in ANY text at all and it will say whats in the else command (ex: I say jswkdng I get msg saying, "text part 2")

I'm trying to use this to make seperate messages when you have already talked to him.

NPC Code:
//CLIENTSIDE
if (clientr.helloworld=1 &&(playertouchsme))
say2 Text part 1;
else
say2 text part 2;

if (playerchats&&strequals(#c,Text part 3)) {
say2 Text part 4;
clientr.helloworld=1;
}

Reply With Quote
  #2  
Old 04-10-2007, 10:04 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by shadowjones View Post
No matter what I do, whenever I type in ANY text at all and it will say whats in the else command (ex: I say jswkdng I get msg saying, "text part 2")

I'm trying to use this to make seperate messages when you have already talked to him.

NPC Code:
//CLIENTSIDE
if (clientr.helloworld=1 &&(playertouchsme))
say2 Text part 1;
else
say2 text part 2;

if (playerchats&&strequals(#c,Text part 3)) {
say2 Text part 4;
clientr.helloworld=1;
}

First of all, You might want to do:

PHP Code:
//#CLIENTSIDE
if (playertouchsme)
{
if (
clientr.helloworld == 1)
{
say Whatever 1;
} else {
say Whatever 2;
}

And also, Use == for comparisons. Not =.

PHP Code:
=                     Assignment
==                    Comparison 

Lastly:
PHP Code:
//#CLIENTSIDE
not
//CLIENTSIDE 
__________________
What signature? I see no signature?
Reply With Quote
  #3  
Old 04-10-2007, 10:06 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
clientr. strings are set on the serverside, and can be read on the clientside. And if you're doing this GS1(which I assume you are by your syntax's, you have to set the string as a string, not as a variable.
setstring clientr.helloworld,1;
Reply With Quote
  #4  
Old 04-10-2007, 10:06 PM
shadowjones shadowjones is offline
**** Scripter xD
Join Date: Apr 2007
Posts: 24
shadowjones is on a distinguished road
Quote:
Originally Posted by godofwarares View Post
First of all, You might want to do:

PHP Code:
//#CLIENTSIDE
if (playertouchsme)
{
if (
clientr.helloworld == 1)
{
say Whatever 1;
} else {
say Whatever 2;
}

And also, Use == for comparisons. Not =.

PHP Code:
=                     Assignment
==                    Comparison 

Lastly:
PHP Code:
//#CLIENTSIDE
not
//CLIENTSIDE 
wow...i didnt even notice i forgot hte # O_O...thanks a bunch ^_^
Reply With Quote
  #5  
Old 04-10-2007, 10:24 PM
shadowjones shadowjones is offline
**** Scripter xD
Join Date: Apr 2007
Posts: 24
shadowjones is on a distinguished road
Quote:
Originally Posted by DustyPorViva View Post
clientr. strings are set on the serverside, and can be read on the clientside. And if you're doing this GS1(which I assume you are by your syntax's, you have to set the string as a string, not as a variable.
setstring clientr.helloworld,1;
ive been using clientr.hellowworld=1; on all my scripts and they are all working fine??
Reply With Quote
  #6  
Old 04-10-2007, 10:53 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Well I'm not that all experienced with online stuff... but that's always how I've known them to work. Is this 'working' working online on a server or offline?
Reply With Quote
  #7  
Old 04-11-2007, 01:12 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
clientr.var can only be set on clientside.
It can be read clientside or serverside.

TServerPlayer() I believe.
__________________
Reply With Quote
  #8  
Old 04-11-2007, 02:19 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
TServerPlayer; its not a function z.z
Reply With Quote
  #9  
Old 04-11-2007, 03:16 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by Rapidwolve View Post
TServerPlayer; its not a function z.z
Its an object. Not a function.
It needs a ().

PHP Code:
TServerPlayer() 
__________________
What signature? I see no signature?
Reply With Quote
  #10  
Old 04-11-2007, 11:17 AM
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 shadowjones View Post
ive been using clientr.hellowworld=1; on all my scripts and they are all working fine??
When you do varname = value; in old GScript, it only works for integer/float values. Also I don't think it works with clientr.-style strings either.

varname = value; in the new engine is the default way of assigning values to variables; if this is working in your script for some string values, then you are probably mixing old and new GScript, which you shouldn't be doing.
__________________
Skyld
Reply With Quote
  #11  
Old 04-11-2007, 12:18 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
That's what I thought, and it was really confusing me.
Reply With Quote
  #12  
Old 04-11-2007, 04:03 PM
shadowjones shadowjones is offline
**** Scripter xD
Join Date: Apr 2007
Posts: 24
shadowjones is on a distinguished road
Quote:
Originally Posted by Skyld View Post
When you do varname = value; in old GScript, it only works for integer/float values. Also I don't think it works with clientr.-style strings either.

varname = value; in the new engine is the default way of assigning values to variables; if this is working in your script for some string values, then you are probably mixing old and new GScript, which you shouldn't be doing.
Im only using GS1. I do get some problems using clientr though. But the problems randomly happen.
Here is what I mean:
In my start area, you have a class selection. Whichever class you say, its gives you your certain clientr.player_class=*.
I look in player information through RC and there it is, clientr.player_class=1

Then I do a seperate script, in this case for a quest. If you say something specific it gives you clientr.quest=1. Now I don't know why, but this occurs with the script quite a bit:
1. I say whats needed to trigger the script thus clientr.quest=1
2. I go to a door scripted to only open if (clientr.quest=1) and it works. Yet in player attributes on RC, it doesn't show clientr.quest=1, instead its just blank.
(First question: why does the door open if its not visible in there?)
3. I then relog and try the door again. It does not work as if I had the clientr set

Any ideas why it would be doing this?

P.S. If you need me to reword this please ask lol, it was hard typing it -_-
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 09:00 AM.


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