• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

GetLocalPlayer() and AddLightning()

Status
Not open for further replies.
Level 9
Joined
Nov 28, 2008
Messages
704
I'm trying to create a simple "location" spell for a map. I am using a camera centered one one unit, and the minimap is hidden for various reasons. Thus, it seemed to be mt he best way to detect and find other units would be to create a lightning from the caster to the other units in the map.

What I have works perfectly, except I''m sort of worried about using an AddLightning() inside of a GetLocalPlayer() block.

Would this desync? It didn't seem to in my tests.

JASS:
        if GetLocalPlayer() == ID then
            set Ray[i] = AddLightning("CLPB", false, GetUnitX(Caster), GetUnitY(Caster), GetUnitX(Unit), GetUnitY(Unit))
            call SetLightningColor(Ray[i], ColorCodesRed[Target], ColorCodesGreen[Target], ColorCodesBlue[Target], 230)
        endif

Should I be using inside the GetLocalPlayer block just setting a string to "CLPB", then creating the lightning out of it?
 
Level 9
Joined
Nov 28, 2008
Messages
704
Thank you very much. I've tested it with another person, and neither desynced, and it seems the majority say they do not.

If anyone could explain a "pseudo handle" I'd be much indebted.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
They are not normal handles. Normal handles share indexes, eg an index can one moment be a unit, but if the unit is removed a destructable or location can reuse that index.

Floating text uses a fixed 100 sized range of indexes reserved specificly for them. Only floating text may use those indexes. Also floating text can not leak more than 100 times, afterwhich the last one is simply recycled.

Lightning is very simlar.

You may also create local effects with in reason I believe.

As far as I know, handle indexes do not really cause desyncs as long as you create objects for all players. You can however only display them to one player, which is how local multiboards are done and local effects.
 
Level 14
Joined
Nov 18, 2007
Messages
816
Erm, pseudo handles.

The list of those is rather long, but most of them arent used anyway (like playerevent and so on)

The ones that might be used, that i know of are pseudo handles are:
JASS:
image // very useful, although tricky to use
lightning //
ubersplat // have not found any good application for those yet
texttag //
weathereffect // this is the worst pseudo handle blizzard implemented, imo. Do NOT try to use it, unless you have lots of time and a good resource on the bugs with this handle.

Pseudo handles each have their own stack (meaning, H2I() on them returns a value around 0, not around 0x100000). All of them are not relevant to actual gameplay (they cant infulence the outcome of the game).
 
Last edited:
Status
Not open for further replies.
Top