Angelusz
New Member
- Reaction score
- 2
[Resolved][Question] Order redirection crashes Wc3
For a warcraft III map, I'm creating a system to have a "party interface".
Each player has only one hero. When all players have selected their heroes, the system spawns a dummy unit for each hero for each player (none for their own heroes).
One trigger periodically (1sec) updates the dummy's hp and mana to reflect that of the corresponding ally's (up to this, it works fine).
Now, I'm trying to make it possible to both select and target the allied heroes, using the dummies.
Here I run into problems. Selecting is possible, but it behaves unexpectedly at times. As for the redirecting of orders, it's horrible.
Since my knowledge with JASS is very limited, I decided to write this in the GUI, using a custom script to change the unit's order. Here's the code:
This, however, causes the game to close down immediately.
I've checked all the variables and they seem to be declared and set properly.
As for the dummy units, I've reset them to being normal units (with a model, no abilities like locust/invulnerability, no classifications).
Who has an idea why this crashes the game? (Yes, it currently links back to the first unit for testing purposes, is that a problem?)
EDIT: DOH, resolved. Turns out that the game does crash because I direct it towards the same unit again. Didn't expect that, since I order a "stop" first, but that was it.
For a warcraft III map, I'm creating a system to have a "party interface".
Each player has only one hero. When all players have selected their heroes, the system spawns a dummy unit for each hero for each player (none for their own heroes).
One trigger periodically (1sec) updates the dummy's hp and mana to reflect that of the corresponding ally's (up to this, it works fine).
Now, I'm trying to make it possible to both select and target the allied heroes, using the dummies.
Here I run into problems. Selecting is possible, but it behaves unexpectedly at times. As for the redirecting of orders, it's horrible.
Since my knowledge with JASS is very limited, I decided to write this in the GUI, using a custom script to change the unit's order. Here's the code:
Trigger:
- Event Issued order Object
- Events
- Unit - A unit Is issued an order targeting an object
- Conditions
- Actions
- Set Tempunit = (Ordered unit)
- Set Tempunit_2 = (Target unit of issued order)
- Set Temporder = (Issued order)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Or - Any (Conditions) are true
- Conditions
- (Unit-type of Tempunit_2) Equal to Palath the Enlightened (Dummy)
- (Unit-type of Tempunit_2) Equal to Metal Fist Tony (Dummy)
- (Unit-type of Tempunit_2) Equal to Khersana Swiftmend (Dummy)
- Conditions
- Or - Any (Conditions) are true
- Then - Actions
- Unit - Order Tempunit to Stop
- Custom script: call IssueTargetOrderById(udg_Tempunit, udg_Temporder, udg_Tempunit_2)
- Else - Actions
- If - Conditions
- Events
This, however, causes the game to close down immediately.
I've checked all the variables and they seem to be declared and set properly.
As for the dummy units, I've reset them to being normal units (with a model, no abilities like locust/invulnerability, no classifications).
Who has an idea why this crashes the game? (Yes, it currently links back to the first unit for testing purposes, is that a problem?)
EDIT: DOH, resolved. Turns out that the game does crash because I direct it towards the same unit again. Didn't expect that, since I order a "stop" first, but that was it.