Kayoss666
Member
- Reaction score
- 7
i had this working in gui but i am trying to learn more about jass so i copied then converted but after trying to change all the commands to natives it doesn't work.
the gui version
the code in native jass
the gui version
Trigger:
- StoreCreeps
- Events
- Time - Elapsed game time is 5.00 seconds
- Conditions
- Actions
- Custom script: call DestroyGroup(udg_Creep_Group)
- Set Creep_Group = (Units owned by Neutral Hostile)
- Unit Group - Pick every unit in Creep_Group and do (Actions)
- Loop - Actions
- Set Creep_Count = (Creep_Count + 1)
- Set Creep_Start_Position[Creep_Count] = (Position of (Picked unit))
- Unit - Set the custom value of (Picked unit) to Creep_Count
- Loop - Actions
- Events
the code in native jass
JASS:
library True initializer Init
globals
boolexpr TrueCnd
endglobals
private function True takes nothing returns boolean
return true
endfunction
private function Init takes nothing returns nothing
set TrueCnd = Condition(function True)
endfunction
endlibrary
function Trig_StoreCreeps_Copy_2_Func002A takes nothing returns nothing
call GroupAddUnit( udg_Creep_Group, GetEnumUnit() )
set udg_Creep_Count = ( udg_Creep_Count + 1 )
set udg_Creep_Start_Position[udg_Creep_Count] = GetUnitLoc(GetEnumUnit())
call SetUnitUserData( GetEnumUnit(), udg_Creep_Count )
endfunction
function Trig_StoreCreeps_Copy_2_Actions takes nothing returns nothing
call DestroyGroup(udg_Creep_Group)
//***
call GroupEnumUnitsOfPlayer(udg_Creep_Group, Player(PLAYER_NEUTRAL_AGGRESSIVE), TrueCnd)
call ForGroup( udg_Creep_Group, function Trig_StoreCreeps_Copy_2_Func002A )
//*** i believe that my problem is here. before trying to make it native commands it was
//set udg_Creep_Group = GetUnitsOfPlayerAll(Player(PLAYER_NEUTRAL_AGGRESSIVE))
//call ForGroupBJ( udg_Creep_Group, function Trig_StoreCreeps_Copy_Copy_Func003A )
endfunction
//===========================================================================
function InitTrig_StoreCreeps_Copy_2 takes nothing returns nothing
set gg_trg_StoreCreeps_Copy_2 = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_StoreCreeps_Copy_2, 0.10, false )
call TriggerAddAction( gg_trg_StoreCreeps_Copy_2, function Trig_StoreCreeps_Copy_2_Actions )
endfunction