Set manualSpeed through Lua

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
robotsanta77
Posts: 8
Joined: Wed May 06, 2020 2:43 pm

Set manualSpeed through Lua

Post by robotsanta77 »

I'm having trouble setting an air unit's manualSpeed with the ScenEdit_SetUnit function. Whenever I try to run a script setting an air unit or group's manualSpeed it seems to set the unit's manual speed to their Cruise speed instead. Am I missing something? is there some doctrine setting I need to uncheck or something else? When I try running this:
ScenEdit_SetUnit({guid = 'The Unit GUID', manualSpeed = 600})
it just sets the speed to the cruise speed. I've found other threads with examples of manualSpeed being changed in the SetUnit and I've tried with a decimal digit and as a string but it still isn't working for me.

It might be work noting I'm attempting this on Command Professional Edition.
Parel803
Posts: 941
Joined: Thu Oct 10, 2019 3:39 pm
Location: Netherlands

RE: Set manualSpeed through Lua

Post by Parel803 »

I'm no expert or even close but found for subs the manualSpeed=OFF, smart Lua people posted that but can't find it back, sorry.
Hope that works:
ScenEdit_SetUnit({guid='50PVO4-0HM6EO0TSI8IB', manualSpeed=OFF, manualSpeed=400})
with regards Gert-Jan
robotsanta77
Posts: 8
Joined: Wed May 06, 2020 2:43 pm

RE: Set manualSpeed through Lua

Post by robotsanta77 »

Thanks for the response but it's still giving me the same problem. I've also just now been able to attempt the script with the commercial version of CMO where it seems to work entirely as intended. I'm thinking there may just be an issue with the professional edition.
User avatar
michaelm75au
Posts: 12457
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Set manualSpeed through Lua

Post by michaelm75au »

I have noticed (depending on the version of PE) there seems to a lag in the Lua fixes; probably due to how many different versions are currently out there (CMANO, CMO, and then the PE variants)
Michael
robotsanta77
Posts: 8
Joined: Wed May 06, 2020 2:43 pm

RE: Set manualSpeed through Lua

Post by robotsanta77 »

I'm starting to think that must be the case. I'm using CPE version 1.15.4.4 it that matters. I've also tried it on 1.15.3 with the same results.
Post Reply

Return to “Lua Legion”