OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: fleepee on 09 Mar 2009, 11:41:54
-
I'm making an MP mission in wich one of the objectives is to destroy ammo crates...
I wish I could put a variable in briefing/debriefing indicating the number (or percentage) of crates destroyed...
Does anybody knows if it'spossible and the syntax for it? ???
Thanks!
-
Its not possible as far as I know...unless you build your own briefing /debriefing dialog.
-
No variable can be defined in the Briefing but what you are asking is a pretty simple task to do if you create a trigger that contains all the creates you are using.
1) group a trigger with a ammo box
2) in the trigger condition field put:
numCrates = 0; { numCrates = numCrates + ({ alive _x } count) } forEach thisList; (numCrates <= *insert number of crates destroyed*) and (time > 5)
3) Activation field put what ever you want:
"3" objStatus "DONE";
Hopefully it works because this is the kind of trigger I use to determine if to many civilians have died then mission ends.
-
How many ammo crates are you talking about? If it's relatively few, you could use objStatus (http://www.ofpec.com/COMREF/index.php?action=details&id=234) to hide / reveal pre-written lines.
(NB. I'm writing this as though it were for OFP - I hope it works the same for ArmA)
1. Edit the briefing.html<p><a name="OBJ_10"></a>
Destroy as many ammo crates as possible.
</p><hr>
<p><a name="OBJ_11"></a>
Destroy as many ammo crates as possible. 10% destroyed.
</p><hr>
<p><a name="OBJ_12"></a>
Destroy as many ammo crates as possible. 20% destroyed.
</p><hr>
... etc.
2. In init.sqs put all the crates in an array and hide the unnecessary objectives:CrateList = [crate1, crate2, ... etc. ]
"11" objStatus "HIDDEN"
"12" objStatus "HIDDEN"
... etc.
3. Create an equal amount of triggers (triggered Once) to crates, and name them: oneCrate, twoCrates, etc. For oneCrate:
condition: ({!alive _x} count CrateList == 1)
Activation: "10" objStatus "Hidden"; "11" objStatus "Active"; deleteVehicle oneCrate
then for twoCrates,
condition: ({!alive _x} count CrateList == 2)
Activation: "10" objStatus "Hidden"; "11" objStatus "Hidden"; "12" objStatus "Active"; deleteVehicle twoCrates
and so on.
Obvious, stage 3 could be replaced by a script if you prefer.
-
Thanks everybody!
That's good ideas! :good:
(and I only have 10 crates...)