OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: SandVoss 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. :)
-
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.
-
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.
-
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.
-
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.