• 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.

[General] Triggered missile arrow

Status
Not open for further replies.
Level 13
Joined
Oct 28, 2019
Messages
523
Im trying make archers and warrios to go inside a dungeon, but the archers has missile system colision and other stuffs. Idk what ability use for them fire triggered missile system.
I´ve tryed BlackArrow, but if I remove the damage, for them use only black arrow, even with autocast it doesnot fire, I need click on blackarrow and select an enemy unit. Any solution for this case?
 
You have many choices. You could have an instant-attack without projectile etc. that you set to 0 damage for the "instant attack" and "remove" the attack using DamageEngine (or natives, depending on your other triggers), then fire your projectile, without any ability involved. That's how I did Master Chief's weapons on my map.
You fire the missiles using triggers, right?

Otherwise you could use spell-based solution (any auto-castable spell on enemies set to do nothing), but that will make it harder to stuff that effects attack speed/damage to work.

Basically, it depends on your map, how you want it and what other factors you'd need to take into account.
 
What I mean by "instant attack" is "without projectile", on the unit, have "Combat - Attack 1 - Weapon Type: Instant".
Then use DamageEngine to detect when this unit-type attacks (checking unit type of damage source, attack-type (if the unit can cast spells) and that DamageEventType is 0, I.E. nothing is set, it is the regular attack), and when the projectile is about to deal damage, ensure that you set NextDamageType to something non-0 (1 for example).

Note that this will cause the damage to be "code" from the DamageEngine point of view. This might or might not effect other triggers using the damage engine.
 
Level 13
Joined
Oct 28, 2019
Messages
523
  • Arrow
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • DamageEventType Equal to 0
    • Actions
      • Game - Display to (All players) the text: MAGE
      • Set VariableSet Missile__TempLoc = (Position of DamageEventTarget)
      • -------- --------
      • -------- Each Missile must be created in a --------
      • -------- Trigger - Run Missile Configurate <gen> --------
      • -------- Trigger - Run Missile <gen> --------
      • -------- code block, as you can see below. --------
      • -------- --------
      • -------- One of the golden rules of Missile: --------
      • -------- Never ever remove Missile__Origin or Missile__Impact via custom script. --------
      • -------- Don't worry these two variables don't leak. --------
      • -------- --------
      • Trigger - Run Missile Configurate <gen> (ignoring conditions)
      • Set VariableSet Missile__Source = DamageEventSource
      • Set VariableSet Missile__Owner = (Triggering player)
      • Set VariableSet Missile__Origin = (Position of DamageEventSource)
      • Set VariableSet Missile__Impact = (Position of DamageEventTarget)
      • Set VariableSet Missile__ImpactZ = 50.00
      • Set VariableSet Missile__OriginZ = 50.00
      • Set VariableSet Missile__Speed = 800.00
      • Set VariableSet Missile__Collision = 150.00
      • Set VariableSet Missile__Arc = 45.00
      • Set VariableSet Missile__Damage = 200.00
      • Set VariableSet Missile__Model = Abilities\Weapons\Arrow\ArrowMissile.mdl
      • -------- Set trigger with should run on missile events. --------
      • Trigger - Run Missile <gen> (ignoring conditions)
      • -------- --------
      • Custom script: call RemoveLocation(udg_Missile__TempLoc)
what I must do now to enable colision with units and doodads? note: this projectile is not doing 200 damage as programed

jesus was messing with this thing and my archer shot like 1000 arrows and fireballs everywhere it almost crashed the computer
 
Last edited:
Level 13
Joined
Oct 28, 2019
Messages
523
[solved]
  • arrow colide uni
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Missile__EventId Equal to EVENT_MISSILE_COLLIDE_UNIT
          • (Missile__UnitHit belongs to an enemy of Missile__Owner.) Equal to True
          • (Missile__UnitHit is alive) Equal to True
        • Then - Actions
          • -------- See how easy damaging got. --------
          • Game - Display to (All players) the text: Archer shoot the ta...
          • Unit - Cause Missile__Dummy to damage Missile__UnitHit, dealing Missile__Damage damage of attack type Normal and damage type Normal
          • Set VariableSet Missile__WantDestroy = True
        • Else - Actions
I´ve read the missile system thread and got it,

Now I need other issue, a destructible 1x1 that dont block vision of the buildings (doodads), to make "a collision with destructible"
 
Level 13
Joined
Oct 28, 2019
Messages
523
I imagine you want the Missile_Source to damage Missile_UnitHit rather than the Dummy unit. This way the Source unit that fired the missile gets the kill credit and fires other damage events.
ok im not sure, when I get home I see this, But if it was the source unit instead dummy unit, the own arrow kills his own archer at the moment of the shot
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
ok im not sure, when I get home I see this, But if it was the source unit instead dummy unit, the own arrow kills his own archer at the moment of the shot
The Dummy should belong to the same Player that owns the Archer so they can't possibly damage one another.
  • Set VariableSet Missile__Source = DamageEventSource
  • Set VariableSet Missile__Owner = (Owner of DamageEventSource)
^ Don't use (Triggering player) here.

This would be False:
  • If - Conditions
    • (Missile__UnitHit belongs to an enemy of Missile__Owner.) Equal to True
 
Level 13
Joined
Oct 28, 2019
Messages
523
The Dummy should belong to the same Player that owns the Archer so they can't possibly damage one another.
  • Set VariableSet Missile__Source = DamageEventSource
  • Set VariableSet Missile__Owner = (Owner of DamageEventSource)
^ Don't use (Triggering player) here.

This would be False:
  • If - Conditions
    • (Missile__UnitHit belongs to an enemy of Missile__Owner.) Equal to True
But now other issue appears, the damage event event... it fires again again, to an infinite loop, making the archer shoots several arrows, ive done the missile cause the instant attack of the archer fires the trigger, but the missiledummy damage dont
maybe need trigger every archer in the map?
 
Last edited:
Level 13
Joined
Oct 28, 2019
Messages
523
  • Archer Arrow
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • DamageEventType Equal to 0
      • (Unit-type of DamageEventSource) Not equal to Missile Dummy
      • (Unit-type of DamageEventSource) Equal to Archer
    • Actions
      • Trigger - Run Missile Configurate <gen> (ignoring conditions)
      • Set VariableSet DamageEventAmount = 0.00
      • Set VariableSet Missile__TempLoc = (Position of DamageEventTarget)
      • Set VariableSet Missile__Source = DamageEventSource
      • Set VariableSet Missile__Owner = (Owner of DamageEventSource)
      • Set VariableSet Missile__Origin = (Position of DamageEventSource)
      • Set VariableSet Missile__UnitHit = DamageEventTarget
      • Set VariableSet Missile__Impact = (Position of DamageEventTarget)
      • Set VariableSet Missile__ImpactZ = 50.00
      • Set VariableSet Missile__OriginZ = 50.00
      • Set VariableSet Missile__Speed = 800.00
      • Set VariableSet Missile__Collision = 15.00
      • Set VariableSet Missile__Arc = 35.00
      • Set VariableSet Missile__Damage = (Random real number between 15.00 and 25.00)
      • Set VariableSet Missile__Model = Abilities\Weapons\Arrow\ArrowMissile.mdl
      • Set VariableSet Missile__OnCollideUnit = arrow colide uni <gen>
      • Set VariableSet Missile__OnCollideDestructable = arrow colide tree <gen>
      • -------- Set trigger with should run on missile events. --------
      • -------- --------
      • Trigger - Run Missile <gen> (ignoring conditions)
      • Custom script: call RemoveLocation(udg_Missile__TempLoc)
  • arrow colide uni
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Missile__EventId Equal to EVENT_MISSILE_COLLIDE_UNIT
          • Missile__UnitHit Not equal to Missile__Source
          • (Missile__UnitHit is alive) Equal to True
        • Then - Actions
          • -------- See how easy damaging got. --------
          • Unit - Cause Missile__Dummy to damage Missile__UnitHit, dealing Missile__Damage damage of attack type Pierce and damage type Normal
          • Set VariableSet Missile__WantDestroy = True
        • Else - Actions
Note that the map has up to 30 archers
From what I've noticed, the damage that the dummy causes to the UnitHit is the same property of (damageEventType = 0) or normal attack
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
You can turn off the damage engine before dealing damage to avoid causing the trigger to fire again:
  • Trigger - Turn off Damage Whatever
  • Unit - Cause damage
  • Trigger - Turn on Damage Whatever
Remember that an Event will fire immediately after an Action happens. In most cases it happens on the next frame but sometimes it can even happen in the middle of a trigger like when a unit dies.
 
Last edited:
Level 13
Joined
Oct 28, 2019
Messages
523
1687026296336.png

Almost solved, I wanna know how the arrow makes a perfect parabola over uneven terrain (red)
Actually it is making the orange trajectory if I order one archer attack other
 
Last edited:
Level 13
Joined
Oct 28, 2019
Messages
523
  • Missile Archer
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • DamageEventType Equal to 0
      • (Unit-type of DamageEventSource) Equal to Archer
    • Actions
      • Set VariableSet DamageEventAmount = 0.00
      • Trigger - Run Missile Configurate <gen> (ignoring conditions)
      • Set VariableSet Missile__TempLoc = (Position of DamageEventTarget)
      • Set VariableSet Missile__Source = DamageEventSource
      • Set VariableSet Missile__Owner = Player 1 (Red)
      • Set VariableSet Missile__Origin = (Position of DamageEventSource)
      • Set VariableSet Missile__UnitHit = DamageEventTarget
      • Set VariableSet Missile__Impact = (Position of DamageEventTarget)
      • Set VariableSet Missile__ImpactZ = 50.00
      • Set VariableSet Missile__OriginZ = 50.00
      • Set VariableSet Missile__Speed = 800.00
      • Set VariableSet Missile__Collision = 15.00
      • Set VariableSet Missile__Arc = 35.00
      • Set VariableSet Missile__Damage = (Random real number between 20.00 and 30.00)
      • Set VariableSet Missile__Model = Abilities\Weapons\Arrow\ArrowMissile.mdl
      • Set VariableSet Missile__OnCollideUnit = Missile Collision Archer <gen>
      • Set VariableSet Missile__OnCollideDestructable = Missile Collision Tree <gen>
      • Trigger - Run Missile <gen> (ignoring conditions)
      • Custom script: call RemoveLocation(udg_Missile__TempLoc)
  • Missile Collision Archer
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Missile__EventId Equal to EVENT_MISSILE_COLLIDE_UNIT
          • Missile__UnitHit Not equal to Missile__Source
          • (Missile__UnitHit is alive) Equal to True
          • (Unit-type of Missile__UnitHit) Not equal to Archer
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Missile__Source has an item of type Bounty Hunter 1) Equal to True
            • Then - Actions
              • Trigger - Turn off Missile Archer <gen>
              • Unit - Cause Missile__Source to damage Missile__UnitHit, dealing (Missile__Damage + 1.00) damage of attack type Pierce and damage type Normal
              • Trigger - Turn on Missile Archer <gen>
              • Set VariableSet Missile__WantDestroy = True
            • Else - Actions
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
I don't know, you didn't answer my question and I didn't create the system. The system itself would need to account for ground height in addition to missile arc which isn't too complicated.

I imagine it changes from something like this:
SetHeight = missileZ

To this:
SetHeight = GetLocationZ(missilePoint) + missileZ
 
Status
Not open for further replies.
Top