FroznYoghurt
New Member
- Reaction score
- 37
Game Shutdown due to Pausing a Channeling Unit
Ok im working on this spell, it's a channeling spell where the caster is sposed to freeze, then unfreeze when he stops casting. To get a flow with the anims I used a "Copy" unit wich is a locust with the exact same model as the caster.
The looks came out fine, the problem is that after the spell is over I either loose control over the hero confused or the game shuts down (instantly, no error message) the next time I try to use the spell (prob due to infinite loop).
The code is easy as pie:
If I remove the "pause unit" it works fine but I kinda want it since the Hero wont excecute his animation otherwise
Is there a way to do this without gamecrash?
And yes the variable "Caster" is specified
(Been absent for a while hope that dosen't keep you from lending me a hand with this )
(PS. How do you post code the fancy way? Fixed )
Ok im working on this spell, it's a channeling spell where the caster is sposed to freeze, then unfreeze when he stops casting. To get a flow with the anims I used a "Copy" unit wich is a locust with the exact same model as the caster.
The looks came out fine, the problem is that after the spell is over I either loose control over the hero confused or the game shuts down (instantly, no error message) the next time I try to use the spell (prob due to infinite loop).
The code is easy as pie:
Trigger:
- Starts Channeling
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Spell
- Actions
- Set TempPoint = (Position of (Triggering unit))
- Set ISChanneling = True
- Unit - Turn collision for (Triggering unit) Off
- Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 99.99% transparency
- Unit - Create 1 Copy for (Owner of (Triggering unit)) at TempPoint facing (Facing of (Triggering unit)) degrees
- Unit - Move (Last created unit) instantly to TempPoint
- Animation - Play (Last created unit)'s attack animation
- Set Copy = (Last created unit)
- Custom script: call RemoveLocation(udg_TempPoint)
- Wait 0.20 seconds
- Animation - Change Copy's animation speed to 0.00% of its original speed
- Events
Trigger:
- Stops Channeling
- Events
- Unit - A unit Stops casting an ability
- Unit - A unit Finishes casting an ability
- Conditions
- ISChanneling Equal to True
- Actions
- Set ISChanneling = False
- Unit - Pause Caster
- Animation - Play Caster's attack animation
- Wait 0.20 seconds
- Unit - Turn collision for Caster On
- Animation - Change Caster's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
- Unit - Remove Copy from the game
- Wait 0.50 seconds
- Unit - Unpause Caster
- Events
If I remove the "pause unit" it works fine but I kinda want it since the Hero wont excecute his animation otherwise
Is there a way to do this without gamecrash?
And yes the variable "Caster" is specified
(Been absent for a while hope that dosen't keep you from lending me a hand with this )
(PS. How do you post code the fancy way? Fixed )