Jump to content

Trigger Check Zone and Random flags...


Recommended Posts

Posted (edited)

S! All,

I'm pretty much new in IL-2 mission editing... but before someone says to go and read the IL-2 editor manual or YT videos on Editing in IL-2... I did read and view many sections (videos) but don't seem to be finding a solution.

So here goes my request (question).

I have a script (group) to place randomly 1 of 3 flags on my MP TC mission map.
I created also a script (group) that uses the Trigger Check Zone of my flag radius, to let me know if any attacking (tanks) are near the flag area (with a message saying ex: "Allied are near the flag area!").

All of these are working... but now I need to have the Trigger Check Zone script working only for the active (spawn) flag and not the (2) other areas with no flag visible.

I did try to place a trigger activate, but I must not be using it the way it should. Also, I need the Trigger Check Zone script to be visible only for the flag active (spawn) and not the (2) two other flag areas.

Feel free to ask me questions, if my request is not clear.
Big thanks to all.

Cheers,
GenMarkof :)

PS: an image of the Trigger Check Zone script is attached to this message.

 

Trigger_Check_Zone.thumb.jpg.eac35e273390cde26a8813ebac1b35cf.jpg

----

Edited by GenMarkof007
Billsponge1972
Posted

I'm by no means a master but I noticed there are no objects linked to the trigger activate/deactivate and there should be a timer between the mission begin and anything. Also, there should be an object link from the check zone to the object that it will detect intruders and also a target link to the objects that are doing the intruding of the check zone. Hope this helps some.

Posted

S! @Billsponge1972

 

Thanks for your reply...
So, yes, I need to add a trigger timer between the mission begin and the trigger check zone (I will add it).
Also, you don't see it, but the trigger activate is linked by the object to the flag of that area... it's not in this group, this is why it's not shown in the image above!

For the trigger check zone, it's not linked to an object, since it has a radius of 25m that is triggering the message of the attacking (allied) tank in the radius.

But my main problem... is more that I need to find a solution that for the (2) two other flags area, it doesn't trigger the message since the flag is not in that area!

Any help on this would be great!
Thanks for any input.

Cheers,
GenMarkof  ;)

Billsponge1972
Posted

I'm sorry I'm not qualified to help much more than that. 

But there are editor wizards on this forum that will help you for sure.

Posted

I am not an editor specialist in respect of scripts or MPmissions too, but typical procedure is that you put your mission with the problem in a *.zip file and post it here. It is easier to analize a problem if you have the mission in the editor available.

  • Thanks 1
Posted (edited)

This is how you do it. You'll need 3 checkzones, one for each flag. Then you deactivate all of the checkzones and flags you're not using. When an event fires that activates the next flag, then you again deactivate all of the checkzones that are not being used, and activate the checkzone and flag you need.

 

In my example below, Flag 1 and Checkzone 1 get activated automatically at the start of the mission. I also deactivate Flag 2, Flag 3, Checkzone 2, and Checkzone 3. Eventually, some event will activate Flag 2. When that happens, I deactivate Flag 1, Flag 3, Checkzone 1, and Checkzone 3. Finally, some event will activate the last flag, Flag 3. When that happens, I again deactivate all the unnecessary flags and checkzones and activate Checkzone 3 and Flag 3.

 

Here is the group for you to reverse engineer: Flag and Checkzone Activation.zip

 

image.thumb.png.cc852e40709095618d2713094caa9fef.png

Edited by Sketch
  • Like 2
Posted (edited)

S! @Sketch


=updated edit: 4:35 PM EST NA time=
 

First of all, a big thanks for your reply and your group.


Well after doing some testing (this afternoon)... it seems that the new script (group) added with my random script is only spawning the flag 1.
The main reason for my random script is that the flag area (spawning at the start of the mission) could be from any of the (3) flag spawn areas.

Sketch, I've saved a group with the (3) flags + my random script & logic group and your flag & check zone activation group.
If you could look at it and see what is restricting only the spawning of the flag 1, that would be great.

A big thanks again for your help!

Cheers,
GenMarkof 
 

-----


 

 

Flag and Checkzone Activation_NEW.zip

Edited by GenMarkof007
Posted

I checked only your group called Random Logic, which is the main logic to activate the flags check zones etc. I have not checked the rest of your code.

Your code works as intended except for an error in your naming. Flag3_Logic activates Flag 1, Flag1_Logic activates Flag 3, and for Flag 2 it is correct.  I modified it to have the code to loop on itself so that once a flag is activated the system displays a message of which flag is activated, then restart the whole process.

There is an important point to mention in your model. You have not assigned equal probabilities to your three flags. You have chained the probabilities and this is why you do not have a sum of probabilities equal to 1. If this was made by design so then fine it works as intended.

If your idea was that each Flag should have the same probability to be activated that is 33.33% for each Flag then your code is flawed.

You must start in parallel the three flag activation logic, with the same random factor and play on the timings to manage the deactivations and activations.

The complexity here lies in the fact that the three flags could be activated at the same time, so you must manage that.

You can find an example of how to build a two way or more random event generator on the forum.

 

To have some significant statistical value I made with your code 52 draws.

The ranked results are:

  • Flag 3 came out 25 times or 48%,
  • Flag 1 came out 14 times  or 27%,
  • Flag 2 came out 13 times or 25%,

And it does make sense as the total makes 100%.

 

The result for Flag 3 that has 33% (0.33 as coded) of chances to come out which means in a perfect random sample rounded to 17 times.

The result for Flag 1 that has 22% (0.67x0.33 as coded) of chances to come out which means in a perfect random sample rounded to 11 times. 

The result for Flag 2 that has 10,9% (0.33x0.33 as coded) of chances to come out which means in a perfect random sample rounded to 6 times.

If we sum the probabilities here we have 33+22+10.9 = 65.9% which translate over 52 draws to a set of the size rounded to 34 which is correct.

 

The ranked probability value does correspond to the ranking that we have after 52 draws. It is far from perfect as the difference should be larger between Flag 1 and Flag 2 but you get the picture. For statistics this is a very small sample, you should have hundreds if not thousands to have a definitive picture.

 

There can be multiple factors that will hamper the randomness according to the implementation. No software random number generator is perfect and I have no idea which one is here. Nevertheless it is impossible to have an idea of the quality of a random generator function without millions of samples.

 

My advice here is do not go too short with timers. I avoid going under 500 milliseconds.

If you have a lot of stuff going in parallel in your missions, then you can get to weird behaviors if you have very short timings and many in parallel.

In your case you do not need high speed as you will activate one flag and then play the game.

Between two activation the time can be in tens of minutes I suppose.

So no problem to keep a good timing difference.

 

You mentioned that you got always Flag 1, but how many tries have you made. If I look at my draws I had the Flag 1 come out five times in a row. So with random numbers you can have twenty in a row, nothing strange here.

 

 

 

 

Posted

S! @IckyATLAS

 

Thanks for the report on the random logic, I appreciate the analysis of the randomness...
I will look up the 2 or more-way event generator on the forum.

 

But my biggest problem for now is that I would like the flag (1, 2 or 3) that will spawn, to spawn a trigger check zone for that specific flag.
That way, if an enemy tank enters a specific radius of the flag, a message will be shown saying that the attacking tanks are near the flag area.

 

If you have any idea about how to do this, feel free to send me a group or explain what should be done so that the trigger Check Zone of the spawn flag shows this message.

 

Thanks for your help.

Cheers,
GenMarkof007  

Posted

S! @JG4_Deciman

 

Thanks for the reference...
But like I said, I think that my random script is working fine to spawn by random my winning flag.
Now, my main problem is to have also a trigger: check zone spawning at the same flag, so that if an enemy tank is inside a radius of 25m, a message will inform the (2) side of this!

Cheers, 
GenMarkof  ;)

Posted (edited)

image.thumb.png.86609ea12fa1cd8c26843d4b0164b2ef.png

 

This is how to do what you're requesting. It's similar to my above example, but instead of starting from Mission Begin, we're starting from a choice of three random options. Here's the group file for you to reverse engineer: Flag and Checkzone Activation.zip

 

So... How does this work?

 

At mission begin, we fire the randomizer.

image.thumb.png.28aee9f3ca884dc906f7818668b3cb36.png

 

The randomizer chooses one of the three flags and checkzones, and disables the others.

image.thumb.png.50b2f42b3174acc71075d89bd420592b.png

 

Lets say, in this example, that the randomizer chose flag 3. The other flags and checkzones get disabled.

image.thumb.png.44c4a033f7fa142c731ea17413e0a7af.png

 

And then we activate flag 3 and checkzone 3.

image.thumb.png.f7cbb65248d08d8c206f3919eb8cc9ac.png

 

Finally, we run a pulse to all the checkzones to make sure they're connected to the mission. In this case, only checkzone 3 will receive the pulse. 

image.thumb.png.3c03de08c9ed4c9cd65a9241ee0b9786.png

 

With checkzone 3 activated, it waits for any Axis players to enter the checkzone. When it does, it will send a pulse to turn on the subtitle message for both sides. However, if this has happened already within the last three minutes, then the pulse stops at our switch. 

image.thumb.png.0221d752f1970eaea9a7fb6a56eab2ce.png

 

But let's assume this is the first time. So the pulse continues to the two subtitle messages.

image.thumb.png.ab7588df2cb74d582e9bb650a90917e1.png

 

And the switch deactivates itself, and turns on the three minute timer. (So, if more pulses come in from the checkzone, nothing happens beyond the switch, since the switch is disabled.)

image.thumb.png.519beb5607a4808f38aab6617302753f.png

 

After three minutes, the switch gets reactivated, allowing more subtitle messages to come through.
image.thumb.png.282327682a5fd0dd61ade3034b3b08c1.png

 

 

Hope this helps explain the logic behind your request, so that you can make awesome missions in the future. Good luck, and feel free to use the group as you see fit.

Edited by Sketch
Posted

S! @Sketch

 

First of all, a big thank you for this group...
Secondly, another thank you for explaining very well all the stages of the group (script).
It makes it far easier for me (a newbie with the IL-2 Editor) to understand how everything is working.

 

And finally, thanks for letting me use this great group.
If it's ok with you, I would like to add you to my mission description (thank you note - people helping with script or other stuff).

----
Another quick question... when I open my mission in-game, the map GUI does not center with my main battle area (it is more at the bottom of the screen).
Any adjustment I could make on my map to get that section a little higher? Someone was saying that this depends more on what elements like Airfield, Tank spawns, and MCU are on the map. I also have a BORDER of the map.

Cheers,
GenMarkof ;)

Posted
21 minutes ago, GenMarkof007 said:

Another quick question... when I open my mission in-game, the map GUI does not center with my main battle area (it is more at the bottom of the screen).
Any adjustment I could make on my map to get that section a little higher? Someone was saying that this depends more on what elements like Airfield, Tank spawns, and MCU are on the map. I also have a BORDER of the map.

No need to credit me. I'm not sure what links the mini-map and the mission editor entities together. When I make missions, I typically do not have the mini-map in mind, as my missions are intended for expert settings (or more specifically for multiplayer sessions). Sorry I can't help you there.

Posted
8 minutes ago, Sketch said:

No need to credit me. I'm not sure what links the mini-map and the mission editor entities together. When I make missions, I typically do not have the mini-map in mind, as my missions are intended for expert settings (or more specifically for multiplayer sessions). Sorry I can't help you there.


No, I'm not talking about the mini-map, but more the overall map that you see before choosing your side and an Airfield or Tank spawn, with the description of the mission on the right side (if open).

Sorry, if I didn't choose the right words or descriptions for it.

Cheers,
GenMarkof 

Posted

I got you. Yes, I have this same problem with the big map. I don't know what makes it centered and I wish there was an entity that we could add to our missions to say "Center here for the first time".

  • Thanks 1

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...