What are the Lua Bindings available?

miguelferreira

Chieftain
Joined
Oct 26, 2014
Messages
7
Hi,

I have been trying to come up with a new action (like Attack, Move, Alert, etc) but since the SDK only provides the Lua API (at least for now), the best I could get was this method in UnitPanel.lua :

HTML:
function OnUnitActionClicked( action )
	if bOkayToProcess then
		if (GameInfoActions[action].SubType == ActionSubTypes.ACTIONSUBTYPE_PROMOTION) then
			Events.AudioPlay2DSound("AS2D_INTERFACE_UNIT_UPGRADE_CONFIRM");	
		end
		Game.HandleAction( action );
    end
end

I can't find Game.handleAction anywhere so I am assuming that it is a global static method made available from the C++ side.

Event without access to the C++/DLL core I would like to try a full Lua approach to the problem.

Is there any way to find out what what C++ methods have been "binded" and therefore, are available to call from Lua?

Thank you,
 
The CivFanatics Civ5 LUA/UI Reference is an incredibly useful resource, and nearly all of it should be applicable to Beyond Earth.

The unit actions you're referring to are known internally as "Missions," so you'll want ACTIONSUBTYPE_MISSION

I'm not sure if hooking Game.HandleAction is going to helpful. Maybe you could let us know what you have in mind?

EDIT: For some reason Game.HandleAction is incorrectly specified as wanting a PolicyType parameter.
 
Top Bottom