TIP: Static user input (a hack, but it works)

Error message

  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /var/www/pied-piper.ermarian.net/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /var/www/pied-piper.ermarian.net/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /var/www/pied-piper.ermarian.net/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /var/www/pied-piper.ermarian.net/includes/common.inc).
  • 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: TIP: Static user input (a hack, but it works)
Apprentice
Member # 3517
Profile #0
I am using this script in a special town I constructed for debugging purposes. I wanted to be able to teleport into any town in the scenario without traipsing all over the outdoors. This state is triggered by a special encounter area on the floor in front of a portal. Obviously, any number of responses can be checked. Seems to work fine!

beginstate 10;

get_text_response("Enter town number:");

check_text_response_match("28");
if (got_text_match() == 1) {
print_str("Your party is teleported to the Haverly Estate...");
block_entry(1);
move_to_new_town(28,26,6);
end();
}
check_text_response_match("36");
if (got_text_match() == 1) {
print_str("Your party is teleported to the Operations Center...");
block_entry(1);
move_to_new_town(36,26,6);
end();
}
break;

The key to this is the end() statement, working just like a C break statement.

regards,

mrb
Posts: 40 | Registered: Sunday, October 5 2003 07:00
Infiltrator
Member # 154
Profile #1
A function to get an integer entered and put it in a variable would be very nice.

Meanwhile, yeah, that's effective. A better idea might be to make it a usable item though.

--------------------
Apparently still annoying.
Posts: 612 | Registered: Saturday, October 13 2001 07:00