Home   Help Search Login Register  

Author Topic: Random group placement  (Read 670 times)

0 Members and 1 Guest are viewing this topic.

SandVoss

  • Guest
Random group placement
« on: 26 Jun 2005, 15:51:08 »
Hi,

I was wondering if it is possible to make a whole group of units, both infantry and objects, to be set to random, ie. the possibility of being them there at the beginning of the mission.

The idea is that i want to make a mission in which the players have to get a convoy consisting of a number of vehicles from A to B. To increase the replayability of the mission, i want to make the roadblocks along the way set to random,  so that you dont know in advance if there will be a roadblock. Simply setting the induvidual units to random wont work, because you will end up with only partial roadblocks, etc. I want the whole roadblock to either be there, on not to be there.

Is it possible to cluster a number of units into a group with the same level of randomness?

Thanks in advance for answers.  :)

Dane

  • Guest
Re:Random group placement
« Reply #1 on: 26 Jun 2005, 16:44:24 »
One way would be to Place a group leader and make his condition of presence random, and then write in a triggers condition field: alive groupleader, and in triggers activation field: [] exec "spawn rest of group.sqs"

Edit. And the "spawn rest of group.sqs" is ofcourse a script that spawns the rest of the group and the objects you want.

Edit again. You can also place the whole group and objects and write in theyre condition of presence fields: alive groupleader.
This way you don't need scripts.
« Last Edit: 26 Jun 2005, 20:02:43 by Dane »

Offline nigel

  • Members
  • *
  • I'm a llama!
Re:Random group placement
« Reply #2 on: 26 Jun 2005, 20:17:47 »
Heya SandVoss,

I've done this with a mission (minus the objects.. but that shouldn't be much different than placing units randomly)

Basically, I covered a town with about 30 small markers, mainly on streets and a few more open areas.  Then I would have a script randomly choose a marker, and it would move group A there, then it would run again, placing group B, etc, etc... If you want a little more randomness, you could getmarkerpos, and add a random radius of say 200m... I also used this to place their waypoints... worst part about making a public map is 'knowing' what's gonna happen, and when.  This kinda solved it for me.

If you want a copy of my map, I'll shoot one over to you with an explaination of which scripts do what.

Nigel.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Random group placement
« Reply #3 on: 26 Jun 2005, 22:17:15 »
Simple enough. First, place a single unit or object down for your first roadblock. Change it's 'probability of presence' slider to whatever you want. Name the unit/object something like "RB1".

Next, place the rest of your units/objects down for that roadblock. In each of their "condition of presence" fields, write:

alive RB1

When you run the mission, OFP will first randomly decide whether or not to place RB1. If it doesn't place it, then it won't place the rest of the units/objects either.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

SandVoss

  • Guest
Re:Random group placement
« Reply #4 on: 27 Jun 2005, 07:34:58 »
Thanks for all the great answers!

Nigel, thanks for the offer, but i have found the answer. :)

General Barron, thats exactly the trick i needed, it works.