- Joined
- Feb 27, 2019
- Messages
- 401
Hello,
In my map I have the following trigger as part of a shop system :
Maybe because I remove the sold unit inside a callback trigger on unit sold event ?
Explaination notes:
- There is a visible shop that sells units (1 unit = 1 item category: weapons, shields, wand...), and 6 dummy units at the same position that sell the items (one dummy unit per item category).
- When the player clicks a category in the visible shop, the trigger executes. I use the sold unit-type to retrieve the good dummy unit & select it. Thus the player can buy the items of this category.
Edit : I think it did not desync before Reforged release..
In my map I have the following trigger as part of a shop system :
-
Open List
-
Events
-
Unit - A unit Sells a unit
-
-
Conditions
-
(Level of Select Hero [Arrow] for (Triggering unit)) Not equal to 0
-
-
Actions
-
-------- Open List --------
-
Set VariableSet POINT = (Position of (Triggering unit))
-
Set VariableSet UG = (Units within 0.01 of POINT matching ((Unit-type of (Matching unit)) Equal to (Unit-type of (Sold unit))).)
-
Selection - Select UG for (Owner of (Buying unit))
-
Unit - Remove (Sold unit) from the game
-
Custom script: call DestroyGroup(udg_UG)
-
Custom script: call RemoveLocation(udg_POINT)
-
-
Maybe because I remove the sold unit inside a callback trigger on unit sold event ?
Explaination notes:
- There is a visible shop that sells units (1 unit = 1 item category: weapons, shields, wand...), and 6 dummy units at the same position that sell the items (one dummy unit per item category).
- When the player clicks a category in the visible shop, the trigger executes. I use the sold unit-type to retrieve the good dummy unit & select it. Thus the player can buy the items of this category.
Edit : I think it did not desync before Reforged release..
Attachments
Last edited: