Watch your back? M&B 1.011

Users who are viewing this thread

N0ught

Sergeant Knight at Arms
Basically I need a mission template trigger that will frequently check to see if an enemy is in your rear quadrant, and within a certain distance, and pop up a message as a warning, if so. It shouldn't be too difficult, but I would like code examples, if anyone can help. I am a little confused as to how to do the check itself...

Any help is much appreciated! :grin:
 
As you should. It's gonna be wild this time around. :twisted:

Basically this is going to be linked to a helmet, and I am unsure how to check within only a certain degree wedge of the player character (namely their rear quadrant).

Going to have some fun sounds added to it, but for now a display_message command will work.

EDIT: Maybe this code can be altered? It is the code for checking to see in enemies are within 15 meters, when you press tab in battle...

Code:
(get_player_agent_no, ":player_agent"),
      (agent_is_alive, ":player_agent"),
      (agent_get_position, pos1, ":player_agent"),
      (assign, ":result", 0),
      (set_fixed_point_multiplier, 100),
      (try_for_agents,":cur_agent"),
        (neq, ":cur_agent", ":player_agent"),
        (agent_is_alive, ":cur_agent"),
        (agent_is_human, ":cur_agent"),
        (neg|agent_is_ally, ":cur_agent"),
        (agent_get_position, pos2, ":cur_agent"),
        (get_distance_between_positions, ":cur_distance", pos1, pos2),
        (le, ":cur_distance", 1500), #15 meters
        (assign, ":result", 1),
      (try_end),
      (eq, ":result", 0),

But how to alter it to check the 90 degree wedge directly behind the player? :???:

EDIT2: If the 0/360 degree mark is dead ahead of the character, then it would be between 135 and 225 degree marks.
 
Back
Top Bottom