GripenNG Posted March 9, 2013 Posted March 9, 2013 Right to the question...I have three howitzer groups which I want to fire at a point randomly. Maybe just one, or perhaps all three opens fire. But I want them to open fire within a time frame; for example - between 6 to 10800 seconds from mission start. And also I want this to happen randomly at about 10% of chance. But the groups who get´s active opens fire immediately after 6 seconds... My current script: 1 ONCE (21. Art Coy Hostile NO EVENT) -> RANDOM (10%) + TIME LESS (10800) + TIME MORE (6) -> AI TASK (FIRE AT POINT) [sIGPIC][/sIGPIC] Snooze-81st-vFS
Quirkitized Posted March 9, 2013 Posted March 9, 2013 Have you tried with advance waypoint options? Double click on fire at point Select set what time they perform this command, the probability in %, and the stop condition if needed. Also, artillery typically does not fire until around the 2-3min mark. It takes them awhile to setup, some might be faster but this is what I have observed with different artillery units...
GripenNG Posted March 9, 2013 Author Posted March 9, 2013 Yupp I tried this first, but it is not randomly enough, as I could expect when they start shelling by the time I´ve set. The thing I´m after is that I want the howitzers to fire sometime during my 2 hour flight - if at all due to the random % value. [sIGPIC][/sIGPIC] Snooze-81st-vFS
Grimes Posted March 10, 2013 Posted March 10, 2013 Advanced waypoints don't really work for this sort of thing because all waypoint tasks are assessed and then either executed or ignored. My favorite method for a random event that will occur over time is to do something like the following... Once>Time More> Set Random Flag Value(1, 10, 100) Switched Condition>Time Since Flag 1 is 60 seconds>Flag 1 Decrease 1 Once> Flag 1 = 1> Do action Simply put every 60 seconds flag 1 will automatically count down by a value of 1. By randomly setting its initial value between 10 and 100 it will take a random time between 10 and 100 minutes for the action to occur. The trigger of setting a random value for a flag is limited from 1 to 100, however the flag values aren't limited. There are a few ways you can avoid this limitation, for instance change how often the flag decreases a value, or simply do a few flag increase x triggers. However the easiest and most straightforward way is to use scripting: simply replace the set random flag value trigger with a do script with the following code: trigger.action.setUserFlag(1, math.random(10,120)) The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
GripenNG Posted March 10, 2013 Author Posted March 10, 2013 Thanks Grimes! It´s working the way I want now :) :) [sIGPIC][/sIGPIC] Snooze-81st-vFS
Paco Posted March 10, 2013 Posted March 10, 2013 Grimes, I would have thought of that. Thanks for sharing. Paco
ENO Posted March 11, 2013 Posted March 11, 2013 Impressive! "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Recommended Posts