emootootoo
Top Banana
- Reaction score
- 51
So basically the trigger loops through all the units with the QuestGiver ability on the map, and sets up their structs. It also makes the TalkToMeGREY.mdx model above the units head.
It works fine, besides the fact that one unit never gets the model above its head. I made text tags to show me the order in which the units are looped through, and depending on how many units with the ability are on the map, the number in the order of which the unit does not get the effect over its head changes.
I have absolutely no idea why one unit that isn't even at the start or end of the loop does not get the effect over its head. Oh and yes, the unit that doesn't get the effect over its head does get the text tag, which means it SHOULD be creating an effect, but it doesn't!
Any idea what is going on here?
It works fine, besides the fact that one unit never gets the model above its head. I made text tags to show me the order in which the units are looped through, and depending on how many units with the ability are on the map, the number in the order of which the unit does not get the effect over its head changes.
I have absolutely no idea why one unit that isn't even at the start or end of the loop does not get the effect over its head. Oh and yes, the unit that doesn't get the effect over its head does get the text tag, which means it SHOULD be creating an effect, but it doesn't!
Any idea what is going on here?
JASS:
struct QuestData
integer array count[7]
integer array count2[7]
integer array count3[7]
//-----------------------
integer array status[7]
effect array sfx[7]
boolean array avail[7]
integer level
boolean chain
endstruct
function Trig_Quests_Init_Actions takes nothing returns nothing
local QuestData d
local group g=CreateGroup()
local unit u
local integer i=7
local string s=" "
local integer poo=0
call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,null)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if GetUnitAbilityLevel(u,039;A014039;)>0 then
set poo=poo+1
call CreateTextTagLocBJ(I2S(poo),GetUnitLoc(u),0,50,255,255,255,100) // use this to show you the number of quest giver
set d=QuestData.create()
call SetUnitUserData(u,d)
loop
exitwhen i<0
if GetLocalPlayer()==Player(i) then
set s="TalkToMeGREY.mdx"
endif
set d.sfx<i>=AddSpecialEffectTarget(s,u,"overhead")
if GetLocalPlayer()==Player(i) then
set s=" "
endif
set i=i-1
endloop
set i=7
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set g=null
set s=null
endfunction
//===========================================================================
function InitTrig_Quests_Init takes nothing returns nothing
set gg_trg_Quests_Init = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Quests_Init, 0.00 )
call TriggerAddAction( gg_trg_Quests_Init, function Trig_Quests_Init_Actions )
endfunction</i>