Thats what I played around with too, but it doesn't work because you can only set metalStorage and energyStorage, and you can't subtract the initial storage from the respective CTeam members (look at how it's done in CommanderScript.cpp).SeanHeron wrote:Ok I was wrong, the cmdrscript starts with loads of resources as well. However I did find this:in the Luabinder.cppCode: Select all
class_<UnitDef>("UnitDef") .def_readonly("name", &UnitDef::name) .def_readonly("humanname", &UnitDef::humanName) .def_readwrite("metalstorage", &UnitDef::metalStorage) // readwrite so we can set commander's metalstorage at start of game .def_readwrite("energystorage", &UnitDef::energyStorage), // readwrite so we can set commander's energystorage at start of game
I´ve tried playing around with it, but I don´t really know how I would have to implement it. The bad news is, that I don´t have the impression that loosing your com means loosing your starting storage, as it does in normal games, so maybe this isn´t going to work anyhow :/ ...
Lua mission scriptin
Moderator: Moderators
As I said, forget those functions (no idea if they can work or not :D). Calling startscripts from script.txt for the world :D . Till the lobby supports that, I´ve made a template of a shortcut that could be distributed with missionscripts, that is pretty easy on endusers (only requires them to unzip correctly and double click shortcut, that should be managable :D ).
Regards Sean
Regards Sean