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

Working Minefield.

Status
Not open for further replies.
Level 2
Joined
Dec 11, 2018
Messages
21
Hey everyone!
Me and a friend of mine have been working a while to get a Minefield trigger going but at this moment we haven´t gotten it to work as fully intended. I wish therefor for you guys, if you have any good ideas how to make it happen, to help me figure out how to fix the problems.

Description of the Idea:
I created a Minefield on my map where the general idea was to have invisible landmines randomly appearing all over the field. When a unit steps on the landmine or close to it, it will trigger a floating text with the message "click" and then after about 1-2 seconds trigger a explosion which damages the area around the spot.

With other words the landmines must:
- Be randomly appearing in the field and therefor change the position of the landmines over a periodic event.
- The unit that steps on the mine has to have a chance to run away from the explosion and therefor the explosion and the damage need to be delayed after triggered (which is why I want the message "click" appearing on trigger).
- There has to be a couple mines moving around at the same time in the area as there might be multiple characters in there at the same time.

First we tried goblin landmines which would be gr8, but sadly the explosion does not get delayed, only the damage which makes it unlogical and ugly.


This is the general idea what I have tried:
Mine Copy 17
Events
Time - Every 5.00 seconds of game time
Conditions
Actions

Set TempLocMine[1] = (Random point in Minefield2 <gen>)
Set TestRegion[1] = (Region centered at TempLocMine[1] with size (100.00, 100.00))

Trigger - Add to (This trigger) the event (Unit - A unit enters TestRegion[1])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units within 100.00 of TempLocMine[1])) Greater than or equal to 1
Then - Actions
Unit - Cause Dummy Flame 0078 <gen> to damage circular area after 1.00 seconds of radius 200.00 at TempLocMine[1], dealing 100.00 damage of attack type Siege and damage type Fire
Floating Text - Create floating text that reads "Click" at TempLocMine[1] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 25.00% transparency
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
Special Effect - Create a special effect at TempLocMine[1] using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
Special Effect - Destroy (Last created special effect)
Else - Actions
Custom script: call RemoveLocation(udg_TempLocMine[1])
Custom script: call RemoveRect(udg_TestRegion[1])

However the problem here is that IF the unit triggers the event just before the locationvariable (TempLocMine[1]) changes position, the explosion goes of at the new location instead of the location of the actual trigger.

I appologize for entering the trigger as a wall of text like this, I don´t know how to do it like other people have done it and hope the colouring helps reading it.

Im open to all changes and Ideas as long as it gets the job done. PM if you need additional info. Cheers!
 
Level 25
Joined
Feb 9, 2009
Messages
1,800
An index would do nicely,
detect when the mine goes off by the goblin ability, and then negate a variable at a periodic trigger
I highly recommend this tutorial if you are unfamiliar with indexing.


Alternatively, if you're looking for an easier route with a little bit of copy paste work, look to Delayed Action by Tasyen
A very useful tool for, well, what it says on the Tin.
 
Status
Not open for further replies.
Top