Setting Submarine Depth
Posted: Mon Apr 05, 2021 9:29 am
Folks,
I wonder if anyone can give me a step for a hint, I have a submarine assigned to and ASW patrol and the station depth set to -350ft what am looking to do is set up a script where the sub randomly changes depth every hour. I understand creating a random event script:
math.randomseed( os.time() )
a = math.random(1,10)
if a<5 then
The bit am struggling with is the setunit part. Ive tried to bodge together the script from the LUA Github page and came up with this:
ScenEdit_SetUnit({side="WP", unitname="K-511", alt =150})
Except it doesnt work, can ayone help me work out where Ive gone wrong?
Regards
Butch
I wonder if anyone can give me a step for a hint, I have a submarine assigned to and ASW patrol and the station depth set to -350ft what am looking to do is set up a script where the sub randomly changes depth every hour. I understand creating a random event script:
math.randomseed( os.time() )
a = math.random(1,10)
if a<5 then
The bit am struggling with is the setunit part. Ive tried to bodge together the script from the LUA Github page and came up with this:
ScenEdit_SetUnit({side="WP", unitname="K-511", alt =150})
Except it doesnt work, can ayone help me work out where Ive gone wrong?
Regards
Butch