Lua mission scriptin - Page 2

Lua mission scriptin

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

SeanHeron wrote:Ok I was wrong, the cmdrscript starts with loads of resources as well. However I did find this:

Code: 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
in the Luabinder.cpp
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 :/ ...
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
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

Post by SeanHeron »

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
Post Reply

Return to “Lua Scripts”