This Projectile System needs a debug or to be remade/rewritten.
NOTE: If you have any questions regarding the 'WHY' on things, I won't know any more than you will because this is not my Projectile System or work by my hands. It was done by someone else who evidently does not want to fix these issues, notably because I kept pointing out things that didn't look right because . . . they're not right!
It's not my fault I need an essential part of my map working right, as anyone making a map would expect too.
Anyway, coding is not my department. This is why I need help.
Thank You in advance.
--------------------
Recently I had someone make me a Projectile System so the projectiles in my game cannot pass through walls. However, it was not made the way I really wanted it. It was, for lack of better words and to my knowledge, rushed and poorly done.
The only thing that really works right in this system is the projectiles do not pass through walls.
The guy who made the system for me based the projectiles off AoE damage on the Dummy Unit, which to me is terrible. When implementing Bribe's 'Damage Detection System' (a Hive member) I notice there are 4 damage text messages at once over the unit's head when shot at with ONE projectile.
Only ONE message should come up, calculating all the damage at once in a single integer, not in 4 separate parts.
The Projectile Setup
The above said and in the above triggers is because the person who made this Projectile System for me made it to where there is a chance to deal 25-50-75 or 100 damage depending on where you hit the unit. The PROBLEM is it deals damage in sets of 25 (as seen in the Projectile Setup trigger) and shows it in Bribe's Damage Detection System.
For example, if I SET A_Speed = 38.00 AT 75.00 it won't deal 4 sets of damage, however, the smaller that value is it will deal more sets of 25 damage to the point where the projectile may as well be a one-shot kill, which is not what I want.
I don't like being forced to UP my projectile speed in the A_Speed variable because someone didn't want to do this as I requested. The faster my projectiles are in my map, the harder it is for my 'Dodge' spell to dodge them. The spell doesn't activate fast enough to handle high values in the A_Speed variable anyway.
So if the projectiles in the 'Projectile Setup' are set to 25 damage each (my units in the game having 150 health each,) the faster they move (when a higher speed value is set) the less damage it does in sets of 25. The slower they move (when a lower speed value is set) the MORE sets of 25 damage it deals. It's weird!
Mind you, while the above is kind of cool, having a chance to deal so much dmg depending on your accuracy, I did not ask for such a detail. Now that it's put in I need help fixing it, along with the other bigger problem outlined further below.
When asking one of the high-up coders in Hive's chat, he said this is odd behavior that should not be happening regarding how the damage works.
The Big Problem / Odd Behavior(s) with this Projectile System:
When projectiles move in this Projectile System, they do so in a UP, DOWN, then UP manner (exactly that) most of the time, notably when shooting from ramps or hilly parts in the terrain. They do DO NOT move in a straight course.
Possible reason: someone told me this is happening because this Projectile System is not computing the Z Point of the terrain or height value. I forget the exact technicalities, but that's all I remember being said.
Here are the rest of the triggers that go with this system:
The Projectile Activation
The Projectile Loop
NOTE: If you have any questions regarding the 'WHY' on things, I won't know any more than you will because this is not my Projectile System or work by my hands. It was done by someone else who evidently does not want to fix these issues, notably because I kept pointing out things that didn't look right because . . . they're not right!
It's not my fault I need an essential part of my map working right, as anyone making a map would expect too.
Anyway, coding is not my department. This is why I need help.
Thank You in advance.
--------------------
Recently I had someone make me a Projectile System so the projectiles in my game cannot pass through walls. However, it was not made the way I really wanted it. It was, for lack of better words and to my knowledge, rushed and poorly done.
The only thing that really works right in this system is the projectiles do not pass through walls.
The guy who made the system for me based the projectiles off AoE damage on the Dummy Unit, which to me is terrible. When implementing Bribe's 'Damage Detection System' (a Hive member) I notice there are 4 damage text messages at once over the unit's head when shot at with ONE projectile.
Only ONE message should come up, calculating all the damage at once in a single integer, not in 4 separate parts.
The Projectile Setup
-
Projectile Setup
-
Events
- Map initialization
- Conditions
-
Actions
- -------- Dummies Used --------
- Set A_Dummy = Mortar
- Set A_Ability[1] = Explosive Mortar(s)
- Set A_Ability[2] = Shoot More Arrows
- Set A_Ability[3] = Shoot More Bullets
- Set A_Ability[4] = Shoot Arrows
- Set A_Ability[5] = Shoot Bullets
- -------- Arrow Data --------
- Set A_MaxIndex = 0
- Set A_ProjectileModel[1] = Abilities\Weapons\Mortar\MortarMissile.mdl
- Set A_ProjectileModel[2] = Abilities\Weapons\MoonPriestessMissile\MoonPriestessMissile.mdl
- Set A_ProjectileModel[3] = Abilities\Weapons\BoatMissile\BoatMissile.mdl
- Set A_ProjectileModel[4] = Abilities\Weapons\MoonPriestessMissile\MoonPriestessMissile.mdl
- Set A_ProjectileModel[5] = Abilities\Weapons\BoatMissile\BoatMissile.mdl
- Set A_ProjectileScale = 100.00
- -------- Damage --------
- Set A_DamageBase[1] = 500.00
- Set A_DamageBase[2] = 25.00
- Set A_DamageBase[3] = 25.00
- Set A_DamageBase[4] = 25.00
- Set A_DamageBase[5] = 25.00
- Set A_DamagePerLevel[1] = 0.00
- Set A_DamagePerLevel[2] = 0.00
- Set A_DamagePerLevel[3] = 0.00
- Set A_DamagePerLevel[4] = 0.00
- Set A_DamagePerLevel[5] = 0.00
- -------- AOE --------
- Set A_AOEBase = 72.00
- Set A_AOEBPerLevel = 0.00
- -------- Fly Height --------
- Set A_FlyHeight = 90.00
- -------- Speed --------
- Set A_Speed = 38.00
- -------- Range --------
- Set A_Range = 1800.00
- -------- Timer speed --------
- Set A_Timer = 0.03
- Trigger - Add to Projectile Loop <gen> the event (Time - Every A_Timer seconds of game time)
-
Events
For example, if I SET A_Speed = 38.00 AT 75.00 it won't deal 4 sets of damage, however, the smaller that value is it will deal more sets of 25 damage to the point where the projectile may as well be a one-shot kill, which is not what I want.
I don't like being forced to UP my projectile speed in the A_Speed variable because someone didn't want to do this as I requested. The faster my projectiles are in my map, the harder it is for my 'Dodge' spell to dodge them. The spell doesn't activate fast enough to handle high values in the A_Speed variable anyway.
So if the projectiles in the 'Projectile Setup' are set to 25 damage each (my units in the game having 150 health each,) the faster they move (when a higher speed value is set) the less damage it does in sets of 25. The slower they move (when a lower speed value is set) the MORE sets of 25 damage it deals. It's weird!
Mind you, while the above is kind of cool, having a chance to deal so much dmg depending on your accuracy, I did not ask for such a detail. Now that it's put in I need help fixing it, along with the other bigger problem outlined further below.
When asking one of the high-up coders in Hive's chat, he said this is odd behavior that should not be happening regarding how the damage works.
The Big Problem / Odd Behavior(s) with this Projectile System:
When projectiles move in this Projectile System, they do so in a UP, DOWN, then UP manner (exactly that) most of the time, notably when shooting from ramps or hilly parts in the terrain. They do DO NOT move in a straight course.
Possible reason: someone told me this is happening because this Projectile System is not computing the Z Point of the terrain or height value. I forget the exact technicalities, but that's all I remember being said.
Here are the rest of the triggers that go with this system:
The Projectile Activation
-
Projectile Activation
-
Events
- Unit - A unit Starts the effect of an ability
- Conditions
-
Actions
-
For each (Integer A_Index) from 1 to 5, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Ability being cast) Equal to A_Ability[A_Index]
-
Then - Actions
- Set A_TempInt = A_Index
- Set A_MaxIndex = (A_MaxIndex + 1)
- Set A_Caster[A_MaxIndex] = (Triggering unit)
- Set TempReal = 1.00
- Set A_TempPoint = (Position of A_Caster[A_MaxIndex])
- Set A_TempPoint2 = (Target point of ability being cast)
- Custom script: set udg_A_Angle[udg_A_MaxIndex] = Atan2(GetLocationY(udg_A_TempPoint2) - GetLocationY(udg_A_TempPoint), GetLocationX(udg_A_TempPoint2) - GetLocationX(udg_A_TempPoint))
- Custom script: set udg_A_Z = GetLocationZ(udg_A_TempPoint)
- Custom script: set udg_A_Z2 = GetLocationZ(udg_A_TempPoint2)
- Unit - Create 1 A_Dummy for (Owner of A_Caster[A_MaxIndex]) at A_TempPoint facing (Angle from A_TempPoint to A_TempPoint2) degrees
- Set A_Projectile[A_MaxIndex] = (Last created unit)
- Animation - Change A_Projectile[A_MaxIndex]'s size to (A_ProjectileScale%, 0.00%, 0.00%) of its original size
- Special Effect - Create a special effect attached to the origin of A_Projectile[A_MaxIndex] using A_ProjectileModel[A_TempInt]
- Animation - Change A_Projectile[A_MaxIndex] flying height to A_FlyHeight at 0.00
- Set A_CurrentHeight[A_MaxIndex] = (A_FlyHeight + A_Z)
- Set A_ZVelocity[A_MaxIndex] = (((A_Z2 + A_FlyHeight) - A_CurrentHeight[A_MaxIndex]) / ((Distance between A_TempPoint and A_TempPoint2) / A_Speed))
- Set A_Effect[A_MaxIndex] = (Last created special effect)
- Set A_Damage[A_MaxIndex] = (A_DamageBase[A_TempInt] + (A_DamagePerLevel[A_TempInt] x TempReal))
- Set A_AOE[A_MaxIndex] = (A_AOEBase + (A_AOEBPerLevel x TempReal))
- Set A_Type[A_MaxIndex] = A_TempInt
- Set A_CurrentDistance[A_MaxIndex] = 0.00
- Custom script: call SetUnitAnimationByIndex(udg_A_Projectile[udg_A_MaxIndex], R2I(udg_A_ZVelocity[udg_A_MaxIndex]) + 90)
- Custom script: call RemoveLocation(udg_A_TempPoint2)
- Custom script: call RemoveLocation(udg_A_TempPoint)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- A_MaxIndex Equal to 1
-
Then - Actions
- Trigger - Turn on Projectile Loop <gen>
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A_Index) from 1 to 5, do (Actions)
-
Events
-
Projectile Loop
- Events
- Conditions
-
Actions
-
For each (Integer A_Index) from 1 to A_MaxIndex, do (Actions)
-
Loop - Actions
- Custom script: set udg_A_X = GetUnitX(udg_A_Projectile[udg_A_Index])
- Custom script: set udg_A_Y = GetUnitY(udg_A_Projectile[udg_A_Index])
- Set A_TempPoint = (Point(A_X, A_Y))
- Custom script: set udg_A_Z = GetLocationZ(udg_A_TempPoint)
- Custom script: set udg_A_CurrentHeight[udg_A_Index] = udg_A_CurrentHeight[udg_A_Index] + udg_A_ZVelocity[udg_A_Index]
- Custom script: call SetUnitX(udg_A_Projectile[udg_A_Index], udg_A_X + udg_A_Speed * Cos(udg_A_Angle[udg_A_Index]))
- Custom script: call SetUnitY(udg_A_Projectile[udg_A_Index], udg_A_Y + udg_A_Speed * Sin(udg_A_Angle[udg_A_Index]))
- Set A_CurrentDistance[A_Index] = (A_CurrentDistance[A_Index] + A_Speed)
- Animation - Change A_Projectile[A_Index] flying height to (A_CurrentHeight[A_Index] - A_Z) at 0.00
- Set A_TempGroup = (Units within A_AOE[A_Index] of A_TempPoint)
-
Unit Group - Pick every unit in A_TempGroup and do (Actions)
-
Loop - Actions
- Set A_TempUnit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (A_TempUnit is A structure) Equal to False
- (A_TempUnit is A ground unit) Equal to True
- (Current flying height of A_TempUnit) Less than or equal to (A_FlyHeight + 90.00)
- (Current flying height of A_TempUnit) Greater than or equal to (A_FlyHeight - 90.00)
- (A_TempUnit is alive) Equal to True
- (A_TempUnit belongs to an enemy of (Owner of A_Caster[A_Index])) Equal to True
-
Then - Actions
- Unit - Cause A_Caster[A_Index] to damage A_TempUnit, dealing A_Damage[A_Index] damage of attack type Chaos and damage type Normal
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- A_Type[A_Index] Equal to 1
-
Then - Actions
- Special Effect - Create a special effect attached to the origin of A_TempUnit using Abilities\Weapons\SteamTank\SteamTankImpact.mdl
- Special Effect - Destroy (Last created special effect)
- Special Effect - Create a special effect attached to the origin of A_TempUnit using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
- Special Effect - Destroy (Last created special effect)
- Special Effect - Create a special effect attached to the origin of A_TempUnit using Objects\Spawnmodels\Human\HumanLargeDeathExplode\HumanLargeDeathExplode.mdl
- Special Effect - Destroy (Last created special effect)
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
Loop - Actions
- Custom script: call DestroyGroup(udg_A_TempGroup)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (A_CurrentHeight[A_Index] - A_Z) Less than or equal to 10.00
- A_CurrentDistance[A_Index] Greater than or equal to A_Range
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Special Effect - Destroy A_Effect[A_Index]
- Unit - Remove A_Projectile[A_Index] from the game
- Set A_AOE[A_Index] = A_AOE[A_MaxIndex]
- Set A_Angle[A_Index] = A_Angle[A_MaxIndex]
- Set A_Projectile[A_Index] = A_Projectile[A_MaxIndex]
- Set A_Caster[A_Index] = A_Caster[A_MaxIndex]
- Set A_CurrentDistance[A_Index] = A_CurrentDistance[A_MaxIndex]
- Set A_CurrentHeight[A_Index] = A_CurrentHeight[A_MaxIndex]
- Set A_Damage[A_Index] = A_Damage[A_MaxIndex]
- Set A_Effect[A_Index] = A_Effect[A_MaxIndex]
- Set A_Type[A_Index] = A_Type[A_MaxIndex]
- Set A_ZVelocity[A_Index] = A_ZVelocity[A_MaxIndex]
- Set A_MaxIndex = (A_MaxIndex - 1)
- Custom script: set udg_A_Index = udg_A_Index - 1
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- A_MaxIndex Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
- Custom script: call RemoveLocation(udg_A_TempPoint)
-
Loop - Actions
-
For each (Integer A_Index) from 1 to A_MaxIndex, do (Actions)
Last edited: