OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: bakerboy1990 on 26 Mar 2009, 21:11:12

Title: How to end a mission
Post 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
Title: Re: How to end a mission
Post by: NightJay0044 on 27 Mar 2009, 00:01:42
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.

Quote
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:

Quote
soldier1dead=true

Now you may use that variable where you want in the game.

Next: To use with an objective:

Quote
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:

Quote
Trigger:
Condition: this
On activation: "3" objstatus "done"; objective3Done=true

next:

Quote
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.







Title: Re: How to end a mission
Post by: savedbygrace on 27 Mar 2009, 03:24:37
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.

Title: Re: How to end a mission
Post by: zwobot on 27 Mar 2009, 13:58:28
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...
Title: Re: How to end a mission
Post by: schuler on 27 Mar 2009, 14:44:52
zwobot thanks for bringing that up,,,,, i would like to know too!
Title: Re: How to end a mission
Post by: bakerboy1990 on 27 Mar 2009, 18:02:22
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 :)
Title: Re: How to end a mission
Post by: savedbygrace on 27 Mar 2009, 20:11:17
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?

Code: [Select]
(this) OR (enemycount <=2) Something like that in the condition field? That code is not exact but presses my point anyways.
Title: Re: How to end a mission
Post by: zwobot on 27 Mar 2009, 20:34:10
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:
Code: [Select]
(this) OR (count thislist <= 2)2nd Edit: yes it works like above, thanks again.