Page 1 of 1

Add Cargo to mission

Posted: Tue Apr 09, 2024 3:15 am
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

Re: Add Cargo to mission

Posted: Tue Apr 09, 2024 7:11 pm
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.

Re: Add Cargo to mission

Posted: Tue Apr 09, 2024 11:43 pm
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