- Joined
- Nov 4, 2019
- Messages
- 407
I have posted something similar to this before, but this time it has nothing to do with my character selection and save/load system. Creating units on the map results in different unit handles at some point = desync.
Though, this time I disabled everything related to the save/load and character selection... and units are still created with different handles, even when just respawning them.
Here's a video link of what happens:
Twitch
Here is my trigger and script:
I'm starting to think the desyncs are caused by Lua not being implemented properly, because this shouldn't happen.
Though, this time I disabled everything related to the save/load and character selection... and units are still created with different handles, even when just respawning them.
Here's a video link of what happens:
Twitch
Here is my trigger and script:
-
Creep Dies
-

Events
-


Unit - A unit owned by Neutral Hostile Dies
-
-

Conditions
-


(Custom value of (Triggering unit)) Not equal to -1
-
-

Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Level of (Triggering unit)) Less than or equal to 5
-
-



Then - Actions
-




Set VariableSet RandomInteger = (Random integer number between 1 and 100)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






RandomInteger Less than or equal to 7
-
-





Then - Actions
-






Set VariableSet Point = (Position of (Triggering unit))
-






Item - Create Lesser Healing Potion at Point
-






Custom script: RemoveLocation(udg_Point)
-
-





Else - Actions
-
-
-



Else - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Level of (Triggering unit)) Less than or equal to 10
-
-





Then - Actions
-






Set VariableSet RandomInteger = (Random integer number between 1 and 100)
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








RandomInteger Less than or equal to 7
-
-







Then - Actions
-








Set VariableSet Point = (Position of (Triggering unit))
-








Item - Create Greater Healing Potion at Point
-








Custom script: RemoveLocation(udg_Point)
-
-







Else - Actions
-
-
-





Else - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Level of (Triggering unit)) Less than or equal to 15
-
-







Then - Actions
-








Set VariableSet RandomInteger = (Random integer number between 1 and 100)
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










RandomInteger Less than or equal to 7
-
-









Then - Actions
-










Set VariableSet Point = (Position of (Triggering unit))
-










Item - Create Major Healing Potion at Point
-










Custom script: RemoveLocation(udg_Point)
-
-









Else - Actions
-
-
-







Else - Actions
-
-
-
-
-
-


Custom script: CreepRespawn()
-
-
Lua:
function CreepRespawn()
local unitType = GetUnitTypeId(GetTriggerUnit())
local customValue = GetUnitUserData(GetTriggerUnit())
local player = GetOwningPlayer(GetTriggerUnit())
PolledWait(GetRandomInt(20, 30))
CreateUnitAtLocSaveLast(player, unitType, udg_Creep_Point[customValue], GetRandomInt(0, 359))
SetUnitUserData(bj_lastCreatedUnit, customValue)
BJDebugMsg("Creep ID: " .. GetHandleIdBJ(bj_lastCreatedUnit))
end
I'm starting to think the desyncs are caused by Lua not being implemented properly, because this shouldn't happen.





