OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: bakerboy1990 on 26 Mar 2009, 21:11:12
-
hi i am brand new to mission editing so i dont know to much, basically i am wondering how do i finish a mission? the only way i know is "this and not canmove [name]" this only works when the soldier or vehicle etc is destroyed/killed then the mission finishes, i want to know how to end a mission after going through the objectives and killing every1 in the area like a city etc, many thanks for any future posts and help
-
Hi, in order to end a mission after all your obejctives are finished and or everyone in a city.
It's quite simple. I'll introduce you to a little powerful thing called a "Variable".
A varialbe is just a reference from something else in the game. An example.
Trigger:
Condition: not (alive soldier1)
On Activation: soldier1dead=true
In that trigger you have created, after soldier one is dead, a variable will be true called "soldier1dead"
The code line in the on activation field:
soldier1dead=true
Now you may use that variable where you want in the game.
Next: To use with an objective:
Trigger:
Condition: This (or whichever condition)
On Activation: "1" objstatus "done"; objective1=true
See what that does is it creates a variable called "objective1" after objective 1 is complete.
Lets sa you want to end a mission after objective 3 is complete.
Create trigger:
Trigger:
Condition: this
On activation: "3" objstatus "done"; objective3Done=true
next:
Trigger:
Type: End1
Condition: Objective3Done
On Activation: put anything you want here if applicable
See what that does is once the first trigger is activated it creates the variable name "objective3Done"
So there is brief tutorial on how variables work, if you need any further help feel free to PM me or reply in this topic.
Now we used that variable name in the "condition field of the next trigger.
-
In addition to the variables, the endmissions are accesible in the type field of the trigger feature. Scroll down to where they say end1, end2 or whatever.
So you could place a trigger with a radius large enough to cover the entire map. And have it detect when East is not present. Once all East units are dead, the mission will instantly go to the debrief screen.
To prevent it from going instantly to the debrief screen you can tinker with the time delay feature or implement the variable method above.
-
This brings up a question for me too:
Has anyone made a seized by trigger (script) for Ofp like there is in Armed Assault? I want to prevent the search for the last enemy bugger hiding in some bush or wall in a not present trigger...
-
zwobot thanks for bringing that up,,,,, i would like to know too!
-
wow thanks for all the helpfull info every1, now i can finally make the mission i want, will probaly be back for more questions though :)
-
By "seized by" do you mean that one trigger which detects if east is present and when it is down to one or two fellows, the trigger ticks anyways?
Could this not be done with the OR statement?
(this) OR (enemycount <=2) Something like that in the condition field? That code is not exact but presses my point anyways.
-
I'll try that savedbygrace, thanks for now.
Edit: I've just noticed that enemycount is not a valid scripting command. Shoulnd't it be:
(this) OR (count thislist <= 2)2nd Edit: yes it works like above, thanks again.