Jump to content
Sign in to follow this  
Guest DKM-jaguar

A quick solution to end a mission

Recommended Posts

Guest DKM-jaguar

Hello, this is a problem i came up against while making the MI-28 missions.

I have a friendly base the player needs to protect, the enemy armour is moving toward the base. If the armour reaches the base, it sets off a trigger with a loose setting. But now i need to know the things i need to do to set out conditions that are met to complete the mission.

If the player destroys all the armour, how do i make that the trigger for the ending? Is there a qucik way of doing it? So far all i have seen is some vauge (and helpless) things about naming each unit that needs to be killed. I have three platoons of tanks and four helicopters so it's going to be a loooong time to do it that way.

If someone can tell me any way, what so ever (even the long way will do at this point) I will be very happy, and so will you when you get the MI-28 mission pack. smile_o.gif

Share this post


Link to post
Share on other sites

Make a trigger that covers the whole map, group the trigger with the leader of one of the armour groups. Now set the trigger to activate when all of the units in the group are not present. Do this for all your armour groups.

RED

Share this post


Link to post
Share on other sites
Guest DKM-jaguar

Thanks alot. This is a big help smile_o.gif

Share this post


Link to post
Share on other sites
Guest DKM-jaguar

Hmm, i have a small problem. The triggers need to be set so that when all the armour is gone, the mission ends (using trigger type end#1) BUT for the above method, i can only set the mission to end when one armoured group of the three is destroyed, meaning the player only need engage all the M1's and leave the M60s and the mission is completed. How can i set it so that the mission only ends when every group is destroyed?

thankyou for your patience.

Share this post


Link to post
Share on other sites

Try this;

Put these flags in your init.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">tanks1=false

tanks2=false

Then, in your win trigger, put in the Condition field:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">tanks1 AND tanks2

(It doesn't have to be "tanks1", etc, this is just an example, you can call these flags whatever you want)

Call the M1s things like 'tank1', 'tank2', etc (this will help immensley). Make a trigger that is big enough to cover the area the M1s will be engaged in (it doesn't matter if another group is in it).

Then, in the Condition of the M1s trigger, type:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">NOT (alive tank1) AND NOT (alive tank2)

adding in any more enemy tanks there as necessary.

And in the On Activation field of the M1 trigger, type:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">tanks1=true

this will activate the first flag in your init.sqs.

Then do the same for the M60s.

Once flag 1 and flag 2 (tanks1 and tanks2) have been activated (true), then the win trigger will activate. The mission will end only if both flags have been activated.

I hope this helps. If you are confused by any of this, tell me. I could probably send you an example mission to help you, if you think it would help (the mission might take some time to complete, though).

Later!

[Gareth Gates must die]

Share this post


Link to post
Share on other sites
Guest DKM-jaguar

I think i get it.... but i am a little confused (with where to write the certain things).

This is what i have: 3 tank platoons. 1x m1, 2x m60. I want the mission to end when all platoons are dead. I have done the method using "not present" in triggers, but you can only set this for one trigger, meaning the player can get away with shooting 1/3 platoons and the mission is "won".

I can see another way, using the above but not setting it as an ending trigger, so that when all tanks in a platoon are dead, the trigger sets off another trigger, being of the same type, only this one IS an ending trigger, which can not be activiated unless the first trigger is completed (by killing all tanks assoiated with said trigger). Even if the platoon linked to the ending trigger is killed, the trigger is still not activated becuase the first one isnt. So, no matter which platoon is killed, it is not over until all units are dead. This is a nice theory, but i will need to find out how to set off a trigger using another trigger. (that is in mission making FAQ, an excelent topic. My thanks to it's creaters.)

Also..need to know how to create a description.ext for breifings. There is probably a topic for that as well. Anyway, if what i said works, i'll do that. If it doesnt, then can you send me an example mission please smile_o.gif

If another person could try out my method, as well as i am doing, it will help tounge_o.gif

Share this post


Link to post
Share on other sites

I think there are several ways of doing this, if the flags aren't working for you. Here is one

EG

Name each tank in the group (ie, t1, t2, t3 and t4)

Now create a trigger.

in the "Conditions" box put :

!alive t1 && !alive t2 && !alive t3 && !alive t4

now in the "On activation" box put

v1=1

Now repeat this step for the next group, naming the tanks differently and changing the tank names in the trigger to match, and changing v1 to v2.

Do this for every unit you want to be killed before the game will end.

Now create another trigger (assuming you made 3 triggers in the previsou step, v1 v2 and v3)

In the "Conditions" box put:

v1==1 && v2==1 && v3==1

Now in the "type" box select

end #1

The 3 initial triggers set the values of V1, v2 and v3 to 1 one all the units listed are destroyed.

The 4 trigger looks to see when v1, v2 aned v3 are equal to 1, meaning all units have been destroyed, then end sthe game.

The thing to watch out for with this that if you hit the tank with enough damage to make the crew bail out.. it is not necessarily destroyed.

Share this post


Link to post
Share on other sites

So how about doing it with a script as below. First name the tanks t1, t2 ... tn. Then add line [] exec "targets.sqs" to init.sqs file run the script. Then make an end trigger with condition varend==1 to end the mission. This way you need one trigger and one script to accomlish the task. Also you need to name the units.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

"targets.sqs"

_targets=[t1,t2,t3,t4,t5,t6,t7,t8,t9....]

#loop

~5

_raah=0

"if (alive _x) then {_raah = _raah+1}" foreach units _targets

? _raah != 0 :goto "loop"

varend=1

exit  

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×