• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Need Help On Projectile System Debug, worse, rewritten

Status
Not open for further replies.
Level 4
Joined
Aug 9, 2012
Messages
84
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
  • 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)
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
  • 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
            • Else - Actions
The Projectile Loop
  • 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
                • Else - 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
            • 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
            • Else - Actions
          • Custom script: call RemoveLocation(udg_A_TempPoint)
 
Last edited:
Your dummy units used for the projectiles are probably using the FLYING pathing type. This makes them elevate slowly and adapt height based on the terrain below.
A projectile unit should always use "float" or "hover" type of pathing. Locust units do not have collision, so you don't have to worry about that anyway.

Also, your system does not take the terrain Z height into account, so it only creates a clean parabola on flat ground.

I strongly recommend using one of the approved projectile systems on Hive. Check the spells section and check the moderator comments to each submission or - if you know how to use JASS - use the missile system of Dirac in the JASS section.
 
Level 4
Joined
Aug 9, 2012
Messages
84
I am aware of all you said, and if you read, coding is not my department, hence, why I need someone to help me out, badly. This GUI system is also not my doing. It is the doing of another known Hive user on here (I won't name here) that worked on this for me, but when pointing out some issues with the system, he didn't want to fix them.

This is why I made a Thread here. No I do not know JASS / vJASS.

I Thank You for reassuring though the problems this projectile system has.

EDIT: I requested to the guy who worked this Projectile System for me to make it in such way that IF enemy units are on hills, they are killable, so the projectiles won't go to the floor all the time, which can be very annoying for heavily hilled or ramped terrains. And I also request that when on a hill, or shooting from higher ground in general, players are able to kill someone.

My problem now is projectiles move UP, DOWN and UP while moving straight instead of 100% straight when shooting from hills or ramps like projectiles would on flat ground. What I need is for them not to do that when shooting from or at someone on hills or ramps.

The problem I had before is whether you were shooting FROM or shooting AT someone on hills or ramps, the projectiles always hit the floor. I guess this is why he took the 'Z Height' thing out.

The ONLY time I want projectiles to NOT pass is on cliff levels of 2+, not cliff levels of 1, because realistically you should be able to kill someone standing on top of low hills or ramps.
 
Last edited:
What you request is complicated and will most likely not be done just by a helpful user in the trigger help forum.

Either go to the request forum and try to get help there or follow my suggestion and use an already approved and working missile system here on hive.
There's no reason to use your own when there's so many people that did a much better job on this.
 
Level 4
Joined
Aug 9, 2012
Messages
84
More like not done by anyone, as I've been around the block on Hive for months . . .

You're right, it's no easy 'fix,' that's why even in the 'Request' area people won't help or do anything, worse, no replies. So whether placed here or not, it doesn't really matter.

I placed what I needed done here because it's for displaying triggers/scripts already made and for people to take a look at them to see if they can be of help.

And the problem with all these 'other' projectile systems is they don't pertain to my game and my spells, etc. And for me, they can be confusing to implement into my map as it doesn't always go over so well when CnPing certain things. I am quite sure, too, these other projectile systems aren't coded to ignore cliff levels of level 1, and for projectiles not to pass through walls of level 2+.

That kind of system is nowhere to be found on Hive, and if there is, link me to it and I'll get someone to help me implement it.
 
More like not done by anyone, as I've been around the block on Hive for months . . .

You're right, it's no easy 'fix,' that's why even in the 'Request' area people won't help or do anything, worse, no replies. So whether placed here or not, it doesn't really matter.

I placed what I needed done here because it's for displaying triggers/scripts already made and for people to take a look at them to see if they can be of help.

And the problem with all these 'other' projectile systems is they don't pertain to my game and my spells, etc. And for me, they can be confusing to implement into my map as it doesn't always go over so well when CnPing certain things. I am quite sure, too, these other projectile systems aren't coded to ignore cliff levels of level 1, and for projectiles not to pass through walls of level 2+.

That kind of system is nowhere to be found on Hive, and if there is, link me to it and I'll get someone to help me implement it.
You can always use an existing missile system and then catch the collision cases with the cliffs manually if you need that. It's not that hard to do.
Also, you can always make adjustments to your spells to match the missile system you are using. The prophet should go to the mountain, not the mountain to the prophet. And the mountain is definitely the missile system!

However, really, if you don't even have the experience to implement an existing missile system and make adjustments in your map in order to achieve what you want, you should either just find a person joining your project and doing all the code work or - and this is probably your best bet - simply start with an easier project in order to get experience in coding.

If you frequently seek help of others with your project, chances are the project is way to complicated for your level of experience with mapping. Don't get me wrong: you need challenges to advance. But the challenges must be within one's reach or the map will just turn out to be crap.

You simply shouldn't rely on others too much when it comes to making a map. Especially not in terms of coding. Start with easy projects, make them right, gather experience, read tutorials and then sooner or later the time will come where you know how to adress these issues by yourself.
 
Level 4
Joined
Aug 9, 2012
Messages
84
mountain to the prophet. And the mountain is definitely the missile system!

However, really, if you don't even have the experience to implement an existing missile system and make adjustments in your map in order to achieve what you want, you should either just find a person joining your project and doing all the code work or - and this is probably your best bet - simply start with an easier project in order to get experience in coding.

If you frequently seek help of others with your project, chances are the project is way to complicated for your level of experience with mapping. Don't get me wrong: you need challenges to advance. But the challenges must be within one's reach or the map will just turn out to be crap.

You simply shouldn't rely on others too much when it comes to making a map. Especially not in terms of coding. Start with easy projects, make them right, gather experience, read tutorials and then sooner or later the time will come where you know how to adress these issues by yourself.

I've been mapping for years and studied guides for years. It's simply called 'not getting it.' Not everyone does in coding, else there'd be pro mappers all over. I did start small and worked my way up. But you can't stay with 'small' forever. Your mind escapes you when you want to move forward. I had been stuck on the 'small' stuff for 2 years straight in mapping until I decided one day to take a bigger leap to make the map I've been working on for 5 years now.

I do have people helping me out though as I just joined hive about a year ago. It's not like I've been looking for help on Hive for the same amount of years I've been mapping and no help. However, outside of Hive I never did get help. That's mostly because on WC III it's hard to find a coder so I joined Hive.

Even still, the help on here has been tough to get too, but not as bad.

In mapping I learned something, and even in actual game companies; everyone has their position be it the Modeler, the Terrainer, the Script Writer, the Sound Director, the Coder, etc. Coding is not one of mine. Just because of that doesn't mean I should stop working on my map and work on something smaller, or go back to 'smaller.' That's not an option.

The problem is getting someone interested enough to partner up with you in the making of your map, anyone's map.
 
I've been mapping for years and studied guides for years. It's simply called 'not getting it.' Not everyone does in coding, else there'd be pro mappers all over. I did start small and worked my way up. But you can't stay with 'small' forever. Your mind escapes you when you want to move forward. I had been stuck on the 'small' stuff for 2 years straight in mapping until I decided one day to take a bigger leap to make the map I've been working on for 5 years now.

I do have people helping me out though as I just joined hive about a year ago. It's not like I've been looking for help on Hive for the same amount of years I've been mapping and no help. However, outside of Hive I never did get help. That's mostly because on WC III it's hard to find a coder so I joined Hive.

Even still, the help on here has been tough to get too, but not as bad.

In mapping I learned something, and even in actual game companies; everyone has their position be it the Modeler, the Terrainer, the Script Writer, the Sound Director, the Coder, etc. Coding is not one of mine. Just because of that doesn't mean I should stop working on my map and work on something smaller, or go back to 'smaller.' That's not an option.

The problem is getting someone interested enough to partner up with you in the making of your map, anyone's map.
You've drawn the analogy to game design here, so let me catch that to show you what the problem is:
Popular indie games - like minecraft - always start with a programmer or a group of programmers. The leading head behind any project simply has to be a decent coder, as you will almost never work with the same people over a longer period of time. Contributors come and go. You need to make sure your project carries on even in times where you are left alone.

This does not mean the project leader always is the best programmer - but the most dedicated one! Art assets can always be done by different people and can be replaced. The actual game source itself can't. Everything is tied together and you need all the background knowledge of your map in order to grasp all interconnections in the code.

I don't say give up on the project, when you are not a programmer. But I say try to learn about programming. It's almost the only way to create a successful map of higher complexity.
 
Status
Not open for further replies.
Top