Home   Help Search Login Register  

Author Topic: OBJECT IN RANDOM PLACES  (Read 672 times)

0 Members and 1 Guest are viewing this topic.

Cooba

  • Guest
OBJECT IN RANDOM PLACES
« on: 11 Mar 2003, 14:08:03 »
The player is to find and than destory the tank. In order to find it, he or she must collect information about it's coordinates firstly. What shall I do the following thing: I would like the tank to be placed at the start of the mission at three random places. And how should I do to make it possible so received information (f.e. via radio) shall pinpoint the coordinates of that randomly placed tank?

THX for HELP
Best Regards!

CrashnBurn

  • Guest
Re:OBJECT IN RANDOM PLACES
« Reply #1 on: 11 Mar 2003, 21:42:12 »
To make the tank start at 3 random positions, place 2 "empty" type markers in the editor at locations where you want the tank to appear. Place the tank at the third location. Switch to group mode and drag a line from the tank to each of the 2 markers. It gets a little tricky because when you go to group mode in the editor the markers disappear from view so you just have to remember where you placed them. Once the markers are grouped to the tank, the tank will start at one of the 2 marker spots or where you placed the tank in the editor, giving you 3 possible locations.


Offline nEO iNC

  • Contributing Member
  • **
Re:OBJECT IN RANDOM PLACES
« Reply #2 on: 19 May 2003, 14:05:34 »
Not tried that one C&B...

I'd use three game logics, (the markers) three triggers and one tank...  :) Oh and the following in the init.sqs :

randtank = random 3

Place the three game logics where you want 'em, then create three triggers with the following in the condition and OnAct fields...

Trigger1
Cond: randtank >= 0 and randtank < 1;
OnAct: tank setpos (getpos name of first game logic)

Trigger2
Cond: randtank >= 1 and randtank < 2;
OnAct: tank setpos (getPos name of second game logic)

Trigger3
Cond: randtank >= 2 and randtank <= 3;
OnAct: tank setpos (getPos name of third game logic)

Might seem overkill, but it works like a charm...  :)

Will try out your suggestion C&B

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:OBJECT IN RANDOM PLACES
« Reply #3 on: 19 May 2003, 19:54:20 »
I use CrashnBurn's way, which I discovered in an official mission.   It works beautifully.

nEO iNC's way works as well of course, though you don't actually need 3 triggers - you could do it all in the init.sqs

For the received information part you might need to know about the commands format and getpos.   Look them up in the online command reference if you are not familiar with them.
« Last Edit: 19 May 2003, 19:56:00 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline nEO iNC

  • Contributing Member
  • **
Re:OBJECT IN RANDOM PLACES
« Reply #4 on: 20 May 2003, 09:37:18 »
Hey macguba, hadn't thought about doing it like that... Seems obvious now you mention it... Guess I've used triggers 'coz you can alter them in the editor rather than switching back to d/top... Though it is one of those things you set up and leave... Cheers...  :)

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:OBJECT IN RANDOM PLACES
« Reply #5 on: 20 May 2003, 13:07:22 »
@nEOiNC

Even if you would like to avoid alt+tabb'ing you could
do this with only one trigger:

onActivation: marker_array = ["marker_1","marker_2","marker_3"]; randtank = random count marker_array; randtank = randtank - (randtank mod 1);
tank setpos (getpos marker_array select randtank)

However i wouldn't do it that way, as dragging a line to group
objects with the marker itself was and will always be the easier
solution to do so, but i just thought to give you an idea of
how to make a one-liner out of your method.

~S~ CD



Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:OBJECT IN RANDOM PLACES
« Reply #6 on: 21 May 2003, 02:02:42 »
Since you are going to have the tank in 3 places you know, you could just write down those 3 coords in a similar fashion CD did. In that same on act. line if that's what you wish to use:
Quote
marker_array = ["marker_1","marker_2","marker_3"]; randtank = random count marker_array; randtank = randtank - (randtank mod 1);
tank setpos (getpos marker_array select randtank)
coord_array = ["ee44","ff55","gg66"]; tank_coords = coord_array select randtank
note that the coords have to be equal to the coords the markers are at. Then when you want to pull up that info you use the format command:
yourCO sideChat format ["I want you to demolish this tank at %1",tank_coord]

If you want more flexibility, you can replace the marker names in CDs snippet with coordinates. Then you'd need to forget about coord_array and use any of the coord-to-letter-coord scripts in the ed depot to find out where it is.
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

Cooba

  • Guest
Re:OBJECT IN RANDOM PLACES
« Reply #7 on: 26 May 2003, 09:09:10 »
THX YOU ALL !  :)