- Joined
- Jun 16, 2008
- Messages
- 1,939
My Charge Spell works fine and all and i think it doesnt leak but after a certain numbers of uses it begins to lagg like hell, so i think it leakes....
i' ll post the full trigger here and i would be happy if u find the time to help me
so here is the first one
initialization
so here is the second trigger
+rep if u r!!! good luck!!!
i' ll post the full trigger here and i would be happy if u find the time to help me
so here is the first one
initialization
-
ChargeCast
-
Events
- Unit - A unit starts the effect of an ability
-
Conditions
- (Ability being cast) equal to (==) Charge!!
-
Actions
- Set CustomValue = (CustomValue + 1)
- Set Charger[CustomValue] = (Triggering unit)
- Set Victim[CustomValue] = (Target unit of ability being cast)
- Set Charge_Point_01[CustomValue] = (Position of Charger[CustomValue])
- Set Charge_Point_02[CustomValue] = (Position of Victim[CustomValue])
- Set Charge_Point_03[CustomValue] = (Charge_Point_01[CustomValue] offset by 50.00 towards (Angle from Charge_Point_01[CustomValue] to Charge_Point_02[CustomValue]) degrees)
- -------- This Special effect is not nessessary for the spell and was made by me, just for fun, if u dont want it, delete it here and the remove specialeffect in the chargefinal as well as the pointi n this trigger where u set the variable! --------
- Specialeffect - Create a special effect attached to the weapon of Charger[CustomValue] using Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl
- Set SpecialEffect[CustomValue] = (Last created special effect)
- Unit - Turn collision for Charger[CustomValue] Off
- Unit - Hide Charger[CustomValue]
- Unit - Move Charger[CustomValue] instantly to Charge_Point_03[CustomValue]
- Trigger - Turn on ChargeDummy <gen>
- Custom script: call RemoveLocation(udg_Charge_Point_01[udg_CustomValue])
- Custom script: call RemoveLocation(udg_Charge_Point_02[udg_CustomValue])
- Custom script: call RemoveLocation(udg_Charge_Point_03[udg_CustomValue])
-
Events
so here is the second trigger
-
ChargeDummy
-
Events
- Time - Every 0.02 seconds of game time
- Conditions
-
Actions
- -------- u can change the interval by changing the periodic event as u want, u can also increase the space between the spawning points by increasing the distance named in chargepoint3 --------
- Set Charge_Point_01[CustomValue] = (Position of Charger[CustomValue])
- Set Charge_Point_02[CustomValue] = (Position of Victim[CustomValue])
- Set Charge_Point_03[CustomValue] = (Charge_Point_01[CustomValue] offset by 20.00 towards (Angle from Charge_Point_01[CustomValue] to Charge_Point_02[CustomValue]) degrees)
- -------- If u want to have a special effect at the position where the dummy spawns, just set it here and destroy it in an instant, or at the end of the trigger --------
- Unit - Create 1 TimeChargeDummy for (Owner of Charger[CustomValue]) at Charge_Point_03[CustomValue] facing (Angle from Charge_Point_03[CustomValue] to Charge_Point_02[CustomValue]) degrees
- Unit - Turn collision for (Last created unit) Off
- Set Dummy[Dummyinteger] = (Last created unit)
- Animation - Play Dummy[Dummyinteger]'s walk animation
- Set DummyGroup[CustomValue] = (Create Unit Group)
- Unitgroup - Add Dummy[Dummyinteger] to DummyGroup[CustomValue]
- Trigger - Turn on ChargeDummyCounter <gen>
- Set Dummyinteger = (Dummyinteger + 1)
-
Unit - Move Charger[CustomValue] instantly to Charge_Point_03[CustomValue]
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
- CheckInteger equal to (==) 1
-
'THEN'-Actions
- Trigger - Run ChargeFinal <gen> (ignoring conditions)
- Trigger - Turn off (This trigger)
- 'ELSE'-Actions
-
'IF'-Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
- (Distance between Charge_Point_02[CustomValue] and Charge_Point_03[CustomValue]) smaller or equal (<=) 200.00
-
'THEN'-Actions
- Set CheckInteger = 1
- 'ELSE'-Actions
-
'IF'-Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Custom script: call RemoveLocation(udg_Charge_Point_01[udg_CustomValue])
- Custom script: call RemoveLocation(udg_Charge_Point_02[udg_CustomValue])
- Custom script: call RemoveLocation(udg_Charge_Point_03[udg_CustomValue])
-
Events
-
ChargeDummyCounter
-
Events
- Time - Every 0.01 seconds of game time
- Conditions
-
Actions
-
-------- if u wish to, u can smooth the fading by setting the time interval to 0.01 and setting the addition in fadeinteger to 1, or 2 (just an example, just play around with those two values a bit) --------
-
Do Multiple ActionsFor each (Integer A) from 1 to Dummyinteger, do (Actions)
-
Loop - Actions
- Set fadeinteger[(Integer A)] = (fadeinteger[(Integer A)] + 4.00)
-
Animation - Change Dummy[(Integer A)]'s vertex coloring to (100.00%, 100.00%, 100.00%) with fadeinteger[(Integer A)]% transparency
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
- fadeinteger[(Integer A)] Größer als (>) 90.00
-
'THEN'-Actions
- Animation - Reset Dummy[(Integer A)]'s animation
- Unitgroup - Remove Dummy[(Integer A)] from DummyGroup[CustomValue]
- Unit - Remove Dummy[(Integer A)] from the game
- Custom script: set udg_Dummy[bj_forLoopAIndex] = null
- 'ELSE'-Actions
-
'IF'-Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
- (DummyGroup[CustomValue] is empty) equal to (==) True
-
'THEN'-Actions
- Custom script: call DestroyGroup(udg_DummyGroup[udg_CustomValue])
- Trigger - Turn off (This trigger)
- 'ELSE'-Actions
-
'IF'-Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Do Multiple ActionsFor each (Integer A) from 1 to Dummyinteger, do (Actions)
-
-------- if u wish to, u can smooth the fading by setting the time interval to 0.01 and setting the addition in fadeinteger to 1, or 2 (just an example, just play around with those two values a bit) --------
-
Events
-
ChargeFinal
- Events
- Conditions
-
Actions
- Unit - Move Charger[CustomValue] instantly to Charge_Point_03[CustomValue]
- Unit - Unhide Charger[CustomValue]
- Unit - Turn collision for Charger[CustomValue] On
- Unit - Cause Charger[CustomValue] to damage Victim[CustomValue], dealing 100.00 damage of attack type Spells and damage type Unknown
- -------- i have a problem with the animation set here, it doesnt really show but i try to fix it in the future, u can change it by giving another anim name, here) --------
- Animation - Play Charger[CustomValue]'s attack slam animation
- Set KBA_Caster = Charger[CustomValue]
- Set KBA_TargetUnit = Victim[CustomValue]
- Set KBA_StartingPosition = Charge_Point_03[CustomValue]
- Set KBA_Level = 1
- Set KBA_Speed = 5.00
- Set KBA_DistancePerLevel = 140.00
- Set KBA_SpecialEffects[2] = Objects\Spawnmodels\Human\HumanBlood\HumanBloodLarge0.mdl
- Set KBA_SpecialEffects[1] = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
- Set KBA_DestroyTrees = True
- Trigger - Run Cast A Knockback <gen> (checking conditions)
- Specialeffect - Destroy SpecialEffect[CustomValue]
- Selection - Select Charger[CustomValue] for (Owner of Charger[CustomValue])
- Unit - Order Charger[CustomValue] to Attack Victim[CustomValue]
- Set CheckInteger = 0
- Custom script: call RemoveLocation(udg_Charge_Point_03[udg_CustomValue])
- Custom script: set udg_Charger[udg_CustomValue] = null
- Custom script: set udg_Victim[udg_CustomValue] = null
+rep if u r!!! good luck!!!