- Joined
- Dec 13, 2018
- Messages
- 2,365
Hey this seems interesting. Can you elaborate a bit more on this part?
I see in your example map that your function returns
, which is a table type variable. I have a single player offline map where I just want to set one unit to be the movement unit. Let's say my unit variable is udg_Hero. How can I set the movement unit for player 0 to be this unit? I'm not that versed in Lua and struggle to figure it out. In your "Test Map" script you're running a function on init that sets a local variable equal to GetPrePlacedWidget("Hvwd"), but changing this to be local sylvanas = udg_Hero does not seem to work, but rather breaks the function operations, stopping the function from running altogether.
So yeah, my question is basically if you can provide a simple "explain it like I'm 5" explanation on how to get this working. It would be much appreciated.
Here's what I did, that didn't work:
edit the GetHeroOfPlayer function to return the main hero of each player
I see in your example map that your function returns
Code:
return FCL_Anchor[whichPlayer]
So yeah, my question is basically if you can provide a simple "explain it like I'm 5" explanation on how to get this working. It would be much appreciated.
Here's what I did, that didn't work:
Lua:
EnableMovementUnit = function()
local sylvanas = udg_Adevramies
FCL_Lock(sylvanas)
EnableRPGControls(Player(0))
EnableSelect(false, false)
SelectUnitSingle(sylvanas)
end
-
Enable Movement Unit
-
Events
- Time - Elapsed game time is 1.00 seconds
- Conditions
-
Actions
- Custom script: EnableMovementUnit()
-
Events
Last edited: