Hi guys!
It's me... Again!!!
I've remade the spell i've made to spawn 3 (or the number you choose in trigger editor) electric orbs at once.
Now I cant get the spell to function properly at the first cast and when it does works everything is like sped up x3 (orbs move in hyperspeed ._.).
Heres the triggers:
Initial trigger
Periodic event trigger:
I removed some parts from the periodic event (I want to focus on orbiting only first). The way I create the units should be in the same way as the first try but I have a new way of putting the units there.
I've also set a custom value to the casting unit to make identyfing easier.
The messages are there to help me but they didn't help me in the end .
Help to solve my predicament would be greatly appreciated as I problably would have to abandon this spell if its not solved .
Cheers tastyfishes!
It's me... Again!!!
I've remade the spell i've made to spawn 3 (or the number you choose in trigger editor) electric orbs at once.
Now I cant get the spell to function properly at the first cast and when it does works everything is like sped up x3 (orbs move in hyperspeed ._.).
Heres the triggers:
Initial trigger
Code:
Orbital 3and3
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to test three
Actions
-------- Checks if Orbital_CustomValue is less then 1000, if not it resets it to 1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Orbital_CV Less than 1000
Then - Actions
Set Orbital_CV = (Orbital_CV + 1)
Else - Actions
Set Orbital_CV = 1
-------- Setting variables --------
Unit - Set the custom value of Orbital_Caster[Orbital_CV] to Orbital_CV
Set Orbital_Caster[Orbital_CV] = (Triggering unit)
Set Orbital_CasterCV[Orbital_CV] = (Custom value of Orbital_Caster[Orbital_CV])
Set Orbital_DmgRange[Orbital_CV] = 100.00
Set Orbital_MaxProjectiles[Orbital_CV] = 3
Set Orbital_Angle[Orbital_CV] = 90.00
Set Orbital_ProjectileRange[Orbital_CV] = 200.00
Set Orbital_CurrentDuration[Orbital_CV] = 0.00
Set Orbital_MaxDuration[Orbital_CV] = 15.00
Set Orbital_temppt = (Position of Orbital_Caster[Orbital_CV])
Game - Display to (All players) the text: (String(Orbital_CasterCV[Orbital_CV]))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Orbital_CasterCV[Orbital_CV] Equal to 0
Then - Actions
For each (Integer A) from 1 to Orbital_MaxProjectiles[Orbital_CV], do (Actions)
Loop - Actions
Unit - Create 1 Electric Ball for (Owner of (Triggering unit)) at (Orbital_temppt offset by Orbital_ProjectileRange[Orbital_CV] towards ((Real((Integer A))) x (360.00 / (Real(Orbital_MaxProjectiles[Orbital_CV])))) degrees) facing Orbital_temppt
Unit - Set the custom value of (Last created unit) to Orbital_CasterCV[Orbital_CV]
Unit - Pause (Last created unit)
Unit - Turn collision for (Last created unit) Off
Unit Group - Add (Last created unit) to Orbital_UnitGroup
Unit Group - Add (Last created unit) to Orbital_ProjectileGroup[Orbital_CV]
Unit - Set the custom value of Orbital_Caster[Orbital_CV] to Orbital_CV
Else - Actions
Unit Group - Pick every unit in Orbital_ProjectileGroup[Orbital_CasterCV[Orbital_CV]] and do (Actions)
Loop - Actions
Unit - Remove (Picked unit) from the game
For each (Integer A) from 1 to Orbital_MaxProjectiles[Orbital_CV], do (Actions)
Loop - Actions
Unit - Create 1 Electric Ball for (Owner of (Triggering unit)) at (Orbital_temppt offset by Orbital_ProjectileRange[Orbital_CV] towards ((Real((Integer A))) x (360.00 / (Real(Orbital_MaxProjectiles[Orbital_CV])))) degrees) facing Orbital_temppt
Unit - Set the custom value of (Last created unit) to Orbital_CasterCV[Orbital_CV]
Unit - Pause (Last created unit)
Unit - Turn collision for (Last created unit) Off
Unit Group - Add (Last created unit) to Orbital_UnitGroup
Unit Group - Add (Last created unit) to Orbital_ProjectileGroup[Orbital_CasterCV[Orbital_CV]]
Custom script: call RemoveLocation (udg_Orbital_temppt)
Periodic event trigger:
Code:
Orbital Effect 3and3
Events
Time - Every 0.04 seconds of game time
Conditions
(Number of units in Orbital_UnitGroup) Greater than 0
Actions
Unit Group - Pick every unit in Orbital_UnitGroup and do (Actions)
Loop - Actions
Set Orbital_tempinteger = (Custom value of (Picked unit))
Game - Display to (All players) the text: (String(Orbital_tempinteger))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Orbital_CurrentDuration[Orbital_tempinteger] Greater than or equal to Orbital_MaxDuration[Orbital_tempinteger]
Then - Actions
Game - Display to (All players) the text: Deleting stuff
Unit - Remove (Picked unit) from the game
Else - Actions
Game - Display to (All players) the text: moving stuff
-------- Moves the orbital unit --------
Unit Group - Pick every unit in Orbital_ProjectileGroup[Orbital_tempinteger] and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to ((Position of Orbital_Caster[Orbital_tempinteger]) offset by Orbital_ProjectileRange[Orbital_tempinteger] towards ((Angle from (Position of Orbital_Caster[Orbital_tempinteger]) to (Position of (Picked unit))) + 5.00) degrees)
-------- Sets current duration +0.04 --------
Set Orbital_CurrentDuration[Orbital_tempinteger] = (Orbital_CurrentDuration[Orbital_tempinteger] + 0.04)
I removed some parts from the periodic event (I want to focus on orbiting only first). The way I create the units should be in the same way as the first try but I have a new way of putting the units there.
I've also set a custom value to the casting unit to make identyfing easier.
The messages are there to help me but they didn't help me in the end .
Help to solve my predicament would be greatly appreciated as I problably would have to abandon this spell if its not solved .
Cheers tastyfishes!