Jump to content

Count how many AI bombers reach the target area - how?


Recommended Posts

Posted

Hi all, I have an offline single player mission where the Player is supposed to intercept the AI enemy bombers and prevent them from reaching the target area; so I want to show the message “X enemy planes managed to reach the target area” in the end of the mission when the Player lands. That’ll show the Player how many bombers he failed to shoot down.

I suppose that the Counter MCU linked to the Check Zone MCU could be used to “count” how many AI planes actually reach the target but is there a way to show the total value on the screen via the Subtitle MCU?

I think I have seen something like this in an offline campaign but I don’t remember which one.

So could anybody share an ideas, thanks a lot!  

Posted (edited)

Can you instead just count how many planes are still alive? Every time a plane gets destroyed, you can notify the players of how many planes are remaining.

image.thumb.png.3636756e16a32ae56e8011e0a9d2138f.png

 

 

If this isn't possible, you can use a Complex Trigger MCU to count how many planes entered the CTX's area. Something like this:

image.thumb.png.06aad91a2c104f90066f82ab8df9473b.png

 

The catch with the CTX is that it will always count how many planes (of your specification) enter the CTX. As an example, one of the bombers could somehow enter the CTX, then leave the CTX and then reenter the CTX. If this happens, you'll get an incorrect count of OnEnteredAlive. So, CTX's can be unreliable. Hence why I suggest a OnDestroyed counter instead.

 

Edited by Sketch
  • Thanks 1
Posted

@Sketch appreciate your advice, btw the enemy bombers are the v-1's so they only enter the target area once. I am going to study the group you posted! 

The main difficulty is that I'd like to display the final count "X enemy bombers managed to reach the target area" only at the mission's end, when the Player lands back at the home base. I can't figure out whether THIS is possible.    

Posted
3 minutes ago, Vendigo said:

@Sketch appreciate your advice, btw the enemy bombers are the v-1's so they only enter the target area once. I am going to study the group you posted! 

The main difficulty is that I'd like to display the final count "X enemy bombers managed to reach the target area" only at the mission's end, when the Player lands back at the home base. I can't figure out whether THIS is possible.    

You can keep the score, and only display at the mission end. You would deactivate/activate the subtitle message you want to display at the end of the mission by putting a timer in front of the subtitle message and deactivating/activating that. Again, this is based on OnDestroyed values. Something like this:

Screenshot2023-05-31090200.thumb.jpg.32f61b0b4da8b82972ed505425cdfde5.jpg

 

 

Each counter disables the current gate and activates the next gate. Only the 'active' gate allows anything to 'pulse' through it. Meaning only one subtitle message will be displayed to the player depending on how many planes are remaining. I'm also disabling all but the first gate on mission begin. This is because we want all of the gates to be disabled, except for the first one.

 

 

  • Thanks 1
  • Upvote 1
Posted
7 hours ago, Sketch said:

Hence why I suggest a OnDestroyed counter instead.

When I want to be sure that the plane is counted as downed I use a counter that is activated by an event OnPilotKilled, OnPlaneDestroyed, OnPlaneCrashed. If any of these events happen then the plane is out for good. This counter then can activate a series of plane counters. Because you know how many planes then are you can display the message you want either how many left or how many destroyed. However if you use the Spawner you can only count the destroyed number.

 

The limit here is that the code becomes pretty large if you have 20 planes to count. You need 20 counters, 20 subtitles etc. etc. and this is only to display one information. If you want to display say 5 parameters about each plane then again go multiply all by 5.

You cannot use the counter value as a variable that you can use in the Subtitle text. That possibility would have made the code so much simpler for this kind of info display.

Making "if then" logical tests on counter values would also have been another major simplification for the code.

  • 4 months later...
Posted

How z'about a complex trigger 'entered alive' triggering a counter. But only if that could count the hits and display the number somehow ....

Posted (edited)
On 5/31/2023 at 4:52 PM, IckyATLAS said:

You cannot use the counter value as a variable that you can use in the Subtitle text. That possibility would have made the code so much simpler for this kind of info display.

Making "if then" logical tests on counter values would also have been another major simplification for the code.

Yeah, wouldn't that be nice!

Edited by No_85_Gramps

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...