Posted: 12 Feb 2007, 09:44
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 :/ ...