- Joined
- Jun 20, 2013
- Messages
- 769
Hello, i'm using Hanky dynamic index template to learn how to create MUI spells and got a problem with one of the examples.
The idea is to create a Missile to ground spell using a dummy to cast Cluster of Rockets in the main trigger, then move the dummy and apply two different types of damage and debuff, based on being units or buildings on the second trigger.
Here is the modified spell, it works mostly well. It created a dummy, it shots the ground at the proper place, it applies different damages to units and buildings.
The problems are that the AOE of 200, in the triggers don't hit anything, it need to increased to like 1000 to be able to hit all units inside a 200 selection circle. This also creates lag during the first firing, bigger the number, bigger the jump. Another problem is that the dummy don't attack buildings to apply freezing breath, i've pasted the attack data of the Wyrm on the dummy to not avail.
Example Spell
-
StartMissile
-
Acontecimientos
-
Unidad - A unit Inicia el efecto de una habilidad
-
-
Condiciones
-
(Ability being cast) Igual a Test-It (Enjambre Carroñero)
-
-
Acciones
-
-------- IMPORTANT SYSTEM PART START --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si: Condiciones
-
SPELL_Index_Size Igual a 0
-
-
Entonces: Acciones
-
Detonador - Turn on MissileLoop <gen>
-
-
Otros: Acciones
-
-
-------- Increase the index size --------
-
Set SPELL_Index_Size = (SPELL_Index_Size + 1)
-
-------- Dynamic Index --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si: Condiciones
-
SPELL_Index_Size Mayor que SPELL_Index_maxSize
-
-
Entonces: Acciones
-
Set SPELL_Index[SPELL_Index_Size] = SPELL_Index_Size
-
Set SPELL_Index_maxSize = SPELL_Index_Size
-
-
Otros: Acciones
-
-
-------- Dynamic Index End --------
-
-------- IMPORTANT SYSTEM PART END --------
-
Set TempInt = SPELL_Index[SPELL_Index_Size]
-
-------- Setup those arrays --------
-
Set TempLoc = (Position of (Triggering unit))
-
Set TempLoc2 = (Target point of ability being cast)
-
Set SPELL_CASTER[TempInt] = (Triggering unit)
-
Unidad - Create 1 Dummy (Misiile 1) for Neutral pasivo at TempLoc facing (Angle from TempLoc to TempLoc2) degrees
-
Unidad - Turn collision for (Last created unit) Apagado
-
Unidad - Move (Last created unit) instantly to TempLoc
-
Set SPELL_MISSILE[TempInt] = (Last created unit)
-
Set SPELL_ANGLE[TempInt] = (Angle from TempLoc to TempLoc2)
-
Set SPELL_SPEED[TempInt] = 5.00
-
Set SPELL_DUR[TempInt] = 10.00
-
Custom script: call RemoveLocation(udg_TempLoc)
-
Custom script: call RemoveLocation(udg_TempLoc2)
-
-
-
MissileLoop
-
Acontecimientos
-
Tiempo - Every 0.03 seconds of game time
-
-
Condiciones
-
Acciones
-
For each (Integer SPELL_LOOP) from 1 to SPELL_Index_Size, do (Actions)
-
Bucle: Acciones
-
-------- This let look everything cleaner. --------
-
Set TempInt = SPELL_Index[SPELL_LOOP]
-
-------- Condition... --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si: Condiciones
-
SPELL_DUR[TempInt] Mayor que 0.00
-
-
Entonces: Acciones
-
-------- Actions --------
-
Set TempLoc = (Position of SPELL_MISSILE[TempInt])
-
Set TempLoc2 = (TempLoc offset by SPELL_SPEED[TempInt] towards SPELL_ANGLE[TempInt] degrees)
-
Unidad - Move SPELL_MISSILE[TempInt] instantly to TempLoc2, facing SPELL_ANGLE[TempInt] degrees
-
Custom script: set bj_wantDestroyGroup=true
-
Grupo de unidad - Pick every unit in (Units within 200.00 of TempLoc2) and do (Actions)
-
Bucle: Acciones
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si: Condiciones
-
(SPELL_CASTER[TempInt] belongs to an enemy of (Owner of (Picked unit))) Igual a True
-
-
Entonces: Acciones
-
Unidad - Cause SPELL_CASTER[TempInt] to damage (Picked unit), dealing 75.00 damage of attack type Conjuros and damage type Normal
-
Set SPELL_DUR[TempInt] = 0.00
-
-
Otros: Acciones
-
-
-
-
Set SPELL_DUR[TempInt] = (SPELL_DUR[TempInt] - 0.03)
-
Custom script: call RemoveLocation(udg_TempLoc)
-
Custom script: call RemoveLocation(udg_TempLoc2)
-
-
Otros: Acciones
-
-------- Destroy handles --------
-
Unidad - Kill SPELL_MISSILE[TempInt]
-
-------- IMPORTANT SYSTEM PART START --------
-
-------- RecycleIndex --------
-
Set SPELL_Index[SPELL_LOOP] = SPELL_Index[SPELL_Index_Size]
-
Set SPELL_Index[SPELL_Index_Size] = TempInt
-
Set SPELL_Index_Size = (SPELL_Index_Size - 1)
-
Set SPELL_LOOP = (SPELL_LOOP - 1)
-
-------- Turn the trigger again off if the index_size is below 0... --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si: Condiciones
-
SPELL_Index_Size Igual a 0
-
-
Entonces: Acciones
-
Detonador - Turn off (This trigger)
-
Skip remaining actions
-
-
Otros: Acciones
-
-
-------- IMPORTANT SYSTEM PART END --------
-
-
-
-
-
-
The idea is to create a Missile to ground spell using a dummy to cast Cluster of Rockets in the main trigger, then move the dummy and apply two different types of damage and debuff, based on being units or buildings on the second trigger.
Here is the modified spell, it works mostly well. It created a dummy, it shots the ground at the proper place, it applies different damages to units and buildings.
The problems are that the AOE of 200, in the triggers don't hit anything, it need to increased to like 1000 to be able to hit all units inside a 200 selection circle. This also creates lag during the first firing, bigger the number, bigger the jump. Another problem is that the dummy don't attack buildings to apply freezing breath, i've pasted the attack data of the Wyrm on the dummy to not avail.
-
MUINade Start
-
Acontecimientos
-
Unidad - A unit Inicia el efecto de una habilidad
-
-
Condiciones
-
(Ability being cast) Igual a Storm Bolt Grenade (Caster)
-
-
Acciones
-
-------- IMPORTANT SYSTEM PART START --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si: Condiciones
-
MUINade_Index_Size Igual a 0
-
-
Entonces: Acciones
-
Detonador - Turn on MUINade Loop <gen>
-
-
Otros: Acciones
-
-
-------- Increase the index size --------
-
Set MUINade_Index_Size = (MUINade_Index_Size + 1)
-
-------- Dynamic Index --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si: Condiciones
-
MUINade_Index_Size Mayor que MUINade_Index_MaxSize
-
-
Entonces: Acciones
-
Set MUINade_Index[MUINade_Index_Size] = MUINade_Index_Size
-
Set MUINade_Index_MaxSize = MUINade_Index_Size
-
-
Otros: Acciones
-
-
-------- Dynamic Index End --------
-
-------- IMPORTANT SYSTEM PART END --------
-
Set TempInt = MUINade_Index[MUINade_Index_Size]
-
-------- Setup those arrays --------
-
Set TempLoc = (Position of (Triggering unit))
-
Set TempLoc2 = (Target point of ability being cast)
-
Set MUINade_Caster[TempInt] = (Triggering unit)
-
-------- Dummy Variables --------
-
Unidad - Create 1 Dummy (Caster Size 2) for Neutral pasivo at TempLoc facing (Angle from TempLoc to TempLoc2) degrees
-
Set MUINade_Missile[TempInt] = (Last created unit)
-
-------- Missile Graphic --------
-
Unidad - Add Storm Bolt Grenade (Dummy Missile) to MUINade_Missile[TempInt]
-
Unidad - Order MUINade_Missile[TempInt] to Hojalatero neutral: Grupo de cohetes TempLoc2
-
-------- Stun For Ground Units --------
-
Unidad - Add Stun Bolt Ground (Dummy Stun) to MUINade_Missile[TempInt]
-
Unidad - Set level of Stun Bolt Ground (Dummy Stun) for MUINade_Missile[TempInt] to (Level of Storm Bolt Grenade (Caster) for MUINade_Caster[TempInt])
-
-------- Stun For Buildings --------
-
Unidad - Add Stun Building (Dummy Stun) to MUINade_Missile[TempInt]
-
Unidad - Set level of Stun Building (Dummy Stun) for MUINade_Missile[TempInt] to (Level of Storm Bolt Grenade (Caster) for MUINade_Caster[TempInt])
-
-------- Dummy Movement --------
-
Set MUINade_Angle[TempInt] = (Angle from TempLoc to TempLoc2)
-
Set MUINade_Speed[TempInt] = 50.00
-
Set MUINade_Dur[TempInt] = 10.00
-
-------- Damage for Units --------
-
Set MUINade_DamageUnit[TempInt] = (50.00 x (Real((Level of Storm Bolt Grenade (Caster) for MUINade_Caster[TempInt]))))
-
-------- Damage for Buildings --------
-
Set MUINade_DamageBuilding[TempInt] = (25.00 x (Real((Level of Storm Bolt Grenade (Caster) for MUINade_Caster[TempInt]))))
-
-------- Leak Cleaning --------
-
Custom script: call RemoveLocation(udg_TempLoc)
-
Custom script: call RemoveLocation(udg_TempLoc2)
-
-
-
MUINade Loop
-
Acontecimientos
-
Tiempo - Every 0.10 seconds of game time
-
-
Condiciones
-
Acciones
-
For each (Integer MUINade_Loop) from 1 to MUINade_Index_Size, do (Actions)
-
Bucle: Acciones
-
-------- This let look everything cleaner. --------
-
Set TempInt = MUINade_Index[MUINade_Loop]
-
-------- Condition... --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si: Condiciones
-
MUINade_Dur[TempInt] Mayor que 0.00
-
-
Entonces: Acciones
-
-------- Actions --------
-
Set TempLoc = (Position of MUINade_Missile[TempInt])
-
Set TempLoc2 = (TempLoc offset by MUINade_Speed[TempInt] towards MUINade_Angle[TempInt] degrees)
-
Unidad - Move MUINade_Missile[TempInt] instantly to TempLoc2, facing MUINade_Angle[TempInt] degrees
-
Custom script: set bj_wantDestroyGroup=true
-
Grupo de unidad - Pick every unit in (Units within 1000.00 of TempLoc2) and do (Actions)
-
Bucle: Acciones
-
Set MUINade_PicketUnit[TempInt] = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si: Condiciones
-
(MUINade_Caster[TempInt] belongs to an enemy of (Owner of MUINade_PicketUnit[TempInt])) Igual a True
-
(MUINade_PicketUnit[TempInt] is Una unidad de tierra) Igual a True
-
(MUINade_PicketUnit[TempInt] is Una unidad voladora) Igual a False
-
(MUINade_PicketUnit[TempInt] is Una estructura) Igual a False
-
-
Entonces: Acciones
-
Unidad - Cause MUINade_Caster[TempInt] to damage MUINade_PicketUnit[TempInt], dealing MUINade_DamageUnit[TempInt] damage of attack type Conjuros and damage type Normal
-
Unidad - Order MUINade_Missile[TempInt] to Humano Rey de la Montaña: Rayo de tormenta MUINade_PicketUnit[TempInt]
-
-
Otros: Acciones
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si: Condiciones
-
(MUINade_Caster[TempInt] belongs to an enemy of (Owner of MUINade_PicketUnit[TempInt])) Igual a True
-
(MUINade_PicketUnit[TempInt] is Una estructura) Igual a True
-
-
Entonces: Acciones
-
Unidad - Cause MUINade_Caster[TempInt] to damage MUINade_PicketUnit[TempInt], dealing MUINade_DamageBuilding[TempInt] damage of attack type Conjuros and damage type Normal
-
Unidad - Order MUINade_Missile[TempInt] to Atacar MUINade_PicketUnit[TempInt]
-
Partida - Display to (All players) for 15.00 seconds the text: Building Stun
-
Set MUINade_Dur[TempInt] = 0.00
-
-
Otros: Acciones
-
-
-
-
-
-
Set MUINade_Dur[TempInt] = (MUINade_Dur[TempInt] - 0.03)
-
Custom script: call RemoveLocation(udg_TempLoc)
-
Custom script: call RemoveLocation(udg_TempLoc2)
-
-
Otros: Acciones
-
-------- Destroy handles --------
-
Unidad - Kill MUINade_Missile[TempInt]
-
-------- IMPORTANT SYSTEM PART START --------
-
-------- RecycleIndex --------
-
Set MUINade_Index[MUINade_Loop] = MUINade_Index[MUINade_Index_Size]
-
Set MUINade_Index[MUINade_Index_Size] = TempInt
-
Set MUINade_Index_Size = (MUINade_Index_Size - 1)
-
Set MUINade_Loop = (MUINade_Loop - 1)
-
-------- Turn the trigger again off if the index_size is below 0... --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si: Condiciones
-
MUINade_Index_Size Igual a 0
-
-
Entonces: Acciones
-
Detonador - Turn off (This trigger)
-
Skip remaining actions
-
-
Otros: Acciones
-
-
-------- IMPORTANT SYSTEM PART END --------
-
-
-
-
-
-
Attachments
Last edited: