State not ended properley on line 1, yet...

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: State not ended properley on line 1, yet...
Shock Trooper
Member # 3276
Profile #0
...the problem didnt come until I added this part to the END of the dialoulge!
begintalknode 31;//All resaeehecers
state = 17;
nextstate = -1;
question = "Teddy";
text1 = "This scientist looks at you._Go away!_";
text2 = "This scientist looks at you._Leave!_";
text3 = "This scientist looks at you._Just Be Gone!_";
text4 = "This scientist looks at you._They dont live here their next DOOR!_";
text5 = "This scientist looks at you._Go away, or suffer!_";
text6 = "This scientist looks at you._GO AWAY!_";
code =
clear_strings();
if (get_ran(1,1,6) == 1) {
add_string(1);
} else if (get_ran(1,1,6) == 2) {
add_string(2);
} else if (get_ran(1,1,6) == 3) {
add_string(3);
} else if (get_ran(1,1,6) == 4) {
add_string(4);
} else if (get_ran(1,1,6) == 5) {
add_string(5);
} else if (get_ran(1,1,6) == 6) {
add_string(6);
} else {
print_str_color("The game screwed up and",2);
print_str_color("returned a wrong number.",2);
}
break;
action = END_TALK;
Line 1 was not incorrectly ended until I put in this code. I need help. :(
Posts: 249 | Registered: Saturday, July 26 2003 07:00
Shock Trooper
Member # 4180
Profile #1
Don't know if this is the problem, but you're getting a NEW random number for each check, and it's probable that none of them would succeed.

What you want to do is:

foo = get_ran(1, 1, 6);

if (foo == 1) {
...
} else if (foo == 2) {
...etc.


--------------------
-spyderbytes
Posts: 200 | Registered: Wednesday, March 31 2004 08:00
Shock Trooper
Member # 4557
Profile #2
i think u have to put the action = part before the code block. Also u have to do what spyderbytes said or most of the time the else block will be activated.
Posts: 264 | Registered: Wednesday, June 16 2004 07:00
Shock Trooper
Member # 3276
Profile #3
Okay, I set a variable to be the ran, so its something like
get_ran blah blah = variable
if variable equals this print string 1
if variable equals this blah,

well I fixed it, thanks spiderbytes.
Posts: 249 | Registered: Saturday, July 26 2003 07:00
Shock Trooper
Member # 4445
Profile #4
text4 = "This scientist looks at you._They dont live here their next DOOR!_";

They don't live here; they're next door

their - they're

Just to save your beta testers the annoyance, should you finish.
Posts: 293 | Registered: Saturday, May 29 2004 07:00