Hey guys, I'm making a mission where a large enemy ship is hunting you and your comrades in a nebula using sonar. I created three different types of sonar: High, Mid, and Low.
Low means they don't have a fix on your position.
Mid means they have a fix on your general area.
High means they know your coordinates.
I am basing the rating of High, Mid, and Low on the Player's speed. If the Player is rushing through an area, he will get picked up very quickly and the enemy ship will send missiles at the Player. There are Nav Buoys spread throughout the Nebula that act as signal dampers. When the Player gets close to them, the enemy signal is totally lost, so if they had a fix, it is lost. I am having some difficulty with some of these things, however. Here is the basic script I have right now. It works like a charm:
#Events ;! 3 total
$Formula: ( when
( or
( < ( current-speed "Alpha 1" ) 1 )
( = ( current-speed "Alpha 1" ) 1 )
)
( play-sound-from-file "Sonar_Low" )
)
+Name: Low
+Repeat Count: 1
+Trigger Count: 9999999
+Interval: 4
+Team: 0
$Formula: ( when
( and
( > ( current-speed "Alpha 1" ) 1 )
( < ( current-speed "Alpha 1" ) 50 )
)
( play-sound-from-file "Sonar_Mid" )
)
+Name: Mid
+Repeat Count: 1
+Trigger Count: 9999999
+Interval: 4
+Team: 0
$Formula: ( when
( or
( > ( current-speed "Alpha 1" ) 50 )
( = ( current-speed "Alpha 1" ) 50 )
)
( play-sound-from-file "Sonar_High" )
)
+Name: High
+Repeat Count: 1
+Trigger Count: 9999999
+Interval: 4
+Team: 0
I'm not 100% sure if there's a way of making the Trigger Count infinite. I would like to add a delay before each trigger may happen (ie if High or Mid has been triggered, I'd like to have a 4 second delay before Low gets triggered if it does. This issue I'm having is that I am moving below 50, and then when I break 50 the two sound effects may overlap.
My other issue is that how do you track a trigger happening 3 times in a row? I'd like to make it so that when High happens 3 times in a row, the enemy ship launches missiles, but only when it happens 3 times in a row. It would stop after the Player slows down or loses the target.
Any ideas?