Jump to content

STEP_INTO_SPOT_STATE


Recommended Posts

This state is called when your party member walks to space, not when they physically land on a space. I'm trying to inflict a status effect on the specific party member who lands on the space, but the char_on_loc call wont work because the state is called BEFORE the character is actually on the space the terrain script is placed. How annoying.

 

Here's the script, can anyone think of something I am doing wrong?

 

Code:
 beginstate STEP_INTO_SPOT_STATE;	guy = char_on_loc(my_loc_x,my_loc_y);	play_sound(-17);	if(is_combat == TRUE)		set_char_status(guy,6,1,0,1);		else			set_char_status(1000,6,1,0,1);break; 
Link to comment
Share on other sites

I actually have a similar script. If you want the person to be on the space when it occurs, use the START_STATE. Of course, you have to reset the script so it runs every turn the party is near. Use my script as an example.

 

Code:
// thermalvent.txt// by Nioca// This terrain script will cause major fire damage to anyone who steps on it.// Memory Cells - //   0 - Severity. Defaults to 10.//   1,2 - SDF to deactivate. If the value for both cells is 0, ignored. Otherwise, once this cell//     is set to anything other than 0, the vent deactivates.beginterrainscript;variables;short severity = 10;short turn; // This timer makes sure the effects only run once every turn.body;beginstate INIT_STATE;	if ((get_flag(get_memory_cell(1),get_memory_cell(2)) > 0) && (get_memory_cell(1) + get_memory_cell(2) > 0))		end();		if (get_memory_cell(0) > 0)		severity = get_memory_cell(0);	turn = get_current_tick(); // Set the timer.		set_script_mode(2); // Run every turn unless the party is far away.break;beginstate START_STATE;	if (turn == get_current_tick())		end();		if ((get_flag(get_memory_cell(1),get_memory_cell(2)) > 0) && (get_memory_cell(1) + get_memory_cell(2) > 0))		end();		if (char_on_me() != -1) {		put_effect_on_space(my_loc_x(),my_loc_y(),1,5,1);		run_animation_sound(167);		damage_char(char_on_me(),get_ran(severity,5,30),1); }	turn = get_current_tick();break;beginstate STEP_INTO_SPOT_STATE;	if ((get_flag(get_memory_cell(1),get_memory_cell(2)) > 0) && (get_memory_cell(1) + get_memory_cell(2) > 0))		end();		put_effect_on_space(my_loc_x(),my_loc_y(),1,5,1);	run_animation_sound(167);	damage_char(char_who_activated_script(),get_ran(severity,5,30),1);	turn = get_current_tick();break;
Note the STEP_INTO_SPOT_STATE is still present. This catches the party if they're in combat mode every time they step on it. Otherwise, it'd only run once even if it was stepped on several times in combat.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...