Jump to content
Sign in to follow this  
forzajuve

Problem with countside

Recommended Posts

I'm trying to get a mission to end where an A-10 squadron has to kill a bunch of vehicles (35 to be exact).

First I had a code:

!alive a1 && !alive a2 && !alive a3 && !alive a4 && !alive a5 && !alive a6 && !alive a7 && !alive a8 && !alive a9 && !alive a10 && !alive a11 && !alive a12 && !alive a13 && !alive a14 && !alive a15 && !alive a16 && !alive a17 && !alive a18 && !alive a19 && !alive a20 && !alive a21 && !alive a22 && !alive a23 && !alive a24 && !alive a25 && !alive a26 && !alive a27 && !alive a28 && !alive a29 && !alive a30 && !alive a31 && !alive a32 && !alive a33 && !alive a34 && !alive a35

Which didn't seem to work, either some vehicles somehow survived or I don't know what.

Then I tried countside, seeing as there 35 vehicles plus around 80-100 troops in about 10 urals so maybe countside 50 to be safe. I used this in a couple of missions which work fine but this one succeeds/ends the missions straight away and I have no idea why, considering the trigger is the exact same as the others except different number for countside.

I tried both:

east countSide thislist <= 50

({alive _x && side _x == east} count thisList) < 50

But they just both ended the mission. I tried different numbers like 10-15-30 etc too. The first one is the one I use in other missions (with different number of course) and it works fine for them...

Share this post


Link to post
Share on other sites

If you have a great amount of vehicles to manage, I'd suggest to use some dynamic scripting instead of statically inserting one vehicleVarName after another into a trigger :D

The easiest scenario would be having just 2~3 different types of vehicles your squadron has to take care of. In that case you can count how many vehicles of that type are still around and rollin'.

Another approach would be adding a custom attribute to the vehicles and counting them afterwards.

Putting this into the init-field of the enemy vehicles:

this setVariable ["targetVehicle", true];

in combination with this as the trigger's condition:

{alive _x && _x getVariable ["targetVehicle", false]} count vehicles == 0

should work, albeit not being the best solution (I'm sure there are some other and shorter methods, but I'm really tired right now so my brain might not work properly).

Share this post


Link to post
Share on other sites

Ok that seemed to work at least a bit but it still didn't work properly i.e. the mission didn't finish.

I think I know what the problem is though. It seems that some vehicles are actually survivng, maybe being hit by A-10 cannon fire and damaged but not fully blowing up and being destroyed. Then the crews probably evacuate leaving the vehicle sitting there and not being recognised as enemy. Is there maybe a way to force the crew to stay in their vehicle?

Share this post


Link to post
Share on other sites

Hmm maybe disabling the movement using "disableAI 'MOVE'" could work, or messing with the behavior?

You could also check for a certain damage threshold if your vehicles won't get totally wrecked (damage >= 0.9).

{damage _x < 0.6 && _x getVariable ["targetVehicle", false]} count vehicles == 0

Share this post


Link to post
Share on other sites

{damage _x < 0.6 && _x getVariable ["targetVehicle", false]} count vehicles == 0  

tried that, still doesn't seem to be working :/

Share this post


Link to post
Share on other sites

Patience. laddie. People may have other things to do with their time, especially at weekends, and in the peak European holiday season too.

Share this post


Link to post
Share on other sites

sorry, it's just annoying I can't get what should be such a simple thing to work.

Share this post


Link to post
Share on other sites

You could try canmove _x instead of damage

{canmove _x && _x getVariable ["targetVehicle", false]} count vehicles == 0  

I ran some tests and it seems to work fine, you must tag all the vehicles of course as mentioned using this setVariable ["targetVehicle", true]; in the vehicles init.

For testing you could also have a radio trigger, it will destroy all the vehicles that have been tagged.

{if (_x getVariable ["targetVehicle", false]) then {_x setdamage 1}} foreach  vehicles

Share this post


Link to post
Share on other sites

Still not working, went and make sure all the vehicles were tagged too. even the radio trigger didn't kill anything...

only a couple of things I can think of..

1) the vehicles are grouped in 5-6 groups of 5-6 or so, maybe it doesn't like groups

2) the infantry placed in the urals??

Share this post


Link to post
Share on other sites

It doesn't make any difference grouped or not, also tested with extra units and it still works.

I just copied the radio trigger code back and tested again and it blows up all tagged vehicles, so there is an issue with how your setting it up.

the code should go in the on act not the condition.

Share this post


Link to post
Share on other sites

If everything fails, the last thing to do is to upload your mission so we can have a peek into it.

Because, and here it comes again - the magical crystal ball isn't an item we usually carry around with us :b

Share this post


Link to post
Share on other sites
It doesn't make any difference grouped or not, also tested with extra units and it still works.

I just copied the radio trigger code back and tested again and it blows up all tagged vehicles, so there is an issue with how your setting it up.

the code should go in the on act not the condition.

I have that in on act in radio trigger.

If everything fails, the last thing to do is to upload your mission so we can have a peek into it.

Because, and here it comes again - the magical crystal ball isn't an item we usually carry around with us :b

ok here is the link

http://www.mediafire.com/download/uz5hfp8qcg7j9tr/Highway%2520of%2520Death.Chernarus.rar

Share this post


Link to post
Share on other sites

Tried your mission and notice an error in briefing use http://forums.bistudio.com/showthread.php?121163-Script-not-working-Use-the-showScriptErrors-parameter! to show errors.

The next thing I did was test the radio trigger, I just placed myself next to convoy and tried it.

The trucks blow up and task succeeded shows up.

Also you only need a waypoint at junctions when you want them to go a certain way and one at the final destination.

Other than above I don't see much wrong.

Share this post


Link to post
Share on other sites
Tried your mission and notice an error in briefing use http://forums.bistudio.com/showthread.php?121163-Script-not-working-Use-the-showScriptErrors-parameter! to show errors.

The next thing I did was test the radio trigger, I just placed myself next to convoy and tried it.

The trucks blow up and task succeeded shows up.

Also you only need a waypoint at junctions when you want them to go a certain way and one at the final destination.

Other than above I don't see much wrong.

will have a look at the briefing, thanks.

strange about that, it definitely didn't work for me.

I know, first I tried only a few waypoints for each group but they were straying off the road too much.

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  

×