Hi guys..
I'm creating a map, in the script file i want to catch a build event :
When a player creates/builds something, i would like to call a function to do something else...
Any help ?
Thanks
Forged Alliance Forever Forums
Moderator: Morax
Supreme Commander - Forged Alliance\gamedata\lua.scd\lua\ScenarioFramework.lua
function CreateUnitBuiltTrigger( cb, unit, category )
TriggerFile.CreateUnitBuiltTrigger( cb, unit, category )
end
local ScenarioFramework = import('/lua/ScenarioFramework.lua')
ScenarioFramework.CreateUnitBuiltTrigger( cb, unit, category )
Supreme Commander - Forged Alliance\gamedata\lua.scd\lua\scenariotriggers.lua
function OnStart(self)
ScenarioFramework.CreateUnitBuiltTrigger( cb, unit, category )
end
cb = function(cb, unit, category)
BroadcastMSG("Well done !", 8);
end
function OnStart(self)
ScenarioFramework.CreateUnitBuiltTrigger(YourFunctionName, unit, categories.FACTORY * categoriesTECH1)
end
function YourFunctionName()
BroadcastMSG("Well done !", 8);
end
Users browsing this forum: No registered users and 1 guest