Jump to content
Sign in to follow this  
Phantom Six

BLUFOR Kill Civilians = Mission Failed (Help)

Recommended Posts

I'm trying to add some parameters to my mission that make it fail if you kill too much civilians. I've been lurking the forums for some ways to do it, but its a no go for me.

So far on each civilian that must not be killed I put this in their initline

this addeventhandler ["killed",{switch (side (_this select 1)) do {case west: {civs_killed_by_west = civs_killed_by_west + 1};};}];

On my init.sqf I have

civs_killed_by_west = 0;

Three triggers:

Condition:

((paramsArray select 18) == 0) && civs_killed_by_west > 5;

On Act:

forceEnd;

Condition:

((paramsArray select 18) == 1) && civs_killed_by_west > 3;

On Act:

forceEnd;

Condition:

((paramsArray select 18) == 2) && civs_killed_by_west > 1;

On Act:

forceEnd;

Does anyone know the solution to my problem? Thanks.

Share this post


Link to post
Share on other sites

Here is a video I first made, its very to the point and might be somewhat what you are looking for. Hope it helps.

KeA-2th78Ss

Share this post


Link to post
Share on other sites

Ehhh, that wasn't my question. The text that I put from the effects setting are suppose to appear first that say I killed too many civilians, then after 10 seconds it force ends because of too many civilian casualties. I want to know the addeventhandler script for too many civilian casualties, not forced end. I already have many experiences with forceEnd without problems. I got the commands from warmingo (post #5) on this thread http://forums.bistudio.com/showthread.php?102957-Civilian-Casualties-Counter but I removed the East part of it and only left the West part. For some reason, nothing is happening with that.

Edited by Phantom Six

Share this post


Link to post
Share on other sites

Try this man....

this addEventHandler ["killed", "if (side (_this select 1) == WEST) then {civs_killed_by_west = civs_killed_by_west + 1}"];

Share this post


Link to post
Share on other sites

It's been answered there too.

I successfully used Shuko's script in an adversarial mission (hosted on a dedicated server) with no problems. Plus it's compatible with Alice, so you don't need to preplace your civilians and add something in their init line.

Another way is to use UPSMON, that comes with a civilian death counter, if you want to stick with editor-placed units.

Share this post


Link to post
Share on other sites

On second thought.... I might as well just ditch the whole idea.... its just giving me a headache. It works on my test copy of the same mission I worked on with a placeholder unit thats BLUFOR, but when I remove the placeholder unit, it just doesn't work :/

Edited by Phantom Six
  • Like 1

Share this post


Link to post
Share on other sites

You're probably one step away from making it work!

Make sure you remember to initialise civs_killed_by_west.

What's the story with the placeholder unit?.... I'm not following you there.

EDIT: Simple test mission here.

Edited by twirly

Share this post


Link to post
Share on other sites

Basically I put one BLUFOR unit that's not suppose to be there when the mission is completed to see if the script works. I launch the game up on MP and I pick the placeholder unit to shoot the civilians. Mission ends and it seems to work. After that I delete the guy and went back to normal units and played the game normally. I then fire at civilians to see if the script works and its a no go.

I think I might as well just ditch the civilian casualty counter part for now (summer heat in California hurts my head in this hot room :( ), spent a bit too much time on this mission; going to be making a few more before I release it in a pack.

Edited by Phantom Six

Share this post


Link to post
Share on other sites

I had a similar problem. I had myself as commander and 3 junior commanders on the map. Each junior commander was commanding a team.

That makes a total of 4 commanders on the map.

If any 2 commanders are killed the scenario ends in a loss. How to do this?

Trigger 1: If man 1 and man 2 are killed trigger fires and scenario ends.

Trigger 2: If man 1 and man 3 are killed trigger fires and scenario ends.

Trigger 3: If man 1 and man 4 are killed trigger fires and scenario ends.

Trigger 4: If man 2 and man 3 are killed trigger fires and scenario ends.

Trigger 5: If man 2 and man 4 are killed trigger fires and scenario ends.

Trigger 6: If man 3 and man 4 are killed trigger fires and scenario ends.

So, I placed the 6 triggers in a neat line in an out of the way place on the map. It worked just fine.

Another option (untested) would be to create a few triggers and group some. If one trigger is supposed to fire maybe it will not fire till the other one has fired?

.

Share this post


Link to post
Share on other sites

Would have been simpler to create an array with the 4 commanders, and use only one trigger using count on that array!

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  

×