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

[Trigger] Adding and removing units with regards to a unit selector

Status
Not open for further replies.
Level 1
Joined
Jul 7, 2008
Messages
5
G'day guys, I'm having a bit of trouble getting my head around setting up a trigger for selecting a group of units using a unit dedicated to the task of selection, having said units spawn in a playing field, and then when those units die (or a remove unit region is triggered) the selector returns and the said units are removed from the field of play.

Basically, in a bit more detail:

1. A selector spawns at region 0 belonging to Player Foo when the map initialises.
2. Player Foo moves that selector to region 1 which creates x number of units at region 2.
3. Upon spawning, that selector dies/is removed from the selection area, which just leaves the selected units.
4. When all the spawned units in region 2 beloning to Player Foo die, another (or the same) selector is created at region 0, ready for Player Foo to select a new batch of units.
5. If Player Foo has passive units, ie Shades, and Player Bar is not killing them deliberately or through no fault of his own (which would cause Player Foo to be unable to replace them), Player Foo can move another dedicated unit to region 3, which will kill any unit at region 2 belonging to him, and create his selector again ready for action.

Sorry for that mouthful, but it's as best I could break it down. I attempted to Google for information regarding this, as well as searching various forums, and turned up nothing (probably due to not knowing exactly what I'm looking for here, new to Warcraft 3 map editor), and even with some experience in the Starcraft editor, the sheer scope of this one has left me befuddled. >>

Thanks in advance, and I'll be sure to give credit where it's due :smile:
 
Level 1
Joined
Jul 7, 2008
Messages
5
Thanks for pointing that out >> (did get lost in there somewhere).

How can I implement the above? Would somebody be able to give me a basic rundown/outline of the events, conditions and actions involved?

Cheers
 
Level 5
Joined
Oct 17, 2006
Messages
151
So basically you are representing the selector with a unit and depending on where the unit goes a certain action occurs (units in region 2 die or are created etc) right?

(Off topic) Btw where are you from? I sense a cool accent in your writing that kind of sounds Australian... (mainly cuz of your word choice)
 
Level 5
Joined
Oct 17, 2006
Messages
151
Nope, I'm not Australian, and English is not my mother language. I'm Dutch. And for your question: Yes. The selector is a unit, that you can control to place in regions you assign. If that's what you want ofcourse.

silly goose.... my question was directed to nogagplz ^_^

and then if that's the question I cant give you an entire trigger cuz im not at my pc HOWEVER i can give you a real crude version of GUI :thumbs_up:

Map initialization
Event:
Map starts
Condition:
Action:
Run "create selector" trigger

----

Create selector
Event:
Condition:
Action:
Create 1 "whatever unit type" for "set the player to the person selecting things of course" at "the region (region 0?)
Set "unit selector" = (last created unit)

----

Selector enters regions 0-3
Action:
Unit enters region 0
Unit enters region 1
Condition:
Unit entering region = "Unit selector" = true
Action:
If then else multiple fuctions:
---Condition:
---Entered region = 1
---Then:
---Create x number of units at region 2
---move "unit selector" to region 0
---Else:
------- for multiple regions you continue the cycle here otherwise don't put anything here -------
As for #5 im not sure what to do about that one. If you could explain it more I could help.
 
Level 5
Joined
Oct 17, 2006
Messages
151
Sorry, I thought you were him xD
Your names do both start with an N though.
LOL!!! That explains it...

Oh well then I posted to your answer nogagplz if I understood the question correctly... If I didn't then explain it to me more what you are trying to do (use exact examples of what you are doing and who is being created etc.) so that I can help you.
 
Level 1
Joined
Jul 7, 2008
Messages
5
First 4 points are safe to ignore now, managed to work that our with a friend, which involves creating a selector at map initialisation, then disabling that trigger. The work of spawning the selector when appropriate then falls into down to two other triggers, one that springs to action when a player has no units left alive in the region covering the play area, and one that stops the selector from spawning while units are alive. It's probably a very convoluted method of doing it, but if it ain't broke don't fix it. :D

Point 5 is basically supposed to be a method of killing your units in the case that you wish to select another group, are stuck with a unit incapable of attacking and an opposing player won't kill it for you, etc. The way I saw it happening was you move a unit to a region that kills that unit, kills your units in play, which enables a new selector to be made, and then makes a new unit for removing units in play for future use. I just haven't been able to work out what triggers to use for the units which are currently in play, and am in need of a shove in the right direction. Hope that makes a bit more sense >>

(offtopic bit in response to neavea) And yeah, I'm Australian. Prior G'day was a dead giveaway ;D
 
Level 5
Joined
Oct 17, 2006
Messages
151
(offtopic bit in response to neavea) And yeah, I'm Australian. Prior G'day was a dead giveaway ;D
Sweet!!! i've done to many Australian accents to be able to recognize it right away! :thumbs_up:

Do you live there as well?

Point 5 is basically supposed to be a method of killing your units in the case that you wish to select another group, are stuck with a unit incapable of attacking and an opposing player won't kill it for you, etc. The way I saw it happening was you move a unit to a region that kills that unit, kills your units in play, which enables a new selector to be made, and then makes a new unit for removing units in play for future use. I just haven't been able to work out what triggers to use for the units which are currently in play, and am in need of a shove in the right direction. Hope that makes a bit more sense >>

Ok! That explains it! Then for starters, will there only be one group that we are referring to?

If so then We are going to have to change "selector enters region 0-3"

Selector enters regions 0-3
Action:
Unit enters region 0
Unit enters region 1
Unit enters region 3
Condition:
Unit entering region = "Unit selector" = true
Action:
If then else multiple fuctions:
---Condition:
---Entered region = 1
---Then:
---Create x number of units at region 2
---Set "Units spawned" = (last created unit group)
---move "unit selector" to region 0
---Else:
-------Conditions:
-------Entered region = 3
-------Then:
-------Pick all units in "units spawned"
----------Loop:
----------Explode (picked unit)
-------Else:

------- for multiple regions you continue the cycle here otherwise don't put anything here -------

Added stuff are in green :cool:
 
Level 1
Joined
Jul 7, 2008
Messages
5
Worked like a charm, thank you very much!

I'll add you into the credits neavea (same for your Avator, for having the decency to reply), but since this map isn't going to be seen outside of me and 3 other people, I'll also add to your reputation :)

offtopic@neavea

Yeah, have lived in Australia all my life. We can continue this over pm or something equivalent if you'd like ;)
 
Status
Not open for further replies.
Top