• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Creating themed traps?

Status
Not open for further replies.
Level 8
Joined
Jan 17, 2019
Messages
163
Hello, in my project I'd like to create a variety of traps similar to Goblin Land Mine except they all do different things. For example one of my units should place a bomb visible to friendlies shaped like the "stake" doodad and when a unit passes near they'll get an effect that looks and acts like Crypt Lord's Impale ability. I'd also like to do ones that only debuff the enemy units.

So far all my experiments with the Goblin Land Mine have failed, I feel like I might be trying to do this the hard way. Anyone up for helping me get the ability/trigger started?
 
I think there are three approaches for traps.
  1. Use goblin landmine and detect when it dies. Use a damage detection system to rule out fatal damage (trap was killed) so only self destructs should be detected. When it dies from self destruct you search the surrounding area for victims that triggered it and then apply the appropriate themed effect to them.
  2. Periodically poll dummy mine units for victims. Check units nearby and if any are in detonation range kill the mine and apply the appropriate themed effect to the victims.
  3. Register a unit enters range event with dummy mines. Validate the unit which entered range for an appropriate victim. If one is found, detonate and apply the appropriate themed effect. Be aware that unit in range events can only get the entering unit, and not the unit who's range was entered so that must be tracked separately. To prevent leaks either a trigger per mine must be created, or periodically the trigger must be recreated to allow events to be recycled.
 
Status
Not open for further replies.
Back
Top