Jump to content
Sign in to follow this  
Obscure CIA_Agent

Ending the mission!

Recommended Posts

Ok so I need to know how to make this trigger work right.

The trigger is an End#2 with the condition of:

not (alive westsoldier1) and not (alive westsoldier2) and not (alive westsoldier3) and not (alive westsoldier4) and not (alive westsoldier5)

If you start the mission with all AI present the trigger works fine.

But when you disable even 1 AI the trigger will not work. Even if the whole West team is dead.

What gives?

Thanks,

CIA crazy_o.gif

Share this post


Link to post
Share on other sites

Put "WSOLS = [ws1,ws2,ws3,...]" into the mission init.sqs (ws1 - 3 are the soldiers).

Make some trigger and put "({Alive _x}Count WSOLS) == 0" into its condition. The triger will activate when all the soldiers are dead or doesn't exist at all.

Share this post


Link to post
Share on other sites

What do you mean by :

Quote[/b] ]But when you disable even 1 AI

Do you mean disableAI command or anything else ?

Share this post


Link to post
Share on other sites

Use count units westgroupname instead.

Quote[/b] ]count array

Operand types:

array: Array

Type of returned value:

Number

Description:

number of elements in array

Example:

count [0,0,1,2] , result is 4

Quote[/b] ]units unit

Operand types:

unit: Object

Type of returned value:

Array

Description:

Arrays of all units in the group of given object. For dead object empty array is returned.

Example:

player in units player

Share this post


Link to post
Share on other sites

If you can't find a better way, this definetly works. Even if there not in the same group:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{!(Alive _x)} Count [ws1,ws2,ws3]=="Man" CountType [ws1,ws2,ws3]

Share this post


Link to post
Share on other sites

mad_o.gif

OK. Nothing anyone has told me works.

I either get a "Unknown Operator" or "invalid number in expression" or some other wack error.

It shouldn't be this hard. I want to beable to disable AI and still have the mission end when everyone dies. Let me explain this in different words...

I have a mission with 5 WEST soldiers named "westsoldier1, westsoldier2, westsoldier3, westsoldier4, and westsoldier5" --- Now if you start the mission with AI present. (So its you as the leader and 4 AI soldiers) The trigger "not (alive westsoldier1) and not (alive westsoldier2) and not (alive westsoldier3) and not (alive westsoldier4) and not (alive westsoldier5)" works fine.

And END#2 will work when they all die...

BUT if you DISABLE AI before you start the mission (So its you alone, or like you and one other guy) The END#2 trigger wont work.

The game thinks the DISABLED AI are there or something.

None of your lines of code work. Please would someone give me the right code?

This is the last trigger I need to get working, then my mission is complete.

Thanks,

CIA help.gif

Share this post


Link to post
Share on other sites

Ok, if you just count the units from a group it doesn't work because dead units are not removed from the group instantly when they die.

This definately works, I just tried it in the editor:

1. In every westsoldier's init line have: westgrp=group this

2. In trigger condition have: ({alive _x} count units westgrp) < 1

Share this post


Link to post
Share on other sites

banghead.gifbanghead.gifbanghead.gifsad_o.gif

I do not understand.

I am making this mission in version 1.46. I copy and paste that exact code and it does NOT work.

({alive _x} count units westgrp) < 1

Unknown Operator or invalid number in expression.

Does not work with or without "this" in front of it.

What in the good Lord's name is going on here.

help.gif

maybe i shoulda joined the fbi...

Share this post


Link to post
Share on other sites
I am making this mission in version 1.46.

whoopsie, that might be the problem. You should tell us that in advance.

I think most of the people here do have the Resistance, and mostly the 1.96 version.

Maybe we all are suggesting something which doesn't work in the old version.

I cannot test it right now, but later i'll try the solution in the 1.46

Share this post


Link to post
Share on other sites

Consider that using the 'any' _x statement isn't possible in 1.46 but was added later with Resistance.

I was looking through some games in a local store and they had several copies of OFP bestseller edition for 15 euros. Time you got one too? smile_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]What in the good Lord's name is going on here.

This is going on:

Quote[/b] ]I am making this mission in version 1.46.

biggrin_o.gif no wonder nothing works. Get resistance for christ's sakes, the goty bestsellers costs like 5-15 euros and it has opf+resistance+red hammer. Resistance expansion has updated engine and more scripting commands and stuff.

Share this post


Link to post
Share on other sites

the only thing that pops up is this. Read Closely.

Create a trigger with the following settings: Activation: West, Condition: Not present..

After that simply make the trigger cover the battle zone.

I hope it helps you. whistle.gif

Share this post


Link to post
Share on other sites
rofl.gifbiggrin_o.gifhuh.gifmad_o.gif

Does anyone know the old school code? It's gotta be somewhat the same. PLEASE HELP ME!

Group the soldiers by typing this in their init box:

soldiers = group this

Make a trigger that counts the soldiers, try:

Condition: west countside (units soldiers) < 0

type: end#2

On activation: forceend

Im not sure if this works in 1.46, give it a try confused_o.gif . Your initial problem was you using all soldiers being dead has a condition for end#2 to trigger but if the soldiers are not present in the mission (i.e. disabled in the mp selection screen) the trigger will obviously never work because the soldiers dont exist in your mission.

If the above doesnt work!

Just put a trigger that covers the whole island, press F2 and draw a line betwean the group leader and the trigger, you will now have more options in the activation area of such trigger, select "whole group" not present, type: end#2, on activation: forceend.

I believe most of your questions can be found in the forum by using the search feature, you can also find many information @ofpec, if you expect to get more assistance in the future try to be more patient and polite, otherwise someone might spank you smile_o.gif .

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  

×