Jump to content

Need help with a script or a trigger.


Bogdy356

Recommended Posts

Hello to everyone,

Is there a script or trigger that can allow me to do the following :

- Random spawn 1 or 2 or 3 or 0 (none) group of fighter planes but each group to have a percentage of spawning. Just put it this way the su33 is posible to be spawn but it has a 20% chance that it will but the mig21 has a 40% chance that will spawn. And of corse random altitude for the fighters that spawn. My experience with scripting is very limited I just started looking how it works so bare in mind that.... :)). Thank you.

Link to comment
Share on other sites

Hello to everyone,

Is there a script or trigger that can allow me to do the following :

- Random spawn 1 or 2 or 3 or 0 (none) group of fighter planes but each group to have a percentage of spawning. Just put it this way the su33 is posible to be spawn but it has a 20% chance that it will but the mig21 has a 40% chance that will spawn. And of corse random altitude for the fighters that spawn. My experience with scripting is very limited I just started looking how it works so bare in mind that.... :)). Thank you.

 

You don't need a script for that, just basic triggers and rules will work fine, you can also make it so say for example flight A is live, then flight B won't spawn while flight A is alive, and make both flights randomised. You need any further help with it I can make you an example mission ?

Link to comment
Share on other sites

I will really appreciate if you can give me an example.The most important thing is the random altitude because if i know at what altitude they spawn even if i dont know the fighter plane type its pointless to work the radar as i know at what altitude to search , another cool thing would be the possibility that no fighters are spawn .That way i really don't know what to expect and i need to be really careful because i might get for example 2 groups of su27 or none.I tried to do it in the mission editor , i created 7 mig29 flights each one at different altitude then 7 su27 flight at different altitudes all of them armed and i saved a template for each one for ex. mig29 1 , mig29 2 ,mig29 3 etc. .In the trigger menu i set the following:

Mission start/random 10%/activate mig29 1

Mission start/random 10%/activate mig29 2

etc......

Basically it worked the problem was that when i loaded the templates in the editor all the altitudes that i set were screwed 235ft ....330ft....very low altitudes.And above that is a pain in the a... to do set all this up.That's why i asked if there is some script that would make this easier.Thanks

Link to comment
Share on other sites

I will really appreciate if you can give me an example.The most important thing is the random altitude because if i know at what altitude they spawn even if i dont know the fighter plane type its pointless to work the radar as i know at what altitude to search , another cool thing would be the possibility that no fighters are spawn .That way i really don't know what to expect and i need to be really careful because i might get for example 2 groups of su27 or none.I tried to do it in the mission editor , i created 7 mig29 flights each one at different altitude then 7 su27 flight at different altitudes all of them armed and i saved a template for each one for ex. mig29 1 , mig29 2 ,mig29 3 etc. .In the trigger menu i set the following:

Mission start/random 10%/activate mig29 1

Mission start/random 10%/activate mig29 2

etc......

Basically it worked the problem was that when i loaded the templates in the editor all the altitudes that i set were screwed 235ft ....330ft....very low altitudes.And above that is a pain in the a... to do set all this up.That's why i asked if there is some script that would make this easier.Thanks

 

I don't think it should be a problem, just some leg work required, will chuck something together for you tomorrow :) (Sunday)

Link to comment
Share on other sites

I will really appreciate if you can give me an example.The most important thing is the random altitude because if i know at what altitude they spawn even if i dont know the fighter plane type its pointless to work the radar as i know at what altitude to search , another cool thing would be the possibility that no fighters are spawn .That way i really don't know what to expect and i need to be really careful because i might get for example 2 groups of su27 or none.I tried to do it in the mission editor , i created 7 mig29 flights each one at different altitude then 7 su27 flight at different altitudes all of them armed and i saved a template for each one for ex. mig29 1 , mig29 2 ,mig29 3 etc. .In the trigger menu i set the following:

Mission start/random 10%/activate mig29 1

Mission start/random 10%/activate mig29 2

etc......

Basically it worked the problem was that when i loaded the templates in the editor all the altitudes that i set were screwed 235ft ....330ft....very low altitudes.And above that is a pain in the a... to do set all this up.That's why i asked if there is some script that would make this easier.Thanks

 

Sat and had a play with it this morning, like you said, without a ton of leg work on the triggers there is no easy way it seems, I noticed there seems to be a bug with AGL on the heights as well possibly on the waypoints, if i set the height to anything AGL it defaulted back to the original spawn height, setting this to ASL sorted that tho and the waypoints retained the correct set height, might be worth a quick check on your templates maybe ?

Link to comment
Share on other sites

This was as simple as I could make it......

 

1 flight out of the 3 at a time all randomised, setup so only 1 flight will be active in this instance, angels 5, 10 and 20.

 

No idea if that helps at all ?

 

More than one way to do this I appreciate.

Thank you , it works very well .I have ultimatley started to learn how to use M.O.O.S.E .It is a shame that with only a few added settings in the editor making more random things happen in a mission would be a lot easier so we can spend more time flying than learning.:)

Link to comment
Share on other sites

I have a question why not make this truely random? In your OP you stipulated percentage values which means you will encounter certain aircraft types more often than others. There is a way to make this truely random as an option. Just wondered.

 

Imagine this scenario...I set up a 2 ship deep strike mission and i set up different enemy aircraft types some 2ships some 4ships with random altitudes , now i give every group a percentage for spawning because i don't just want a random group to spawn i want some to have a higher probability of spawning then others, for ex. is more likely to encounter mig21's or some other not so powerfull aircraft then to find yourself head to head with 4 su33 but there is still that posibility even if its lower.And of course there is the chance that no aircraft are spawn.I mean for me that would be something dynamic , something that i can't 100% prepare for .


Edited by Bogdy356
Link to comment
Share on other sites

Thank you , it works very well .I have ultimatley started to learn how to use M.O.O.S.E .It is a shame that with only a few added settings in the editor making more random things happen in a mission would be a lot easier so we can spend more time flying than learning.:)

 

Glad it helped mate, half the battle with this mission editor is learning how to BS the engine into doing what you set out to achieve, in the nicest possible way I mean that.

Link to comment
Share on other sites

1) Flag set to random value 1,1-10

2) Flag 1=1 - activate group high priority

3) Flag 1=2 - activate group high priority

4) Flag 1=3 - Activate group low priority

5) Flag 1= 4 - nothing

.

.

.

 

and so on. Assign more numbers to higher priority groups, and just one to lower priority ones.

 

Be good to see a small example of this if you wouldn't mind, would help understanding implementation fully. :)

Link to comment
Share on other sites

1) Flag set to random value 1,1-10

2) Flag 1=1 - activate group high priority

3) Flag 1=2 - activate group high priority

4) Flag 1=3 - Activate group low priority

5) Flag 1= 4 - nothing

.

.

.

 

and so on. Assign more numbers to higher priority groups, and just one to lower priority ones.

 

Thank you very much man, it seems that the trigger system is pretty powerful so I have to learn it better. With this and some simple CAP moose script I am all set. :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...