- Joined
- Nov 18, 2012
- Messages
- 311
how to ping every doodad on the map?
Im not sure how to ping doodads, so far i can only ping units in the map
Im not sure how to ping doodads, so far i can only ping units in the map
call EnumDestructablesInRect(GetEntireMapRect(), null, function PingSelectedDestructable)
call EnumDestructablesInRect(GetWorldBounds(), null, function PingSelectedDestructable)
//If you use "null" for a boolexpr argument it actually causes a memory leak.
//Dumb bug, but to fix it you just need one global function that always returns true.
//Something like Rising_Dusk's GroupUtils includes this automatically so instead of "Filter(AlwaysTrue)" below you would use "BOOLEXPR_TRUE".
function AlwaysTrue takes nothing returns boolean
return true
endfunction
function PingSelectedDestructable takes nothing returns nothing
local destructable d = GetEnumDestructable()
call PingMinimap(GetDestructableX(d), GetDestructableY(d), DURATION)
//could use PingMinimapEx() to get colors and other effects too
set d = null
endfunction
//...
call EnumDestructablesInRect(bj_playableMapRect, Filter(AlwaysTrue), function PingSelectedDestructable)
function PingSelectedDestructable takes nothing returns @boolean@
local destructable d = GetEnumDestructable()
call PingMinimap(GetDestructableX(d), GetDestructableY(d), DURATION)
//could use PingMinimapEx() to get colors and other effects too
set d = null
@ return false@
endfunction
//...
call EnumDestructablesInRect(bj_playableMapRect, Filter(PingSelectedDestructable), null)
//Fairly certain you don't have to worry about leaks from passing null codes, though I could be wrong.
Not possible. Doodads do not really exist as far as game state goes.how to ping every doodad on the map?
Could hit operation limits. Might be wise to break maps into segments and run the search on each segment.Pick all destructables in map
ping for player X at location of picked destructable
With the action that makes a ping? In GUI it might involve cleaning up location leaks.still has no idea how to ping them
At some stage some boffins from WC3Campagins said that null boolexprs leaks. It is not that boolexprs leak, just the functions that use them leak if they are passed null. The leak is completely trivial outside of dynamic use cases because it is mostly generated once at map initialization during trigger initialization. It might have been patched, I never really kept track of it as WC3 suffers far worse leaks.I think the null boolexpr has been patched out, and even if not Nes says in this thread that the same boolexpr is used and new ones are not created for each call.
I think it is higher than 16... Probably either 32 or 64. Might be affected by other mini-map icons (maybe its a limit to mini-map overlays). Could also be due to thread crashes caused by operation limits of finding so many possible targets to ping, as was once experienced with the "Parasite" map series.I forgot the actual amount but it was definately lower than 15.
yeah i already cleaned the location leaks, need to ping only for specific players lol, any idea how to do that, ForGroup works?With the action that makes a ping? In GUI it might involve cleaning up location leaks.