- Joined
- May 24, 2016
- Messages
- 339
Hello, I have encountered a moment I got desynced suddenly from the rest 9 players.
From what I have seen in replay, I got desynced when I casted a spell and killed 10 mobs at time.
It's not an unusual thing in my map to happen: killing a few dozens of mobs in a moment.
But at that game I have given me a special "perk": creating a floating text and giving money for killing mobs.
Here's the fragment of UNIT_DIES even where's my perk takes its turn.
When I tested it out it's still fine, so I dunno maybe Im wrong.
And yeahm you could see AddEffectTimeToPoint here. Here's how it looks like
From what I have seen in replay, I got desynced when I casted a spell and killed 10 mobs at time.
It's not an unusual thing in my map to happen: killing a few dozens of mobs in a moment.
But at that game I have given me a special "perk": creating a floating text and giving money for killing mobs.
Here's the fragment of UNIT_DIES even where's my perk takes its turn.
JASS:
set S = ""
set Ss = ""
if timeperm > 665. then // timeperm is global variable that stores game time, nothing tricky here
set golddigger = golddigger * 2 // a local integer golddigger, it was predeclared ago so it's atleast set to 0
endif
if GetLocalPlayer() == Player(clot) // clot is local integer // set clot = GetPlayerId(GetOwningPlayer(k))
set S = "Item_GoldCoins.mdx" // global variable string S, I like global variables that way so i dont declare it every time in every trigger
set Ss = "+ "+I2S(golddigger) // global variable string Ss, I like global variables that way so i dont declare it every time in every trigger
endif
call SetPlayerState(Player(clot),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(clot),PLAYER_STATE_RESOURCE_GOLD) + golddigger)
call AddEffectTimeToPoint(S,GetUnitX(d),GetUnitY(d),1.5) //2.5
set TX = CreateTextTag() //TX is global variable texttag, I like global variables that way so I dont declare it every time in every trigger
call SetTextTagColor(TX, 255, 255, 0, 250) //250
call SetTextTagTextBJ(TX, Ss, 10 ) //13
call SetTextTagPos(TX, GetUnitX(d), GetUnitY(d), 20) //25
call SetTextTagVelocity(TX, 0.00, 0.02) //0.06 0.04
call SetTextTagPermanent(TX, FALSE)
call SetTextTagLifespan(TX, 2.3)
//call SetTextTagAge(TX,0.8)
call SetTextTagFadepoint(TX, 1.2)
When I tested it out it's still fine, so I dunno maybe Im wrong.
And yeahm you could see AddEffectTimeToPoint here. Here's how it looks like
JASS:
function DestroyEffectTimeToPoint takes nothing returns nothing
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(GetExpiredTimer()),1))
call DestroyTimer(GetExpiredTimer())
call FlushChildHashtable(Hash,GetHandleId(GetExpiredTimer()))
endfunction
function AddEffectTimeToPoint takes string eff, real x, real y,real time returns nothing
local timer t = CreateTimer()
call SaveEffectHandle(Hash,GetHandleId(t),1,AddSpecialEffect(eff,x,y))
call TimerStart(t,time,false, function DestroyEffectTimeToPoint)
set t = null
endfunction
Last edited: