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

Making something blow up when I want it to

Status
Not open for further replies.
Level 3
Joined
Jun 25, 2007
Messages
42
OK I have this map I add stuff to every once in a while and I want to add gnome villages that blow up ONLY when ever any units owned by players
get within a certain distance of them and when they blow up i have it set to where it makes more of these Gnome villages in other locations and I also want them to blow up when players get within a certain distance. I could only get it to work on the pre-placed gnome villages. When the game made more gnome villages that were in random locations they wouldn't blow up
 
Level 2
Joined
Jun 10, 2007
Messages
19
I think you should make it so that when more gnomes come, it either creates a region around them or ir makes the old gnomes revive without the revival graphics, this way those gnomes are the same. I hope this is what you wanted.
 
Level 3
Joined
Jun 25, 2007
Messages
42
Hey serraavenger theres no trigger in the world editor that will allow me to make a trigger that states what you said and if I could figure out how I would just make a trigger so that whenever a player owned unit got with say 5 centimeters of any gnome village it would blow up. But Cabloo i'll try ur idea but when they revive I want them to revive in a random location I'll see if I can do that. Thanks for the help guys
 
Level 3
Joined
May 6, 2007
Messages
66
  • Events - A unit enters a region
  • Conditions - Region contains <Gnome Villager>
  • Actions - ... ...
I will guess ^.
 
Level 5
Joined
Oct 12, 2004
Messages
109
Hm, Try this.

First Trigger:

  • Events
    • Map initialization
  • Actions
    • Region - Center (GnomeVillage) on (Random point in (Playable map area))
    • Unit - Create 1 GnomeBuilding for Player 1 (Red) at (Random point in (GnomeVillage)) facing Default building facing degrees
    • Set gnomebuilding[1] = (Last created unit)
    • Unit - Create 1 GnomeBuilding for Player 1 (Red) at (Random point in (GnomeVillage)) facing Default building facing degrees
    • Set gnomebuilding[2] = (Last created unit)
    • Unit - Create 1 GnomeBuilding for Player 1 (Red) at (Random point in (GnomeVillage)) facing Default building facing degrees
    • Set gnomebuilding[3] = (Last created unit)
    • Trigger - Turn on (Trigger2)
Second trigger:
  • Events
    • Unit - A unit enters (GnomeVillage)
  • Conditions
    • ((Owner of (Triggering unit)) controller) Equal to User
  • Actions
    • Unit - Kill (GnomeBuilding1)
    • Unit - Kill (GnomeBuilding2)
    • Unit - Kill (GnomeBuilding3)
    • Special Effect - Create a special effect at (Center of GnomeVillage)) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
    • Trigger - Run (First Trigger) (ignoring conditions)
    • Trigger - Turn off (This trigger)
Hope this helps. If u need anything else pm me. :)
 
Level 6
Joined
Apr 16, 2007
Messages
177
Hm, Try this.

First Trigger:

  • Events
    • Map initialization
  • Actions
    • Region - Center (GnomeVillage) on (Random point in (Playable map area))
    • Unit - Create 1 GnomeBuilding for Player 1 (Red) at (Random point in (GnomeVillage)) facing Default building facing degrees
    • Set gnomebuilding[1] = (Last created unit)
    • Unit - Create 1 GnomeBuilding for Player 1 (Red) at (Random point in (GnomeVillage)) facing Default building facing degrees
    • Set gnomebuilding[2] = (Last created unit)
    • Unit - Create 1 GnomeBuilding for Player 1 (Red) at (Random point in (GnomeVillage)) facing Default building facing degrees
    • Set gnomebuilding[3] = (Last created unit)
    • Trigger - Turn on (Trigger2)
Second trigger:
  • Events
    • Unit - A unit enters (GnomeVillage)
  • Conditions
    • ((Owner of (Triggering unit)) controller) Equal to User
  • Actions
    • Unit - Kill (GnomeBuilding1)
    • Unit - Kill (GnomeBuilding2)
    • Unit - Kill (GnomeBuilding3)
    • Special Effect - Create a special effect at (Center of GnomeVillage)) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
    • Trigger - Run (First Trigger) (ignoring conditions)
    • Trigger - Turn off (This trigger)
Hope this helps. If u need anything else pm me. :)

this would not work with more than one gnome village.
You would need arrays or a ringbuffer to do that.
And apart from this, there is an action that does what I said ( add an event ).
It is called:
  • Trigger - Add new event
.

And whenever you create a new town, you first create the main building, then add the event of "a uniot comes into range [your range] of last created unit", then you create all the other buildings within the range you specified.
And in the actions of the blow up trigger you simply pick all units of gnome and order them to kabumm or explode....
 
Status
Not open for further replies.
Top