Jump to content

Recommended Posts

Posted

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]sigpic70266_4.gif[/sIGPIC]

Snooze-81st-vFS

Posted

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

Posted

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]sigpic70266_4.gif[/sIGPIC]

Snooze-81st-vFS

Posted

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 ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • Recently Browsing   0 members

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