Home   Help Search Login Register  

Author Topic: Randomly marker creation in one of 3 predefined areas - (SOLVED)  (Read 1097 times)

0 Members and 1 Guest are viewing this topic.

Offline Aplion

  • Members
  • *
Can anyone help me on that ?
I need when a man of my team get in a trigger area, then one marker be randomly appeared (visible on the map) in one of 3 predefined areas as the next objective.
Is it possible and how ?

Any help will be much appreciated.

Aplion
« Last Edit: 09 Aug 2008, 21:08:35 by Aplion »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Randomly marker creation in one of 3 predefined areas
« Reply #1 on: 09 Aug 2008, 10:34:59 »
Well, I'll give you the easy way:
* SP or COOP only, since all players will see the marker when it appears.
* Will not show the marker to anyone who joins the game after the second objective is revealed. However, they will still get the trigger placed in the right position.

You already have a trigger set up for objective one, which is the one you want to reveal objective two. Add the following trigger code to it:
Code: (Objective 1 trigger On Act) [Select]
if (isServer) then { "objective2" setMarkerPos (getPos ([ob2a, ob2b, ob2c] select (floor (random 3)))); "objective2" setMarkerType "Attack"; objective2Trigger setPos (getMarkerPos "objective2"); };

Create a new trigger for the second objective and place it far out to sea, so the players can't get to it before it is revealed. Name it "objective2Trigger". Set this up as you normally would, other than its initial position.

Create a marker called "objective2" which is of type "Empty" (There are actually two markers called "Empty", for reasons best known to BIS. Choose the one that is a square with two chevrons, rather than the one that is a circle). This will not initially be visible in the mission.

Add 3 gamelogics, one each at the possible location of the second objective (named ob2a, ob2b and ob2c).

EDIT: added method for moving the second objective trigger as well as making the marker appear in the right place.
« Last Edit: 09 Aug 2008, 11:00:23 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Aplion

  • Members
  • *
Re: Randomly marker creation in one of 3 predefined areas
« Reply #2 on: 09 Aug 2008, 21:08:02 »
Spooner .... much obliged man !! this works fine.

Thank you very much ...

Aplion