OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: aggressor35 on 24 Mar 2003, 19:01:05

Title: not(alive engineer)
Post by: aggressor35 on 24 Mar 2003, 19:01:05
i have this mission where i need the engineer (eng1) to stay alive for at least 7 minutes so he can deactivate a minefield, so a platoon of m1a1's can come to support our attack.  If the engineer dies before the 7 minutes are up the mission ends as a failure (end2).  After 7 minutes i dont want the mission to end if he dies cause he is of no importance then, just another soldier.

i have tried a couple different triggers with timeout and count down but they dont seem to work or maybe i am doing something wrong.

this  sounded simple at first to me by just using a timeout trigger set to 7 minutes (420,420,420).
type= switch
condition= not alive eng1
on activation= engdead

next trigger:

type= end2
condition= engdead




any ideas would let me finish my mission...briefings done, mission just waiting for this key ingredient. thanks for all help.
Title: Re:not(alive engineer)
Post by: macguba on 24 Mar 2003, 19:35:22
init.sqs
end_2Allowed=true

Trigger1
type:    End#2
condition:   End2allowed and (not alive eng1)

Trigger2
countdown:    420   420   420
condition:   true
on activation:    end_2Allowed=false


The first trigger you described in your post does indeed set engdead to true, but only 7 minutes after it happens, not 7 minutes after the start of the mission.

Edit:  OFP isn't always too good at counting time, so if the 7 minutes is really sensitive you may need to experiment a little to find out how many "OFP seconds" to put in the trigger's countdown field.
Title: Re:not(alive engineer)
Post by: aggressor35 on 25 Mar 2003, 01:44:12
one problem.....

I have never done an Init.sqs file.

i know that i have to use notepad.

two....

do i have to use the underscore _ ....in text or is it just a space ?

ex: end_2allowed = true
Title: Re:not(alive engineer)
Post by: mikeb on 25 Mar 2003, 01:52:36
open notepad and put the text in that macguba provided (Except for the "init.sqs" line at the top obviously).

Then save it as "init.sqs" NOT as a notepad file.  Then put this into your misson folder which is located in your OFP dictory under users\yourusername\missions....
Title: Re:not(alive engineer)
Post by: macguba on 25 Mar 2003, 01:58:11
If you want to see what an init.sqs looks like download the Tutorial Mission in the Ed Depot - Tutorials - Getting started.     Use the one in there as a template.

snYpir wrote an excellent tute on how to use objectives and init.sqs, which is also in getting started.

One of the secrets with all script files is to make sure the name is init.sqs and not init.sqs.txt, which can happen if you are not careful.

The underscore was meant to be an underscore, but it's just a variable - you can call it pretty much anything you like, it doesn't really matter.     You could write

endvariable=true
exit

and use endvariable in your trigger.    Btw it's good practice always to end a script with exit.

Have a look at the tutes.   Come back and ask if you get stuck.  :)
Title: Re:not(alive engineer)
Post by: aggressor35 on 26 Mar 2003, 19:42:59
ok...i have figured out how to do all that, thanks for the info.

now i just have to test my map and make sure it works, if it does i will mark this subject solved.

Title: Re:not(alive engineer)
Post by: aggressor35 on 27 Mar 2003, 07:55:42
ok..i have play tested  my map and it works great !!!

thank-you Macguba for all the help