Add Cargo to mission

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
gesch80550
Posts: 5
Joined: Wed Mar 06, 2024 1:20 pm

Add Cargo to mission

Post by gesch80550 »

I am trying to script a mission to transport cargo in an amphibious assault, but I can't find a command to assign the cargo I want to move. If I assign it to move all available cargo, it seems to work but if I want to assign specific cargo, I can't seem to make that work...

Per the documentation, I have been trying to use addAssignedCargo on the Mission wrapper, but I get 'attempt to call a nil value (method 'addAssignedCargo')'.

I have tried (ms is a mission wrapper)
ms:addAssignedCargo()
ms:addAssignedCargoMount()
ScenEdit_AddAssignedCargo()
But all of them return the same type of error.

Has anyone gotten this to work? What is the correct command to add cargo to a cargo mission in Lua?

Thanks
User avatar
andytm956
Posts: 5
Joined: Fri Apr 08, 2016 5:11 am
Location: Portsmouth, England

Re: Add Cargo to mission

Post by andytm956 »

To land 3 waves of marines I find that i have to delete a wave mission for the next wave to activate. So all troops are assigned to wave 1,2 or 3. So i load wave 1, send the landings ships in and the LCAC's will carry them ashore once the wave is activated. I give the wave time to land from LCAC's and then return. Then through lua i delete wave 1, wave 2 activates and the LCAC's will load and prceed to land. Again give them time to land and return then delete wave 2 via Lua, activate wave thre and it will ten land. I could not get a wave to activate unless the mission before was deleted de-activating did not work, I had to delete the mission. This is to allow a AI landing.
gesch80550
Posts: 5
Joined: Wed Mar 06, 2024 1:20 pm

Re: Add Cargo to mission

Post by gesch80550 »

Thanks for that info - I have not hit that problem yet...more fun-ness to look forward to :D

Did you use Lua to 'load wave 1' in your situation? That is the part I am stuck on at the moment. I built the Cargo Mission in Lua but can't assign the cargo I want it to move without an error. If you used Lua, could you share the code to assign Cargo to the mission?

Thanks
Post Reply

Return to “Lua Legion”