• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Missile timing and damage.

Status
Not open for further replies.
Level 14
Joined
Nov 13, 2017
Messages
733
So I'm making a unit that has attack that casts starfall-like meteor attack normally that has splash damage and it works but the problem is the animation of the falling star has some issues.

The PROBLEM is that the damage comes first before the meteor falls, which is really unrealistic. Please help me resolving this issue. Here is the model missile I used as "Instant" (MeteorStrike) by UgoUgo,

ILLUSTRATIVE INFORMATION (ADDITIONAL):

THE ARROW POINTS THAT EFFECT OF FALLING METEOR WITH RADIAL DAMAGE AND THE BOXED UNIT IS THE ATTACKER.
full
 
Level 14
Joined
Nov 13, 2017
Messages
733
That will send the starfall effect across which is not intended though.
My suggestion is to have the current instant attack with an invisible missile/effect

You then use a DDS to prevent the damage, make the effect and then deal the damage once the effect is done playing
CAn I have a sample trigger mate?
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
CAn I have a sample trigger mate?
Most of the syntax of what you have to do is dependent on which Damage Detection System you chose to implement. Which variables you check, how you modify the damage, etc. can all be different. This can be more precise with a timer but honestly a wait is probably sufficient here even if it is 'messy'. You will also have to create a fake local variable to store the dummy unit during the wait (we use a dummy not the unit itself to deal damage in case the unit dies during the starfall animation). See below
  • Events
    • -------- your DDS's triggering event, whatever that is. The system will specify what to put here to run the trigger on event damage --------
  • Conditions
    • (Unit-type of <some DDS variable that specifies the damage source, like "GDD_DamageSource">) equal to Wizard
  • Actions
    • -------- create a new unit variable in the variable editor, I will presume you named it MY_UNIT. You will need to put its name in the line below (keep the udg_), and the line below HAS to be the first line of your trigger --------
    • Custom script: local unit udg_MY_UNIT
    • -------- Do some action that sets the actual damage done on the damage event. Usually this is by setting a variable like "GDD_DamageDone" --------
    • Set TempPoint = Position of <DDS damage source variable>
    • Unit - Create 1 <your dummy unit-type> for (Owner of <DDS damage source variable>) at TempPoint facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_TempPoint) //also need to change this if your point variable isn't called TempPoint
    • Set MY_UNIT = (last created unit)
    • Unit - Add a Y second generic expiration timer to MY_UNIT //Make sure Y is > X.XX below so the unit is still alive
    • Wait - X.XX game-time seconds //determine duration based on how long the starfall animation takes; if you don't use the game-time seconds wait it's more net safe but will count time while the game lags/is paused
    • Set TempPoint = Position of MY_UNIT
    • Custom script: set bj_wantDestroyGroup = true //this auto-cleans a group leak in the next line
    • Unit Group - Pick every unit in (Units within SPLASH_AOE of TempPoint Matching (((Matching unit is Alive) equal to true) and ((Matching unit belongs to an enemy of (owner of MY_UNIT)) equal to true)) and do (Actions)
      • Loop - Actions
        • Unit - Cause MY_UNIT to damage (Picked unit) for Z damage... //set damage and attack types properly so armor is factored properly
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Set MY_UNIT = (no unit)
 
Status
Not open for further replies.
Top