Page 1 of 1

Setting A Ready Time, Is There A LUA script that does this?

Posted: Wed Nov 29, 2017 8:40 am
by butch4343
Guys,

Im sorry to continually ask for help with LUA, I was wondering is there a way to set a units ready time?

I had a look to see in the LUA script options if there was and if there is I cant see it.

Heres what am trying to do, I have a Scenario where I want the player to choose the loadout, but dont want to wait the 6 hrs for the armourers to do their thing. So I was thinking that maybe something along the lines of

ScenEdit_SetUnit({unitname=Aplha 1},{readytime='00:01:00'})

That would make Aircraft Alpha 1 ready after 1 hour of the event being fired.

Would that work?

I am very slowly guys getting a feel for LUA, but its slow in my case, I was wondering what parameters does the ScenEdit_SetUnit allow you to set? Is there a list somewhere?

Kind Regards

Butch

RE: Setting A Ready Time, Is There A LUA script that does this?

Posted: Wed Nov 29, 2017 12:05 pm
by mikmykWS
Hi Butch

All documentation is here: http://commandlua.github.io/index.html

Mike

RE: Setting A Ready Time, Is There A LUA script that does this?

Posted: Thu Nov 30, 2017 5:23 am
by butch4343
Mike,

Thanks for the link, I have had a look through and tried to create a script but keep having issues [:(]

I have tried two different scripts:

ScenEdit_SetUnit({side="IIRAF", unitname="Osprey #1",}, {readytime='3'})

ScenEdit_SetUnit({side="IIRAF", unitname="Osprey #2t",readytime=00:01:00})


I keep getting a error

00:00:03 - 00:00:03 - Lua script execution error: [string "Test 1"]:2: '}' expected near ':'


Am not seeing where there should be a brace, any ideas?

Regards

Butch

RE: Setting A Ready Time, Is There A LUA script that does this?

Posted: Thu Nov 30, 2017 5:24 am
by butch4343
Attached the scenario [:)]

RE: Setting A Ready Time, Is There A LUA script that does this?

Posted: Thu Nov 30, 2017 7:30 am
by michaelm75au

Code: Select all

ScenEdit_SetLoadout({unitname="Osprey #1",loadoutid=0,timetoready_minutes=3})

RE: Setting A Ready Time, Is There A LUA script that does this?

Posted: Sat Dec 02, 2017 5:22 am
by butch4343
Folks

Again I find myself in your debt, you guys always deliver for me when I need LUA help and you dont realise how much better you guys make my scenarios.

Regards

Butch