- Joined
- Jan 9, 2005
- Messages
- 2,126
Is there any way to retrieve the Tree of Life that's connected to an Entangled Gold Mine? I've tried using ConstructEvent but it appears Entangled Gold Mines are somewhat special.
Here's my code, currently:
NB: I'm not particularly good with events in JASS, so if the custom events from ConstructEvent will help, can anyone help me with those?
Here's my code, currently:
JASS:
function Generate_Extraction_Field_Actions takes nothing returns boolean
local unit building = GetTriggerUnit()
local unit worker = GetStructureBuilder(building)
if GetUnitTypeId(building) == 'e000' then
call BJDebugMsg("test")
call AddSpecialEffectLocBJ( GetUnitLoc(worker), "Abilities\\Spells\\NightElf\\Starfall\\StarfallCaster.mdl" ) //just a test; this checks if the game is detecting the worker.
call SetUnitX(worker, GetUnitX(building))
call SetUnitY(worker, GetUnitY(building))
endif
set worker = null
set building = null
return false
endfunction
//===========================================================================
function InitTrig_Generate_Extraction_Field takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_CONSTRUCT_START)
call TriggerAddCondition(t, Condition( function Generate_Extraction_Field_Actions))
set t = null
endfunction
NB: I'm not particularly good with events in JASS, so if the custom events from ConstructEvent will help, can anyone help me with those?