Some trouble with my terrain script.

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: Some trouble with my terrain script.
Shock Trooper
Member # 3276
Profile #0
It has no errors in syntax, it, just, does not do what I want it to.
First I have ben racking my brain how to get the Boom on EVERY Party member.
I know how to get lasers start place, my_loc, but what about getting them to the charecter.

But the main problem is when I step near the script, it fires at the party, damaging them, NONSTOP! I want it to fire every time the party moves.

And the disarm thingy does not work...
beginterrainscript;

variables;
short i_am_active = 1;
short i = 1;
short j = 1;
int choice;
body;

beginstate INIT_STATE;

set_script_mode(3);

if (get_memory_cell(2) > 0) {
set_mechanism_difficulty(get_memory_cell(2));
}

if (get_memory_cell(7) > 0) {
i = 1;
i = i + (get_memory_cell(7));
}
if (get_memory_cell(7) == 0) {
i = 1;
}
break;
beginstate 2;

if (dist_to_party() <= 3 && i_am_active == 1) {
if (get_memory_cell(0) > 0) {
if (get_memory_cell(0) == 1) {
damage_nearby(i,3,1,0);
put_boom_on_char(0,0,0);
run_animation_sound(62);
run_animation();
}
if (get_memory_cell(0) == 2) {
damage_nearby(i,3,4,0);
put_boom_on_char(0,0,0);
run_animation_sound(62);
run_animation();
}
if (get_memory_cell(0) == 3) {
damage_nearby(i,3,5,0);
put_boom_on_char(0,3,0);
run_animation_sound(62);
run_animation();
}
}
}
if (get_memory_cell(1) > 0)
if (get_memory_cell(1) == 1)
if (dist_to_party() == 1) {
reset_dialog();
add_dialog_str(0,"You have made your way to the laser mine controls and think you might be able to disarm the mine.",0);
add_dialog_str(1,"If you wish, you can attempt to disarm the mine (The player with the highest intelligence will do this.)",0);
add_dialog_choice(0,"Leave");
add_dialog_choice(1,"Attempt to disarm lasermine.");
choice = run_dialog(1);
} if (choice == 1) {
end();
block_entry(1);
}
if (choice == 2)
if (get_highest_skill(15) < get_mechanism_difficulty() && get_memory_cell(3) == 0 && choice == 2)|| has_special_item(get_memory_cell(3)) == FALSE && choice == 2 {
message_dialog("You fail to disarm the mine. Now it is going to be a pain getting away from it now that your so close.","");
block_entry(1);
}
if (get_highest_skill(15) > get_mechanism_difficulty() && choice == 2) {
message_dialog("You disarm the mine!","");
i_am_active = 0;//this turns off the above script that causes damage.
set_terrain(my_loc_x(),my_loc_y(),get_memory_cell(5));
}
break;

Posts: 249 | Registered: Saturday, July 26 2003 07:00
Warrior
Member # 4202
Profile Homepage #1
I don't know if this would fix it, but you could put "end();" just before the "break;" at the end. It seems creature scripts will sometimes repeat until they are stopped, anyway.

I had another thought. Are you using terrain messages? If a terrain script has a message, it will happen again at the end of the turn. If somehow it got another message, it might repeat itself again and again. This idea seems rather unlikely, though...

--------------------
Creator of the 3D Blades of Avernum Editor for Mac. Get it at Ingenious Isaac's Illusion, my web page. Better yet, get Battle for Wesnoth, a wonderful free TBS game.
Posts: 192 | Registered: Sunday, April 4 2004 08:00
Shock Trooper
Member # 3276
Profile #2
I got it! I need to configure something that gets the tick difference between once the trap fires to how many spaces the party moves before firing again! But, how??

get_tick_difference(get_something,get_somethingelse.
Maybe now you people can really help me, im going to need it.
Posts: 249 | Registered: Saturday, July 26 2003 07:00