• 🏆 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() faq

Status
Not open for further replies.
Level 17
Joined
Nov 13, 2006
Messages
1,814
[FAQ] GetLocalPlayer()

since dont see any thread what explain and give example what allowed and what make desync, i thought i open 1.

if it is completed i want make it like a tutorial or guide or something what usefull to everybody who never used this function on multiplayer maps, so please help me with answers or how to hint how to fix it and few suggestions also welcome.

- why usefull the the GetLocalPlayer() function?
- because have few thing in warcraft 3 editor, what applied to all player, example multiboard, if you show multiboard then it is visible to every player, you can't show different multiboard to each player without GetLocalPlayer() function

i list few thing:

1. Fade filters for 1 player only

Question - this cause desyncronization?
Answer - No - Credit to PurgeandFire111 http://www.hiveworkshop.com/forums/cinematics-268/tips-tricks-cinema-39854/#F

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test1 as An exact match
    • Conditions
    • Actions
      • Set TempForce = (All allies of Player 1 (Red))
      • Set AlphaReal = 100
      • Custom script: if IsPlayerInForce(GetLocalPlayer(),udg_TempForce) then
      • Set AlphaReal = 0
      • Custom script: endif
      • Cinematic - Fade out and back in over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with AlphaReal transparency



2. Quest for 1 player only?

Question - this cause desyncronization?
Answer - Yes but if u use Enable/Disable quest then No

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Quest - Create a Required quest titled Quest 1 - Killing q... with the description long long descripti..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
      • Quest - Disable (Last created quest)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Quest - Enable (Last created quest)
      • Quest - Flash the quest dialog button
      • Custom script: endif



3. Special effects, visibile for 1 player only?

Question - this cause desyncronization?
Answer - No - tested myself

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Set Unit = Peasant 0000 <gen>
      • Set Point = (Position of Unit)
      • Set String = <Empty String>
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Set String = Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Custom script: endif
      • Special Effect - Create a special effect at Point using String
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_Point)



4. Special effects attachment to unit, visibile for 1 player only?

Question - this cause desyncronization?
Answer - No - tested myself

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Set Unit = Peasant 0000 <gen>
      • Set String = <Empty String>
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Set String = Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Custom script: endif
      • Special Effect - Create a special effect attached to the overhead of Unit using String



5. Create floating texts/or show for 1 player only?

Question - this cause desyncronization?
Answer - No - tested myself

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Set Unit = Peasant 0000 <gen>
      • Set Point = (Position of Unit)
      • Set String = <Empty String>
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Set String = TEXT-TEXT-TEXT-TEXT
      • Custom script: endif
      • Floating Text - Create floating text that reads String at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Custom script: call RemoveLocation(udg_Point)



6. Unit color, transparancy, size/scale for 1 player only?

Question - this cause desyncronization?
Answer - No - tested myself

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Set Unit = Peasant 0000 <gen>
      • Set Alpha = 100
      • Custom script: if GetLocalPlayer() == udg_Player then
        • Set Alpha = 0
      • Custom script: endif
      • Animation - Change Unit's vertex coloring to (100%, 100%, 100%) with Alpha transparency



7. Fog of war and black mask, color, visibile for 1 player only?

Question - this cause desyncronization?
Answer - No - tested myself

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • Custom script: endif



8. Images, visibile for 1 player only?

Question - this cause desyncronization?
Answer - No
Alternative methode - If you set locally the transparency to 0 and to others 100% the transparency then that also dont cause desync tested myself

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Set String = <Empty String>
      • Set Point = (Target of current camera view)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Set String = ReplaceableTextures\Splats\AuraRune9b.blp
      • Custom script: endif
      • Image - Create an image using String of size 256.00 at Point with Z offset 0.00 using image type Indicator
      • Custom script: call RemoveLocation(udg_Point)




9. Sound & music, for 1 player only?

Question - this cause desyncronization?
Answer - i dont really was able to test it

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Sound - Play (Last played music)
      • Custom script: endif



10. Show Multiboard, for 1 player only?

Question - this cause desyncronization?
Answer - No - tested myself

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 1 columns and 2 rows, titled Multiboard
      • Multiboard - Hide (Last created multiboard)
      • Set Player = (Triggering player)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Multiboard - Show (Last created multiboard)
      • Custom script: endif



11. Trackables, for 1-2 player only?

Question - this cause desyncronization?
Answer - No - tested myself

JASS:
function Trig_Test_2_Actions takes nothing returns nothing
    local trackable t1 // Player 1's trackable
    local trackable t2 // Player 2's trackable
    local string peasant = "units\\human\\Peasant\\Peasant.mdl"
    local string invisible = ""
    local string path = invisible

    if ( GetLocalPlayer() == Player(0) ) then
        set path = peasant
    endif
    set t1 = CreateTrackable(path, -500, 0, 0)

    set path = invisible
    if ( GetLocalPlayer() == Player(1) ) then
        set path = peasant
    endif
    set t2 = CreateTrackable(path, -500, 0, 0)

    call SetHandleInt(t1, "player", 0) // Store which player "owns" this trackable
    call SetHandleInt(t2, "player", 1) // Same for player 2
endfunction

//===========================================================================
function InitTrig_Test_2 takes nothing returns nothing
    set gg_trg_Test_2 = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Test_2, Player(0), "test", true )
    call TriggerAddAction( gg_trg_Test_2, function Trig_Test_2_Actions )
endfunction



12. Pause the game, for 1 player only?

Question - this cause desyncronization?
Answer - Yes

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Game - Pause the game
      • Custom script: endif




13. Create different unit for player?

Question - this cause desyncronization?
Answer - Yes
Note - It might not desync if (1) it is a non hero unit and (2) the two units have only differences in art fields/physical display (such as model or icon) - by PurgeandFire111

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Set UnitType1 = No unit-type
      • Set UnitType2 = Peasant
      • Set UnitType3 = UnitType1
      • Set Point = (Target of current camera view)
      • Set Player = (Triggering player)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Set UnitType3 = UnitType2
      • Custom script: endif
      • Unit - Create 1 UnitType3 for Player at Point facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Point)



14. Weather effect off for 1 player?

Question - this cause desyncronization?
Answer - No - tested myself

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
      • Environment - Turn (Last created weather effect) On
      • Set Player = (Triggering player)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Environment - Turn (Last created weather effect) Off
      • Custom script: endif




15. Desctructible visibility, for 1 player only?

Question - this cause desyncronization?
Answer - No - tested myself

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Set Tree = Summer Tree Wall 0000 <gen>
      • Set Boolean = False
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Set Boolean = True
      • Custom script: endif
      • Custom script: call ShowDestructable(udg_Tree, udg_Boolean)


16. Unit positioning, for 1 player only?

Question - this cause desyncronization?
Answer - No - until unit dont got select hero/unit ability or got collision so this is usefull for visualization, only used for visual effects

  • Test 1
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Set Unit = Paladin001
      • Set X = 500
      • Set Y = 500
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Set X = 100
      • Set Y = 100
      • Custom script: endif
      • Custom script: call SetUnitPosition(udg_Unit, udg_X, udg_Y)
 
Last edited:
Level 12
Joined
Jul 11, 2010
Messages
422
Don't know how you tested wether it desyncs or not, but you're wrong in both case :p.

1. Fade filters for 1 player only

Question - this cause desyncronization?
Answer - No
This one desync because it creates and destroys timers. So you can't put those actions in a local block. It is still possible to make it in jass using the natives directly, though.

13. Weather effect off for 1 player?

Question - this cause desyncronization?
Answer - Yes
I am not sure it doesn't desync but I highly doubt it does. Several maps have a feature for using a local weather effect and this action is directly a native.

Otherwise, I don't see why you list all the actions possible and say if it desyncs or not. You should better list only the safe non-desyncing actions, no?

There are other things to say about your post (you can create/destroy texttags locally, you have put a "ShowUnit" in the last trigger, pausing game and disabling fog/mask locally will desync but you have other actions for that...).

Well, it still can come in handy. Good luck for that.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
1 - answered
2 - probably yes
3 - no
4 - no
5 - no
6 - possibly but not sure
6 fog - most likely no
7 - dunno but maybe no
8 - dunno
9 - wont desync, dota uses the same
10 - 0 experiences with trackables so dunno
11 - that most likely would smack your face to lobby(most likely yes)
12 - maybe no because you create the handle differently but it may desync upon interacing with the unit
13 - dunno
14 - should be possible so most likely no

Dangerous code within local code is mostly only when creating handles but things like pause game within local block may cause desync.

Those answers are not like I tested it :D just from looking at code so it may change when someone who actually tested it comes here
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
i changed the the numbers because i noticed have 2x 6. :D so ty every reply, and i am glad if i get more reply too if somebody tryed it, where still have "?"

@Tirlititi, right, i can list only what not desync but still hopeing maybe have solution for make it non desync. trigger
@about floating text, ok if i create it locally but still that visible to other players, no? lets say i want hide that floating text what is not visible to other players (point is fogger or black masked), how to do that?
@about filter, do you mean to this?
@what action have for replacing the fog/mask, show&hide unit thing? coz if i know make it transparent or add invisible ability with getlocalplayer also desync no?
JASS:
function CinematicFadeCommonBJ takes real red, real green, real blue, real duration, string tex, real startTrans, real endTrans returns nothing
    if (duration == 0) then
        // If the fade is instant, use the same starting and ending values,
        // so that we effectively do a set rather than a fade.
        set startTrans = endTrans
    endif
    call EnableUserUI(false)
    call SetCineFilterTexture(tex)
    call SetCineFilterBlendMode(BLEND_MODE_BLEND)
    call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
    call SetCineFilterStartUV(0, 0, 1, 1)
    call SetCineFilterEndUV(0, 0, 1, 1)
    call SetCineFilterStartColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100-startTrans))
    call SetCineFilterEndColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100-endTrans))
    call SetCineFilterDuration(duration)
    call DisplayCineFilter(true)
 
Level 12
Joined
Jul 11, 2010
Messages
422
For texttags : your method works without any flaw, but creating texttags locally has an additional purpose. You know that you can't create more than 100 texttags, right? Well then you create and destroy them locally, you will be able to use 100 texttags per player.

For cinematic filters, the GUI's action is not this but that :
JASS:
function CinematicFadeBJ takes integer fadetype, real duration, string tex, real red, real green, real blue, real trans returns nothing
    if (fadetype == bj_CINEFADETYPE_FADEOUT) then
        // Fade out to the requested color.
        call AbortCinematicFadeBJ()
        call CinematicFadeCommonBJ(red, green, blue, duration, tex, 100, trans)
    elseif (fadetype == bj_CINEFADETYPE_FADEIN) then
        // Fade in from the requested color.
        call AbortCinematicFadeBJ()
        call CinematicFadeCommonBJ(red, green, blue, duration, tex, trans, 100)
        call FinishCinematicFadeAfterBJ(duration)
    elseif (fadetype == bj_CINEFADETYPE_FADEOUTIN) then
        // Fade out to the requested color, and then fade back in from it.
        if (duration > 0) then
            call AbortCinematicFadeBJ()
            call CinematicFadeCommonBJ(red, green, blue, duration * 0.5, tex, 100, trans)
            call ContinueCinematicFadeAfterBJ(duration * 0.5, red, green, blue, trans, tex)
            call FinishCinematicFadeAfterBJ(duration)
        endif
    else
        // Unrecognized fadetype - ignore the request.
    endif
endfunction
There are several problems for using the natives. I didn't see any ressource in the jass section for that but I guess it would be good to make one (unless there is in wc3c or anywhere else).

The show/hide unit will desync in most case (there are some specific cases in which it can be used and usefull, though, there are threads about it). But I wanted to point out the fact you're using a "ShowUnit" in your trigger about "Show Destructables". The fog mask can be replaced with the action :
  • Visibility - Create Visibility Modifier Region
which has a similar purpose.

I think the answers would be more like :
1. Desync the way it is written
2. Desync the way it is written (use "Enable/Disable Quest" instead)
3. No desync
4. No desync
5. No desync but there is a better way to do it
6. Only Show/Hide desyncs
7. Desync the way it is written
8. No desync
9. No desync in most cases
10. No desync
11. EDIT: no, I don't think it desyncs, actually. That's a thing to check.
12. Desync
13. Desync
14. No desync in my opinion
15. Dunno but I think I've recently read it didn't desync. I guess it all depends on wether the pathing is preserved or not.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
For texttags : your method works without any flaw, but creating texttags locally has an additional purpose. You know that you can't create more than 100 texttags, right? Well then you create and destroy them locally, you will be able to use 100 texttags per player.

For cinematic filters, the GUI's action is not this but that :
JASS:
function CinematicFadeBJ takes integer fadetype, real duration, string tex, real red, real green, real blue, real trans returns nothing
    if (fadetype == bj_CINEFADETYPE_FADEOUT) then
        // Fade out to the requested color.
        call AbortCinematicFadeBJ()
        call CinematicFadeCommonBJ(red, green, blue, duration, tex, 100, trans)
    elseif (fadetype == bj_CINEFADETYPE_FADEIN) then
        // Fade in from the requested color.
        call AbortCinematicFadeBJ()
        call CinematicFadeCommonBJ(red, green, blue, duration, tex, trans, 100)
        call FinishCinematicFadeAfterBJ(duration)
    elseif (fadetype == bj_CINEFADETYPE_FADEOUTIN) then
        // Fade out to the requested color, and then fade back in from it.
        if (duration > 0) then
            call AbortCinematicFadeBJ()
            call CinematicFadeCommonBJ(red, green, blue, duration * 0.5, tex, 100, trans)
            call ContinueCinematicFadeAfterBJ(duration * 0.5, red, green, blue, trans, tex)
            call FinishCinematicFadeAfterBJ(duration)
        endif
    else
        // Unrecognized fadetype - ignore the request.
    endif
endfunction
There are several problems for using the natives. I didn't see any ressource in the jass section for that but I guess it would be good to make one (unless there is in wc3c or anywhere else).

The show/hide unit will desync in most case (there are some specific cases in which it can be used and usefull, though, there are threads about it). But I wanted to point out the fact you're using a "ShowUnit" in your trigger about "Show Destructables". The fog mask can be replaced with the action :
  • Visibility - Create Visibility Modifier Region
which has a similar purpose.

I think the answers would be more like :
1. Desync the way it is written
2. Desync the way it is written (use "Enable/Disable Quest" instead)
3. No desync
4. No desync
5. No desync but there is a better way to do it
6. Only Show/Hide desyncs
7. Desync the way it is written
8. No desync
9. No desync in most cases
10. No desync
11. EDIT: no, I don't think it desyncs, actually. That's a thing to check.
12. Desync
13. Desync
14. No desync in my opinion
15. Dunno but I think I've recently read it didn't desync. I guess it all depends on wether the pathing is preserved or not.

@unit show hide, i dont really got any thread where usefull and dont make desync :/
also watched somewhere a Full screen Shop (via destructibles) and for make space on map, at map init the destructibles are hided, i just curios really if show/hideing destructibles, i can make somehow for dont desync?

2. if i enable/disable quest in GetLocalPlayer if, then it dont make desync and also will be visible or hidden to others? (so its same like when i disable a ability then look like not exist, if i disable the quest then quest will be "removed" from quest list?)

also Flash the quest button dont make desync right? :D
(updated the 2.)
5. i never heard about that 100 text limit, if we talk lets say about a damage detection system where after every damage created 4 floating text then not hard to make too many floating text, what happen if will be too many ft? lagg or simple dont created the next ft after the 100th?
u can tell me more... if i use text tag with velocity and lifespan, still i must destroy it each time?
6. unit color/tranparency [animation - vertex color] also desync?

@more about floating text

i write out the damages in DDS with this function
JASS:
function FT_Ex takes string txt, real fsize, unit u, integer speed, integer red, integer green, integer blue, integer alpha, integer dir returns nothing
    local real x
    local real y
    local real diff
    local texttag tt
    if IsUnitVisible(u, GetLocalPlayer()) then
    set x = GetUnitX( u )
    set y = GetUnitY( u )
        set diff = StringLength( txt ) * fsize / 2.00 + 1
        set tt = CreateTextTag( )
        call SetTextTagText( tt, txt, fsize * 0.023 )
        call SetTextTagPos( tt, x - diff, y, 100.00 )
        call SetTextTagColor( tt, red, green, blue, alpha )
        call SetTextTagPermanent( tt, false )
        call SetTextTagLifespan( tt, 4.50 )
        call SetTextTagFadepoint( tt, 2.50 )
        set x = speed * 0.71 / 128
        call SetTextTagVelocity( tt, x * Cos( dir * bj_DEGTORAD ), x * Sin( dir * bj_DEGTORAD ) )
        set tt = null
    endif
endfunction
i moved few thing inside the if coz i thought this way will be faster coz if point not visible to localplayer then dont need to calculate numbers etc, how can i improve it? or i must move out everything outside and in if i set only the string value and if point is invisible then i show empty string to local player?
 
1. You can check this out:
http://www.hiveworkshop.com/forums/cinematics-268/tips-tricks-cinema-39854/#F

2. if i enable/disable quest in GetLocalPlayer if, then it dont make desync and also will be visible or hidden to others? (so its same like when i disable a ability then look like not exist, if i disable the quest then quest will be "removed" from quest list?)

also Flash the quest button dont make desync right? :D

Yes it will be hidden to others. And no, the flash quest button does not desync.

Btw, change the "Disable Quest" within the GetLocalPlayer() block in your example to "Enable Quest". Otherwise it is only disabling it.

5. i never heard about that 100 text limit, if we talk lets say about a damage detection system where after every damage created 4 floating text then not hard to make too many floating text, what happen if will be too many ft? lagg or simple dont created the next ft after the 100th?
u can tell me more... if i use text tag with velocity and lifespan, still i must destroy it each time?

Er if I remember correctly there will be some handle stack problems. So basically you will lose reference to certain objects because there will end up being texttags under the same ID. Something along those lines, I don't remember exactly.

But you can create texttags directly within a local player block. They are allocated on a separate handle stack. While we are unsure whether that is the exact cause of it being desync-safe, we know that it is a characteristic of the few types that are desync-safe.

6. unit color/tranparency [animation - vertex color] also desync?

No. But I believe the shadow will still show up and the unit will be selectable.

JASS:
function FT_Ex takes string txt, real fsize, unit u, integer speed, integer red, integer green, integer blue, integer alpha, integer dir returns nothing
    local real x
    local real y
    local real diff
    local texttag tt
    if IsUnitVisible(u, GetLocalPlayer()) then
    set x = GetUnitX( u )
    set y = GetUnitY( u )
        set diff = StringLength( txt ) * fsize / 2.00 + 1
        set tt = CreateTextTag( )
        call SetTextTagText( tt, txt, fsize * 0.023 )
        call SetTextTagPos( tt, x - diff, y, 100.00 )
        call SetTextTagColor( tt, red, green, blue, alpha )
        call SetTextTagPermanent( tt, false )
        call SetTextTagLifespan( tt, 4.50 )
        call SetTextTagFadepoint( tt, 2.50 )
        set x = speed * 0.71 / 128
        call SetTextTagVelocity( tt, x * Cos( dir * bj_DEGTORAD ), x * Sin( dir * bj_DEGTORAD ) )
        set tt = null
    endif
endfunction
i moved few thing inside the if coz i thought this way will be faster coz if point not visible to localplayer then dont need to calculate numbers etc, how can i improve it? or i must move out everything outside and in if i set only the string value and if point is invisible then i show empty string to local player?

You can create it safely inside the block. All the operations you performed are desync-safe, so it is fine the way it is.

For 11: It won't desync. Check out:
http://www.hiveworkshop.com/forums/jass-resources-412/system-track-205760/
That method that you've described is essentially the method I use and I've tested it to work online.

For 13: It might not desync if (1) it is a non hero unit and (2) the two units have only differences in art fields/physical display (such as model or icon)

It would be something to test. Someone made a function for it a while back and said the circumstances in which it works.

For 15: I am pretty sure it is just a matter of pathing as Tirlitti said. It definitely won't desync right away. In fact, you can just move the ShowDestructable into the block. (no need for boolean variable) I've tried it with destructables for full screen systems and it works 100% but for destructables with pathing idk. I haven't tried it.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
1. quest, ok i need enable disable for be the trigger desync safe but what if i want change the quest description/type/name etc?
i mean if have a multiplayer map, 4 player exist, 2 st pick the quest and appear the quest at quest button (so player 3/4 dont see it because disabled for them), but if player 1 kill a mob and i change the q description or mark quest to be completed then it is also changed to player 2 too even he only started, so what player 1 doing will be effected to player 2 quest and invers...
i must do quest array then and disable if player(i=1 to 11) != TriggerPlayer()?

2. destructible show/hide
so if i want make the full screen equipment system with destructables and show hide, then i must create example every destructable with weapon model and show only the equiped weapon/destructable type, somehow like this?
(pathing mean destructible with collision/path blocking or the raw code when i create one?)

  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to (Random integer number between 7 and 13), do (Actions)
        • Loop - Actions
          • Set Point = (Random point in Region 000 <gen>)
          • Destructible - Create a Summer Tree Wall at Point facing (Random angle) with scale 1.00 and variation 0
          • Set Tree1_Index = (Tree1_Index + 1)
          • Set Tree1[Tree1_Index] = (Last created destructible)
          • Custom script: call RemoveLocation(udg_Point)
          • Destructible - Hide (Last created destructible)
      • For each (Integer A) from 1 to (Random integer number between 7 and 13), do (Actions)
        • Loop - Actions
          • Set Point = (Random point in Region 000 <gen>)
          • Destructible - Create a Barrens Tree Wall at Point facing (Random angle) with scale 1.00 and variation 0
          • Set Tree2_Index = (Tree2_Index + 1)
          • Set Tree2[Tree2_Index] = (Last created destructible)
          • Custom script: call RemoveLocation(udg_Point)
          • Destructible - Hide (Last created destructible)

y, u told dont need the boolean but still dont changed on the presentation/test map
JASS:
function Trig_Hide_trees_Actions takes nothing returns nothing
    local boolean b1 = true
    local boolean b2 = false
    local boolean b = b2
    local integer i
    local integer a
    local player p1 = Player(0)
    local player p2 = Player(1)

    set i = 1
    loop
        exitwhen i == udg_Tree1_Index
        if GetLocalPlayer() == p1 then
            set b = b1
        endif
        call ShowDestructable(udg_Tree1[i], b)
        set i = i + 1
    endloop
    set b = b2
    set i = 1
    loop
        exitwhen i == udg_Tree2_Index
        if GetLocalPlayer() == p2 then
            set b = b1
        endif
        call ShowDestructable(udg_Tree2[i], b)
        set i = i + 1
    endloop
endfunction

//===========================================================================
function InitTrig_Hide_trees takes nothing returns nothing
    set gg_trg_Hide_trees = CreateTrigger( )
    call TriggerRegisterTimerEventSingle( gg_trg_Hide_trees, 0.50 )
    call TriggerAddAction( gg_trg_Hide_trees, function Trig_Hide_trees_Actions )
endfunction

3. floating text, what i wrote is desync safe, right?
so if i put inside the getlocalplayer if the function call what call that function what i wrote, that also desync safe right? (like call FT ( "+" + I2S(i) + " gold", 1.5, u, 6, 255, 255, 0, 200)), because example i dont want show the text to other player than trigger player
 

Attachments

  • showDestructible.w3x
    17.5 KB · Views: 317
Level 14
Joined
Apr 20, 2009
Messages
1,543
Wow, This is... (cough! cough!) awesome.

I don't like your sarcasm.
Where are your test results on desynchronization?
Don't mock someone for trying to contribute to society.

This thread is useful IMO.
And I seriously hope that there will be a full documentation of test results on desync's some day (including explenations).
+rep to shadowvzs for his results so far.
 
Level 11
Joined
Jun 15, 2011
Messages
447
I don't like your sarcasm.
Where are your test results on desynchronization?
Don't mock someone for trying to contribute to society.

Oh, I never meant to be sarcastic... But if it looked like that, then I apologize, I will never cough again (cough!) oops :thumbs_up:

Anyway, I turned back the time to change my first reply, it is now "smile" "smile". (I don't know how it looked like sarcastic, really)
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
If it's not sarcasm, then what is the intention of coughing in the first place (or smiling) in this case?
Sorry for going off-topic I'll stop posting after this.
 
Level 11
Joined
Jun 15, 2011
Messages
447
If it's not sarcasm, then what is the intention of coughing in the first place (or smiling) in this case?
Sorry for going off-topic I'll stop posting after this.

It's just my (cough!) style! And I swear to you, to everyone in here, and to the almighty king Arthas and that sexy Sorceress, I'm not trying to be sarcastic... I turned the time back again and edited my first post (I removed the "cough and smile" for you, if that'll make you happy)... Yeah you're right, this is off-topic now (cough!)... Gotta stop (cough!) sending replies now...

About the Local Player test result, I already made one for myself, the SFX attachment visible to certain players only... I did it because of the curiousity, after seeing it in DotA (the Gem of True Sight's magic sentry effect)
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
useing getlocalplayer like array index also dont desync, right?

i mean to this
JASS:
//Camera_Lock = boolean variable array
  if not udg_Camera_Lock[GetPlayerId(GetLocalPlayer())+1] then
    call ShowDestructable(d, false)
  endif
 
Level 4
Joined
May 2, 2011
Messages
40
Creating images locally do not desync, but what about if they are already created and I want to change their "show/hide" property? For example, if I want an image created only for player 1 to be seen by player 2 for a short period, and later make it appear only for player 1 again? What about if they're always moving all over the map like lifebars? Changes anything?
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Creating images locally do not desync, but what about if they are already created and I want to change their "show/hide" property? For example, if I want an image created only for player 1 to be seen by player 2 for a short period, and later make it appear only for player 1 again? What about if they're always moving all over the map like lifebars? Changes anything?

i am curious too to something like this, coz i can hide a interface from doodas but remain the image there, so need solution for enable/disable it if possible, because could be better than recreate allways 12 (1 image for 1 player)
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
bump!

somebody can test it with 2 user player coz i can't :D
http://www.hiveworkshop.com/forums/pastebin.php?id=vczydq

this contain enough getlocalthing :D

Well I didn't desynch so that's a good thing, however.
It's impossible for the second player to do anything with the trackables.
Plus the trackables that are selected by the first player are shown to the second player.
Are they locally created for player 1 only? I haven't really checked the script as of yet.

EDIT: ah I see now. I think you have to do it the other way around: make the string empty at first and then fill it with data if it's the local player.
This way player 2 won't see player 1's trackables. However then there is still the problem that it's not created for player 2.
I think it might have to do something with the condition. I'll check it out for you.

By the way are you okay with it if I recreate this system in vJass using some of your code for my upcomming map?
I really like the way you did this system. I just want to improve it a bit on a few things ;)
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
u can set the trackable path locally in getlocalplayer if, that dont cause desync and since trackable with "" path = unclickable its mean u can create trackable for each player :p

It's impossible for the second player to do anything with the trackables.
Plus the trackables that are selected by the first player are shown to the second player.
Are they locally created for player 1 only? I haven't really checked the script as of yet.
u tested that?

when i created it was only for player 1 but after that, in posted link must work for all player :/

u can show screenshot with both players if player 1 open the inventory?
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Not sure, but maybe you can even create trackables in a local block, because the event is already local since it's about the mouse.
It all depends how trackables are handled in the wc3 engine. (own handle id stack or not)

Good call, I'm gonna check that out :)

EDIT: yeah doing it the other way around worked like expected.
If you make the string empty at first and then fill it with data it will be created locally.
Checking for custom handle counter right now.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
idk why couldt stack this


JASS:
function CreateTrackableAll takes destructable d, integer slot returns nothing
    local string path = "Track.mdx"
    local real x = GetDestructableX(d)
    local real y = GetDestructableY(d) - 20
    local real x1 = LoadReal(udg_Inv_Slots, 0, 1)
    local real y1 = LoadReal(udg_Inv_Slots, 0, 2)
    local real shiftY = (y - y1) / 16
    local real z = 0
    local real face = 0
    local integer id
    local integer a = 0
    local player p
    local trackable tr
    loop
        exitwhen a > 11
        set p = Player(a)
        if GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(p) == MAP_CONTROL_USER then
            if GetLocalPlayer() != p then
                set path = ""
            endif
            set tr = CreateTrackable( path, x, y + shiftY, face )
            set id = GetHandleId(tr)
            call SaveInteger(udg_Track_Table, id, 1, a)
            call SaveInteger(udg_Track_Table, id, 2, slot)
            call TriggerRegisterTrackableHitEvent(gg_trg_ClickToTrackable, tr)
            call TriggerRegisterTrackableTrackEvent(gg_trg_OnTrackable, tr)
        endif
        set a = a + 1
    endloop
endfunction
JASS:
function Trig_ClickToTrackable_Actions takes nothing returns nothing
    local integer id = GetHandleId(GetTriggeringTrackable())
    local integer slot = LoadInteger(udg_Track_Table, id, 2)
    local integer pl = LoadInteger(udg_Track_Table, id, 1) + 1
endfunction
function InitTrig_ClickToTrackable takes nothing returns nothing
    set gg_trg_ClickToTrackable = CreateTrigger( )
    call TriggerAddAction( gg_trg_ClickToTrackable, function Trig_ClickToTrackable_Actions )
endfunction


whatever, somebody said i can fill the variable and make it empty if it isn't local player so idk now why have anyway difference between
s = ""
if getlocalplayer = player(0) then
set s = "2"
endif
and between this

s="2"
if getlocalplayer != player(0) then
set s = ""
endif

EDIT: ah I see now. I think you have to do it the other way around: make the string empty at first and then fill it with data if it's the local player.
This way player 2 won't see player 1's trackables. However then there is still the problem that it's not created for player 2.
I think it might have to do something with the condition. I'll check it out for you.

so interface not created to player 2 if he click to inventory ability or just no showed?

here the intergace part, so destructibles are same to each player but show/hided locally
JASS:
function CWInterface takes nothing returns nothing
    local integer i = 0
    local destructable d
    local integer alpha = 0
    local boolean b = false
    local unit u = LoadUnitHandle(udg_Inv_Slots, 550, 0)

    loop
        set d = LoadDestructableHandle(udg_Inv_Slots, 0, 200 + i)
        exitwhen i > 303
        if udg_Camera_Lock[GetPlayerId(GetLocalPlayer()) + 1] then
            set b = true
        endif
        call ShowDestructable(d, b)
        set i = i + 1
    endloop

    set i = 1
    loop
        set d = LoadDestructableHandle(udg_Inv_Slots, i, 0)
        exitwhen i > 303
        if udg_Camera_Lock[GetPlayerId(GetLocalPlayer()) + 1] then
            set b = true
        endif
        call ShowDestructable(d, b)
        set i = i + 1
        if i == 12 then
            set i = 100
        elseif i == 120 then
            set i = 200
        elseif i == 206 then
            set i = 300
        endif
    endloop
    if udg_Camera_Lock[GetPlayerId(GetLocalPlayer()) + 1] then
        set alpha = 255
    endif
    call SetUnitVertexColor(u, 255, 255, 255, alpha)
    set u = null
    set d = null
endfunction
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
idk why couldmt stack this


JASS:
function CreateTrackableAll takes destructable d, integer slot returns nothing
    local string path = "Track.mdx"
    local real x = GetDestructableX(d)
    local real y = GetDestructableY(d) - 20
    local real x1 = LoadReal(udg_Inv_Slots, 0, 1)
    local real y1 = LoadReal(udg_Inv_Slots, 0, 2)
    local real shiftY = (y - y1) / 16
    local real z = 0
    local real face = 0
    local integer id
    local integer a = 0
    local player p
    local trackable tr
    loop
        exitwhen a > 11
        set p = Player(a)
        if GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(p) == MAP_CONTROL_USER then
            if GetLocalPlayer() != p then
                set path = ""
            endif
            set tr = CreateTrackable( path, x, y + shiftY, face )
            set id = GetHandleId(tr)
            call SaveInteger(udg_Track_Table, id, 1, a)
            call SaveInteger(udg_Track_Table, id, 2, slot)
            call TriggerRegisterTrackableHitEvent(gg_trg_ClickToTrackable, tr)
            call TriggerRegisterTrackableTrackEvent(gg_trg_OnTrackable, tr)
        endif
        set a = a + 1
    endloop
endfunction
JASS:
function Trig_ClickToTrackable_Actions takes nothing returns nothing
    local integer id = GetHandleId(GetTriggeringTrackable())
    local integer slot = LoadInteger(udg_Track_Table, id, 2)
    local integer pl = LoadInteger(udg_Track_Table, id, 1) + 1
endfunction
function InitTrig_ClickToTrackable takes nothing returns nothing
    set gg_trg_ClickToTrackable = CreateTrigger( )
    call TriggerAddAction( gg_trg_ClickToTrackable, function Trig_ClickToTrackable_Actions )
endfunction




so interface not created to player 2 if he click to inventory ability or just no showed?

It's working as I expected when doing this instead shadowvzs:

JASS:
local string path = ""
    //local string path = "Track.mdx"
    local real x = GetDestructableX(d)
    local real y = GetDestructableY(d)-20
    local real x1 = LoadReal(udg_Inv_Slots, 0, 1)
    local real y1 = LoadReal(udg_Inv_Slots, 0, 2)
    local real shiftY = (y-y1)/16
    local real z = 0
    local real face = 0
    local integer id
    local integer a = 0 
    local player p
    //local destructable d
    local trackable tr
    loop
    exitwhen a > 11
    set p = Player(a)
    if GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(p) == MAP_CONTROL_USER then
          if GetLocalPlayer() == p then
             set path = "Track4.mdx"
          endif
         // set d = CreateDestructableZ( 'OTip', x, y, z, 0.00, 1, 0 )
          set tr = CreateTrackable( path, x, y+shiftY, face )

I'm gonna check if it has a custom handle counter and see if it's possible to create them within the local block.

EDIT: seemed like it didn't have it's own counter it started somewhere around 104900, testing right now if I can create them locally without desynchs.

EDIT2: Sadly, no I couldn't create them locally. It started to lag immensely, even the host started to lag and then it DC'd me, not the host.
So yeah you can create the trackables locally, but they will need to be created through the string method (which is not that much of a drawback I suppose)
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
i got problem with variable depend unit vertex coloring where the index is the localplayer id...

so when every player have a boolean variable array (camera_lock[1-12]) and i want set the transparency to 100% if
JASS:
    set alpha = 0
    if udg_Camera_Lock[GetPlayerId(GetLocalPlayer())+1] then
      set alpha = 255
   endif
   call SetUnitVertexColor(u, 255, 255, 255, alpha)

because if player 2 do it then player 1 still see it the unit even camera_lock[1] = false and only camera_lock[2] is true :/

only way is pick all player whos boolean array is true into a group and check if local player is in group?
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
It's good to try something like that, but theories are theories, practice is practice.
I mean you need to test all the codes before valid them, else this thread just doesn't worth it.

few of them i tested myself, now i updated what i tested and i will test later the others coz now work the virtualbox :)

ok weird but i made a quick test and enable/disable weather effect, fog of war/blackmask dont caysed anyproblem to me, so both work locally

and here the result http://www.hiveworkshop.com/forums/spells-569/advanced-mpi-full-screen-inventory-226199/#post2250041
 
Last edited:
Level 14
Joined
Apr 20, 2009
Messages
1,543
I haven't tried it with: SetUnitPosition()

But I guess it works the same way as SetUnitX() and SetUnitY()

What I do like to tell you is: put it inside the local code.
It's safe to do this:

JASS:
if GetLocalPlayer() == Player(0) then
    call SetUnitX(u, x)
    call SetUnitY(u, y)
endif

As long as the unit can not be interacted with by any player this should work fine.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
I haven't tried it with: SetUnitPosition()

But I guess it works the same way as SetUnitX() and SetUnitY()

What I do like to tell you is: put it inside the local code.
It's safe to do this:

JASS:
if GetLocalPlayer() == Player(0) then
    call SetUnitX(u, x)
    call SetUnitY(u, y)
endif

As long as the unit can not be interacted with by any player this should work fine.

you should really try to avoid function calls in local blocks as much as possible.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
you should really try to avoid function calls in local blocks as much as possible.
In this case it doesn't matter since it doesn't cause a desync in any way.

And sometimes it's even better to have function calls inside the local block. (just be sure to know what you are doing)
With for example custom handle Id stacks, as you should then create the handle locally instead of only showing it locally.
Which obviously has the potential of extending counter limits since the handle counts for each local player instead of globally for all players.


EDIT: if you set variables locally for a player and then later on (without setting them globally) use these same variables inside conditions, this could give problems (possible desyncs) since they are set differently for each player. Using a function call in this case is actually better since conflicts can not occur later on.
 
Last edited:
Level 4
Joined
Jan 7, 2011
Messages
72
OK, so it is possible to hide / show destructibles for specific players without causing desyncs.

How about destroying / reviving destructibles (specifically, pathing blockers) for specific players without casing desyncs?
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
i am pretty sure creating any object cause desync but i never tested but anyway, why u need it? u can just set locally the pathblocker position so like for player 1 to right coordinate and for others set the coord. outside of the map
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
i am pretty sure creating any object cause desync but i never tested

Not if that object has it's own handle stack.
(gets custom handle ID's appointed instead of from the handle table)
Floating texts for example have their own handle stack ranging from 99 to 0.

(only 100 floating texts can be displayed at a time, but since we can create them locally we could create 100 floating texts for each player instead of 100 floating texts globally)
I suppose this is done by blizzard because floating texts can not be interacted with by other players.

The first test I usually do to check if it has it's own handle stack is display the handle ID.
(check if it doesn't have some high number, but just a simple counter)
If it does, this usually means you can create the object locally.
It's simple to then test if it actually can be created locally.
All you need to do is check if you desync when the object is created locally. (multiplayer ofc)
 
Last edited:
Level 4
Joined
Jan 7, 2011
Messages
72
I want to create a two-storey building with a passage on the bottom floor running beneath two rooms on the top floor. I need units on the bottom floor to be able to walk down the passage unhindered while units on the top floor are blocked by room walls.

If I create pathing blockers for the walls of the two rooms, then units on the top floor won't be able to walk through the walls. However, some of those pathing blockers will also block units on the bottom floor from walking down the passage.

I was hoping to disable the pathing blockers for units on the ground floor (so that they can walk down the passage) while keeping them active for units on the top floor (so that they can't walk through the walls of the rooms).

Are you saying that I could move the pathing blockers for some units while keeping them in place for other units without creating any desyncs?
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
@Galatius:

Since units can interact with the objects (walk against it), the game would detect a desync when a pathing blocker is positioned differently for a local player if a unit where to move against (or even on creation of) that pathing blocker.

This is what I assume will happen (I haven't done any tests yet).
It should be fairly simple to test this with a friend or a virtual machine (right shadowvzs ;D?).

Unless destructables have their own handle stack (which I doubt), it would be possible to create them locally for a player.

What you might want to do is use a floor system like this:
Multi-Floor System
In order to simulate 3D pathing.
 
Level 4
Joined
Jan 7, 2011
Messages
72
Thanks for the link, Hashjie. However, given the OP's comments in that forum thread, it appears to come with its own set of problems.

Assuming it is impossible to destroy / revive / move pathing blockers for specific players without creating a desync, my backup plan is to place small regions on either side of the pathing blocker and simply move units between them. It's not ideal, but given that the pathing block gap is very small, the undesirable "teleportation" effect should be minimal.
 
Level 4
Joined
Jan 7, 2011
Messages
72
Thanks for the link to your thread, Hashjie. I briefly went through it and a lot of it went over my head, so I'll have a more proper go at it later.

Do units with collisions turned off pass through pathing blockers? If so, what if I temporarily turned off collisions for units that I wanted to pass through the pathing blocker? Obviously this would need to be done carefully to ensure that the no-collision trigger is strictly limited to that specific pathing blocker, but I imagine that should be possible with sensible use of regions. Thoughts?
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
@off but Hash why dont tryed remake that map?

I might still do that later on, but as of now I have way to much on my mind to worry about :(

Thanks for the link to your thread, Hashjie. I briefly went through it and a lot of it went over my head, so I'll have a more proper go at it later.

That's fine, math can be quite annoying to do sometimes ;)

Do units with collisions turned off pass through pathing blockers?

I beleave they do. (I have no confirmation on that, I'll get back to you later on that subject)

If so, what if I temporarily turned off collisions for units that I wanted to pass through the pathing blocker? Obviously this would need to be done carefully to ensure that the no-collision trigger is strictly limited to that specific pathing blocker, but I imagine that should be possible with sensible use of regions. Thoughts?

It is impossible to check if a destructable is in range of a unit in order to put a region on top of the pathing blocker. So unless you know which pathing blocker the unit walks against (or have the co-ordinates of all pathing blockers) you would have to create a region for each pathing blocker. Which might be a bit inefficient if you ask me :/.

However this might actually be quite a good idea, but I'm not sure what problems you're going to run into since I haven't tried it myself yet. EDIT: I did what shadowvzs described below...
If you try to create something first (since I'm kind of bussy doing other stuff right now) and it doesn't work out or if you have any problems, I'm going to give it a try too.
But first I'm working on re-creating the unit selection circle in wc3 with my custom library.

Also, I think we are going off-topic so it would be nice if we could discuss this in either private matter or in a different topic.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Thanks for the link to your thread, Hashjie. I briefly went through it and a lot of it went over my head, so I'll have a more proper go at it later.

Do units with collisions turned off pass through pathing blockers? If so, what if I temporarily turned off collisions for units that I wanted to pass through the pathing blocker? Obviously this would need to be done carefully to ensure that the no-collision trigger is strictly limited to that specific pathing blocker, but I imagine that should be possible with sensible use of regions. Thoughts?

just a ideea, since u have ground, air and both pathing blocker, u could put ground pathblocker and change unit movement type to flying with adding/removeing crowform
(maybe work)
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
just a ideea, since u have ground, air and both pathing blocker, u could put ground pathblocker and change unit movement type to flying with adding/removeing crowform
(maybe work)

Yeah I tried the same thing and it does work but I personally had some problems with occlusion height.

EDIT: we are really going off-topic here xD This has nothing to do with desyncs anymore.
 
Level 4
Joined
Jan 7, 2011
Messages
72
Sorry for de-railing the thread :p

One last quick contribution: I tried the collision trigger and it works perfectly. As long as you set your regions carefully, there should be no problem having units walking through pathing blockers while other units on a different vertical plane remain blocked.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Sorry for de-railing the thread :p

One last quick contribution: I tried the collision trigger and it works perfectly. As long as you set your regions carefully, there should be no problem having units walking through pathing blockers while other units on a different vertical plane remain blocked.

Transition between the vertical plane works fine too? (even with occlusion height when it's inbetween cliffs?)
Now what if I don't want to use pathing blockers because they require a grid? ^.^ (I know, I'm a b!tch)
That was the question I asked myself when trying to do it with any custom shape.

Also: remember that the ground units should have no interaction with the "flying" units.
Can the units give items to each other?
Can the units hit each other with spells?
Can the units attack each other, heal each other etc?

If you could fix those problems, you would have a really unique floor system and it would be a really nice resource for this community.
(it would be even better if it where to have efficient performance and usability)

Still though, this is pretty impressive. But do be reminded that this can also be done with flying pathing blockers like shadowvzs suggested.
+rep for getting your system to work.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
About moving the unit locally, does a locust unit fire the events enter/leave a region ?
I think they trigger the event "enter within in range" (i mean if they are the unit used with the event), so no it should not be 100 % safe.
And what about a GroupEnumUnitInRect ?
And ofc such units can't attack and so one.

An interesting check, test if start a new thread locally does desync by itself or not (use a ForForce to display a text message in a local block)
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
About moving the unit locally, does a locust unit fire the events enter/leave a region ?
I think they trigger the event "enter within in range" (i mean if they are the unit used with the event), so no it should not be 100 % safe.

And what about a GroupEnumUnitInRect ?
And ofc such units can't attack and so one.

But that's regardless of moving the unit locally.
That's only because the unit has locust. And since you need to use locust in order to use this it is indeed a deprecation.
But if it's only used for visual effects, why would you need the unit groupenum and enters/leave a region if all you do is move it around?
You can link the unit's positions since you're triggering it anyways.
Just link it through indexing, structs or a hashtable should be fine IMO :/.

But yes you are right, this should be mentioned as people could spend tons of time figuring out why their locust unit can't be picked or used inside picking events.

An interesting check, test if start a new thread locally does desync by itself or not (use a ForForce to display a text message in a local block)

I would if I had time to do it. But not right now, I'm kinda bussy :/
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
About moving the unit locally, does a locust unit fire the events enter/leave a region ?
They do. If you filter out these units with conditions, would it still desync?
I think they trigger the event "enter within in range" (i mean if they are the unit used with the event)
Yes, but since they're only used for visual effects, this should never be the case.
And what about a GroupEnumUnitInRect ?
The GroupEnums who do pick locusts are not bound to their locations (so InRect and InRange do not pick them).

Still, be careful with it :).
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
EDIT : I'm answering to Hashjie there :

No you don't get it, i'm asking if a locust unit can fire some events, and then the event will fire only locally -> desync.

And i'm 100 % sure that you can enum a locust unit with GroupEnumUnitInRect, again enumed for the player X but not the player Y -> likely to desync.

Also because the unit will have different positions for each player it can't interact at all (attack, cast an ability, ...)

ap0calypse said:
They do. If you filter out these units with conditions, would it still desync?

The problem is that the trigger will fire locally, maybe it already desync by itself.

Yes, but since they're only used for visual effects, this should never be the case.

Yep, but it must be mentionned in the FAQ.

The GroupEnums who do pick locusts are not bound to their locations (so InRect and InRange do not pick them).

Wrong, i'm sure that GroupEnumUnitInRect enum locust units, but yes inRange don't enum them.
 
Status
Not open for further replies.
Top