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

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
butch4343
Posts: 327
Joined: Thu Mar 26, 2015 2:09 pm

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

Post 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
mikmykWS
Posts: 7185
Joined: Tue Mar 22, 2005 4:34 pm

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

Post by mikmykWS »

Hi Butch

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

Mike
butch4343
Posts: 327
Joined: Thu Mar 26, 2015 2:09 pm

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

Post 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
butch4343
Posts: 327
Joined: Thu Mar 26, 2015 2:09 pm

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

Post by butch4343 »

Attached the scenario [:)]
Attachments
SetReadyTest.zip
(55.25 KiB) Downloaded 25 times
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

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

Post by michaelm75au »

Code: Select all

ScenEdit_SetLoadout({unitname="Osprey #1",loadoutid=0,timetoready_minutes=3})
Michael
butch4343
Posts: 327
Joined: Thu Mar 26, 2015 2:09 pm

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

Post 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
Post Reply

Return to “Lua Legion”