- Joined
- Jun 16, 2007
- Messages
- 1,574
Hello,
I've currently been tweaking with an MUI spell which was created for me by "Wizardum". The spell is based on the dragonball z move "Kamehameha".
I've just tweaked around with it, and added a few more actions so it can create more then just a kamehameha, since most of the dbz spells are basicly the same.
(Yes i've changed the triggers back to how they were before editing)
The issue is after 20 blasts the fps drops down to around 19.8fps.
The map size, and amount of doodads and units so far:
Map Size: 224x160
Doodads (So far): 1518
Units (So far): 1
And here's the trigger (Edited version):
This MUI version is leaking and bugging somewhere because i've currently implanted Valk's kamehameha he created for us a while back, and that doesn't drop the fps at all.
I've currently been tweaking with an MUI spell which was created for me by "Wizardum". The spell is based on the dragonball z move "Kamehameha".
I've just tweaked around with it, and added a few more actions so it can create more then just a kamehameha, since most of the dbz spells are basicly the same.
(Yes i've changed the triggers back to how they were before editing)
The issue is after 20 blasts the fps drops down to around 19.8fps.
The map size, and amount of doodads and units so far:
Map Size: 224x160
Doodads (So far): 1518
Units (So far): 1
And here's the trigger (Edited version):
-
Kamehameha Cast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Kamehameha
-
-
Actions
-
-------- this checks if the K_Index[1] is equal to 0 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
K_Index[1] Equal to 0
-
-
Then - Actions
-
-------- if it is, it will turn on the Loop trigger --------
-
Animation - Play (Triggering unit)'s Spell Throw animation
-
Trigger - Turn on Kamehameha Loop <gen>
-
-
Else - Actions
-
-
-------- the K_Index[1] holds the number of instances currently active, so we increase it by one --------
-
Set K_Index[1] = (K_Index[1] + 1)
-
-------- the K_Index[2] is used to store the data in variables, we also increase it by one --------
-
Set K_Index[2] = (K_Index[2] + 1)
-
-------- this is the speed of the missile, it's common to all missiles so there is no need to index it --------
-
Set K_Speed = 38.00
-
-------- the distance at which the missile will collide with a unit --------
-
Set K_CollisionRadius = 100.00
-
-------- units within this distance will be damaged on the explosion --------
-
Set K_ExplosionRadius = 400.00
-
-------- this is the damage dealt to units --------
-
Set K_Damage = ((Real((Intelligence of (Triggering unit) (Exclude bonuses)))) x 2.00)
-
-------- this will be the duration of the missile, this one is indexed because it will be changed over time, and it's unique to each missile --------
-
Set K_Duration[K_Index[2]] = 1.50
-
-------- this stores the caster --------
-
Set K_Caster[K_Index[2]] = (Triggering unit)
-
-------- here we store the caster's position --------
-
Set TempPoint[0] = (Position of (Triggering unit))
-
-------- and here the target point --------
-
Set TempPoint[1] = (Target point of ability being cast)
-
-------- this is the angle at which the missile will move, it's angle between the caster's position and the target point --------
-
Set K_Direction[K_Index[2]] = (Angle from TempPoint[0] to TempPoint[1])
-
-------- here we create the missile --------
-
Unit - Create 1 Ki_Head for (Owner of (Triggering unit)) at (TempPoint[0] offset by 50.00 towards (Facing of (Triggering unit)) degrees) facing TempPoint[0]
-
-------- and store it into a variable --------
-
Set K_Missile[K_Index[2]] = (Last created unit)
-
-------- finally we remove the point memory leaks --------
-
Custom script: call RemoveLocation( udg_TempPoint[0] )
-
Custom script: call RemoveLocation( udg_TempPoint[1] )
-
-
-
Kamehameha Loop
-
Events
-
Time - Every 0.05 seconds of game time
-
-
Conditions
-
Actions
-
-------- so basically this will run every instance, from 1 to the K_Index[2] that holds the last instance --------
-
For each (Integer K_Int) from 1 to K_Index[2], do (Actions)
-
Loop - Actions
-
-------- this checks if the duration is greater than 0, if it is it will make the missile move --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
K_Duration[K_Int] Greater than 0.00
-
-
Then - Actions
-
-------- here the duration is decreased --------
-
Set K_Duration[K_Int] = (K_Duration[K_Int] - 0.08)
-
-------- here we store the point of the missile --------
-
Set TempPoint[2] = (Position of K_Missile[K_Int])
-
-------- and here the new point of the missile, which is it's original point plus the speed towards the direction --------
-
Set TempPoint[3] = (TempPoint[2] offset by K_Speed towards K_Direction[K_Int] degrees)
-
-------- now we move it --------
-
Unit - Move K_Missile[K_Int] instantly to TempPoint[3]
-
Set TempLocation = (Position of K_Missile[K_Int])
-
Destructible - Pick every destructible within 200.00 of TempLocation and do (Actions)
-
Loop - Actions
-
Destructible - Kill (Picked destructible)
-
-
-
Custom script: call RemoveLocation(udg_TempLocation)
-
-------- we create a dummy trail unit --------
-
Unit - Create 1 Ki_Trail for (Owner of K_Caster[K_Int]) at TempPoint[2] facing K_Direction[K_Int] degrees
-
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
-
-------- then we pick every unit within CollisionRadius of the position of the missile that is not a building, it's alive and if it is an enemy --------
-
Set TempGroup = (Units within K_CollisionRadius of TempPoint[3] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of K_Caster[K_Int])) Equal to True))))
-
-------- if the number of units in the group is greater than 0, than it means that there is a unit colliding with the missile --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroup) Greater than 0
-
-
Then - Actions
-
-------- so basically here we set the duration to 0, so the explosion can occur immediately --------
-
Set K_Duration[K_Int] = 0.00
-
-
Else - Actions
-
-
-------- now we remove one of the points used --------
-
Custom script: call RemoveLocation( udg_TempPoint[2] )
-
-------- and we destroy the group since we don't need it anymore --------
-
Custom script: call DestroyGroup( udg_TempGroup )
-
-------- however we must check if the duration is lesser or equal to 0 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
K_Duration[K_Int] Less than or equal to 0.00
-
-
Then - Actions
-
-------- if it is, then we willl create the nuclear explosion special effect --------
-
Special Effect - Create a special effect at TempPoint[3] using NuclearExplosion.mdx
-
-------- and immediately destroy it --------
-
Special Effect - Destroy (Last created special effect)
-
-------- we kill the missile --------
-
Unit - Kill K_Missile[K_Int]
-
Set TempUnitGroup = (Units owned by (Owner of K_Caster[K_Int]) of type Ki_Trail)
-
Unit Group - Pick every unit in TempUnitGroup and do (Actions)
-
Loop - Actions
-
Unit - Kill (Picked unit)
-
-
-
Custom script: call DestroyGroup(udg_TempUnitGroup)
-
-------- then we pick every unit within ExplosionRadius of the missile position and check if it is not a building, if it is alive and if it is an enemy --------
-
Set TempGroup = (Units within K_ExplosionRadius of TempPoint[3] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of K_Caster[K_Int])) Equal to True))))
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
-------- and here we will pick every unit in the group and damage it --------
-
Unit - Cause K_Caster[K_Int] to damage (Picked unit), dealing K_Damage damage of attack type Spells and damage type Universal
-
-
-
-------- now we destroy the group --------
-
Custom script: call DestroyGroup( udg_TempGroup )
-
Animation - Reset K_Caster[K_Int]'s animation
-
-------- this will decrease one to the K_Index[1], which is the number of running instances --------
-
Set K_Index[1] = (K_Index[1] - 1)
-
-------- now this checks if the number of instances is equal to 0 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
K_Index[1] Equal to 0
-
-
Then - Actions
-
-------- if it is, we will set the K_index[2] to 0, basicaly this is a fast way of cleaning the all stored data --------
-
Set K_Index[2] = 0
-
-------- and then we turn off this trigger --------
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-------- this point could have been used before that's why we only removing it in the end. --------
-
Custom script: call RemoveLocation( udg_TempPoint[3] )
-
-
Else - Actions
-
-
-
-
-
Last edited: