set condition to limit movement of scene prop (singleplayer)

Users who are viewing this thread

Hello everybody,
I need help with a triggers that I detail below:
I have a cannon that when firing, moves 5 points further back and to return it to its position I move it with the up arrow key and what I need is to set a limit of points that I can move it, so as not to move it too far forward.
this is the code that moves it when it shoots ... (this code goes inside another code that handles the cannon)
Code:
  (try_begin),
      (scene_prop_get_instance,":cannon_naval_instance1", "spr_sp_cannon_bote", 0),
      (prop_instance_get_position,pos1,":cannon_naval_instance1"),
      (position_move_y,pos1,-5),
      (prop_instance_animate_to_position,":cannon_naval_instance1",pos1,1),
  (try_end),
and this is the code to move it with the key ... thanks in advance.
Code:
  (try_begin),
      (key_is_down, key_up),
      (scene_prop_get_instance,":cannon_instance", "spr_sp_cannon_bote", 0),
      (prop_instance_get_position,pos1,":cannon_instance"),
      (position_move_y,pos1,2),
      (prop_instance_animate_to_position,":cannon_instance",pos1,25),
  (else_try),
 
Last edited by a moderator:
Would still be nice if you would tell us the solution :wink:
The instance trigger that moved the cannon backwards, I had it in mission_tempalte, I changed it to scene_prop, in the trigger of the cannon shot .... before everything worked fine, but the distance did not match, that's why it can be seen in my post a -5 and a 2 in the other trigger ... when moving it to scene_prop, I put 5 and in mission template -5 (in the trigger to press the key_up key),
I don't know if it is understood :razz:
 
Upvote 0
Back
Top Bottom