variables

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: variables
Master
Member # 5977
Profile Homepage #0
the time has come for me to go one small step further, and that is to start using variables. Now i don't really understand what a variable can be. Jeff used mostly letters like "x," "i," and "j," but there's also a variable "choice." Now here's the question. can a variable be also words, like a variable "day."

--------------------
Play and rate my scenarios:

Where the rivers meet
View my upcoming scenario: The Nephil Search: Escape.

Give us your drek!
Posts: 3029 | Registered: Saturday, June 18 2005 07:00
...b10010b...
Member # 869
Profile Homepage #1
Yes. You can almost any word you like as a variable, except for the ones you can't. I know that the word "shop" can't be used as a variable because it's used internally by the game engine; there are a few others as well. "Day" may well be one of them; be sure to test it. If you try to use a reserved variable name, you'll get an error message.

[ Tuesday, December 20, 2005 04:50: Message edited by: Thuryl ]

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00
Master
Member # 5977
Profile Homepage #2
Okay, thanks Thuryl. I'll test it out. if "day" doesn't work, will "day2" or other variations work?

--------------------
Play and rate my scenarios:

Where the rivers meet
View my upcoming scenario: The Nephil Search: Escape.

Give us your drek!
Posts: 3029 | Registered: Saturday, June 18 2005 07:00
Infiltrator
Member # 5576
Profile Homepage #3
They should, but you might want avoid putting numbers at the beginning of variable names, because many systems, possibly including avernumscript, are confused by this.

I have never seen a reserved variable use error, I just discovered that my script was behaving oddly, so be careful and test thoroughly.

--------------------
Überraschung des Dosenöffners!
"On guard, you musty sofa!"
Posts: 627 | Registered: Monday, March 7 2005 08:00
Off With Their Heads
Member # 4045
Profile Homepage #4
Numbers at the end of variable names are fine, though, as in "day2" — I know because Jeff uses "r1" and "r2" at least a couple of times in his scenarios.

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Master
Member # 5977
Profile Homepage #5
Thanks to all of you. I tested it a couple of times, and it all seems to work fine. i hope I can release my scenario for betatesting in one or two months, if I continue working on it like now. every evening a bit.

[ Tuesday, December 20, 2005 10:19: Message edited by: Thralni, chicken god prophet ]

--------------------
Play and rate my scenarios:

Where the rivers meet
View my upcoming scenario: The Nephil Search: Escape.

Give us your drek!
Posts: 3029 | Registered: Saturday, June 18 2005 07:00
Shock Trooper
Member # 4557
Profile #6
quote:
Originally written by Niemand:


I have never seen a reserved variable use error, I just discovered that my script was behaving oddly, so be careful and test thoroughly.

If this is a serious problem, you should use a generic prefix for some variables.
Posts: 264 | Registered: Wednesday, June 16 2004 07:00
Master
Member # 5977
Profile Homepage #7
Hmmmm, it seems as though i'm doing something wrong. can anybody (Thuryl, Kelandon perhaps?) look at the script(s) please? I don't wan to post them here, as though i'm afraid somebody would steal my idea which i'm so proud of. I'll email the one who wants to help the two scripts that are the problem and explain what the problem is.

--------------------
Play and rate my scenarios:

Where the rivers meet
View my upcoming scenario: The Nephil Search: Escape.

Give us your drek!
Posts: 3029 | Registered: Saturday, June 18 2005 07:00
Off With Their Heads
Member # 4045
Profile Homepage #8
No one is going to steal your idea.

I'll look at your script.

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Master
Member # 5977
Profile Homepage #9
I sent you a privat message, i hope you don't mind if it were an email or privat message.

--------------------
Play and rate my scenarios:

Where the rivers meet
View my upcoming scenario: The Nephil Search: Escape.

Give us your drek!
Posts: 3029 | Registered: Saturday, June 18 2005 07:00