• 🏆 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!

Attack that consumes units

Status
Not open for further replies.
Level 13
Joined
Jul 2, 2008
Messages
1,182
I need a spell that consumes units that are inside the unit using the spell.
For example a unit that has acolyte passengers and when it uses the spell shot an acolyte dies. Without acolytes it cant use the spell.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
well i wanted it to devour only allied units
maybe 10 seconds but iam not sure might need to test it

done, here is a test map.

remember that you can only devour your allied units, not your own units or enemies unit. and for this test map you can only devour Footmen, you could change the condition later.

and i already set the duration of digesting to (Current Life of (Target Unit of ability being cast)) / Damage of Devour.

so, when you set the Damage[cv] = 50, you should also set the damage per second of Devour Cargo to 50.

when a Footman's hp is 500, the duration will be 500 / 50 = 10 second(s)
when a Footman's hp is 700, the duration will be 700 / 50 = 14 second(s)

the spell (Shoot) is currently cost 0 mana, you can change it to whatever you want. You can search the Devour and Devour Cargo ability in Abilities > Orc > Units > Devour or Devour Cargo.

feel free to ask any question.

EDIT : one more question i one to ask, does this unit have attack or they can attack only with this spell ?

maybe it's better to change the firebolt into cold arrows, tell me what you think.
 

Attachments

  • Consume Unit.w3x
    23.5 KB · Views: 57
Last edited:
Level 13
Joined
Jul 2, 2008
Messages
1,182
thx but after trying it i realized that it might be more usefull for me having a version with loaded units (like a transport) and every time the unit uses the spell one of the passengers die
if there are no passengers the spell cant be used

sry :( but the other consume version with devour might be usefull too
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
I've had some success with these triggers:
  • Unit Loaded
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
    • Actions
      • Unit Group - Add (Triggering unit) to loaded[1]
  • Unit Fired
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Goblin Zeppelin
    • Actions
      • Unit - Remove (Random unit from loaded[1]) from the game
Probably going to make it into a system.

EDIT: System is attached.
Features:
- Configure which transport unit types will use the system
- Removes a random transported unit when attacking
- Prevents attacking when transport is empty

I'll add some more functionality, such as support for spells and multi-launches.

EDIT2: Works for meat wagons and corpses.

EDIT3: Added the function from your other thread - units in the cargo hold being destroyed.
 

Attachments

  • CargoLaunchSystem003.w3x
    23.7 KB · Views: 50
Last edited:
Level 8
Joined
Apr 23, 2011
Messages
322
rulerofiron99, thank you sir a lot for your nice system, although I found some fixable (I think) bugs.
1.meat wagon can still attack ground without corpses (easy fix)
2.sometimes, even with corpses, it stops attacking (wut?)
3.didn't test due to shortage of time, but does the system work even when meat wagon's attack swing is 0.7 sec?
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
rulerofiron99, thank you sir a lot for your nice system, although I found some fixable (I think) bugs.
1.meat wagon can still attack ground without corpses (easy fix)
2.sometimes, even with corpses, it stops attacking (wut?)
3.didn't test due to shortage of time, but does the system work even when meat wagon's attack swing is 0.7 sec?

Thanks for the feedback!
1. This isn't an easy fix; there is no event to detect each instance of attack ground. Only the first attack can be detected. I might do a lengthy workaround that uses an ability.
2. I'll have to take a look at this.
3. The corpse/unit is removed at the start of the attack, so if you have a unit with 0.7 attack swing, start an attack an immediately give another order, the corpse is wasted. I'll see if I can find a workaround for this; for now you should use unit with a very low attack swing.
 
Level 8
Joined
Apr 23, 2011
Messages
322
rulerofiron99, more feedback:
1.use witchcraft
2.it usually happens when 2 or more MWs are attacking the same target.Example:The 1st has 4 corpses, 2nd one, after they run out of corpses they will attack about 3-5 more times until they stop
3.is it possible that if MW stops in the middle of attack (1 corpse gone), corpse will go back into cargo?
 
Level 8
Joined
Apr 23, 2011
Messages
322
@rulerofiron99:You feel the witchcraft overtaking you, is it a good feel?Anyway, nice system you got there, only flaw I noticed is that attacking unit won't play its "stand ready" animation after attack(I have no idea about witchcraft so I dunno if there are any more flaws in the system).
Javascript:You must spread some Reputation around before giving it to rulerofiron99 again.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
@rulerofiron99:You feel the witchcraft overtaking you, is it a good feel?Anyway, nice system you got there, only flaw I noticed is that attacking unit won't play its "stand ready" animation after attack(I have no idea about witchcraft so I dunno if there are any more flaws in the system).
Javascript:You must spread some Reputation around before giving it to rulerofiron99 again.

Thanks :)

I've found a bug myself, though. I made a cannon tower with a 0.05 cooldown, and when I order 3 of them to attack, one just refuses.

Meh, I'll fix it tomorrow.
 
Level 8
Joined
Apr 23, 2011
Messages
322
For some reason when I imported the system all triggers (all triggers in map) got disabled
It would show this (over 200 compile errors):
Line ###: Expected a reserved type or handle type

edit:even after deleting the system error is still there
also this happened (to all triggers):
trigger gg_trg_triggername = null
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
For some reason when I imported the system all triggers (all triggers in map) got disabled
It would show this (over 200 compile errors):
Line ###: Expected a reserved type or handle type

edit:even after deleting the system error is still there
also this happened (to all triggers):
trigger gg_trg_triggername = null

That's very strange.

Attach the map.
 
Level 8
Joined
Apr 23, 2011
Messages
322
Did you import the Unit Event trigger?

The CargoEvent variable is needed for the system to remove units when they are unloaded from the system, preventing them from being killed by the transport attacking.

I think I forgot to import it at first, but I will test it again as soon as I can since I didn't have much time today.

edit:now I noticed that unit indexer from "unit event" and "damage engine" re not the same...Which one to use?:/
after importing "event" this shows up
expected a name...
call TimerStart(udg_DEvTimer, 0, false, function DEvCheckDeath)
when disabled trigger works, but the system doesn't...damn
 
Last edited:
Status
Not open for further replies.
Top