DD_Friar Posted June 14, 2021 Posted June 14, 2021 Salute Does anyone know how I would fire a trigger off of the MCU: Modifier Set Value and Add value please? I think I understand how to set it up and to link to the "Add Value" when something happens, but what I am struggling to see is how when the data values reach a certain level, I can then get something to happen. The scenario I am building and want wanting to count is the number of flags captured. The map will have a number of flags and a side will win the map if they are in possession of all of the flags. I did not think I can use a counter because a side may loose a flag having taken it (counter -1). I have tried to look at the Advance and Secure maps because this logic must be in there? but could not work it out. Unless there is another way of doing it? Any advice or pointers would be gratefully received. Kind regards Friar
JG4_Deciman Posted June 14, 2021 Posted June 14, 2021 Short answer: Use a counter for each nation counting captured flags. In case all flags are 'neutral' at beginning set them to 0. Let them fire when the number of flags is reached So 10 flags, all are neutral Each 'capture' will increase the nation couter until it reaches 10. Result: Couter will fire when a team captured 10 flags (including recapture) Counter will not fire if a team captured all flags (some flags may be owned by other nation) Workaround: Whenever a nation 'owns' a flag and that flag is captured by the other nation Modify owning nation counter (Value Add = -1 -> reduce by 1) Result: Counters will have the 'owned' flags as value instead of the 'captured' flags and fire only if all flags are owned Previous way to do the same: Use different lines of timers triggering them one by one for each nation containing a timer for each flag Owning a flag activates the timer for the owning nation and deactivated the timer for the other nation After each capture both lines are checked Whenever a line is completed (final timer reached) nation owns all flags. Deci
DD_Friar Posted June 14, 2021 Author Posted June 14, 2021 After much searching I came across this thread... @JG4_Deciman - Thank you I will have a look at what you suggest.
DD_Friar Posted June 14, 2021 Author Posted June 14, 2021 @JG4_Deciman Salute What I am stuck on is what to do for the first time a flag is captured. I get when a flag is re-captured by the enemy I subtract 1 from the total owned flags, but if I do this the first time a flag is taken, it will take them to -1 (as they do not own a flag yet)? How do I control updating the score the first time a flag is "owned"? (and there is nothing to deduct from the enemy) Or have I missed something in your suggestion? Cheers and many thanks for assistance.
JG4_Deciman Posted June 15, 2021 Posted June 15, 2021 Hi there You can use activate and deactivate for the 'Add Value: -1' Basic setting (if not owned by any nation) -> both nations 'Add value: -1' is deactivated After capturing activate the 'add value: -1' for the capturing nation with a short delay and disable the 'add value: -1' for the other nation. Whenever a capture is done trigger the counter for the owner and the 'add value: -1' for the other nation. In case it was formerly owned the 'add value: -1' is active, otherwise not Deci
DD_Friar Posted June 15, 2021 Author Posted June 15, 2021 Salute @JG4_Deciman Sorry, I am still struggling to understand what you mean. I have attached my test mission which hopefully has the majority of the items that are needed. May I ask is there any chance you could have a look at it and make the required changes? (do what ever is required) It is a simple test with just two flags. FlagCountTest.zip
JG4_Deciman Posted June 15, 2021 Posted June 15, 2021 Here you are Untested but should work and show the way Deci FlagCountTest_Deci.zip 1
DD_Friar Posted June 15, 2021 Author Posted June 15, 2021 You are a star Sir! many thanks, I will have a look and report back.
DD_Friar Posted June 15, 2021 Author Posted June 15, 2021 (edited) Having tested the code provided by @JG4_Deciman I can confirm it does work as required. I have streamlined the logic into a logic diagram for 1 flag so you can see how it works. Many thanks to all those who have chipped in on this. Notes: The "Reduce Allied" and "Reduce Axis" have Data(0) set to -1 with a Parameter of 0 Salute DD_Friar Edited June 15, 2021 by DD_Friar
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now