HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spawn and Delete

07-17-2008, 01:27 AM#1
FarsalanSX
ok so I've looked around in the triggers but i cant find out how to do this...
my first trigger is basic
Trigger:
Humans
Collapse Events
Unit - A unit enters Region 014 <gen>
Collapse Conditions
(Humans is A Hero) Equal to True
Collapse Actions
Unit - Create 2 Peasant for (Matching player) at (Center of Builder Spawn <gen>) facing Default building facing degrees
Unit - Remove (Triggering unit) from the game

uh that is supposed to be my spawn but i don't know how to connect this trigger to the death of the chooser trigger as in i don't know how to create the trigger to kill the race selector... any help?

BTW this is my Race Chooser spawn

Trigger:
Spirit Choosers
Collapse Events
Time - Elapsed game time is 5.00 seconds
Conditions
Collapse Actions
Unit - Create 1 Race Chooser for Player 1 (Red) at (Center of Region 016 <gen>) facing Default building facing degrees
Unit - Create 1 Race Chooser for Player 2 (Blue) at (Center of Region 016 <gen>) facing Default building facing degrees
Unit - Create 1 Race Chooser for Player 3 (Teal) at (Center of Region 016 <gen>) facing Default building facing degrees
Unit - Create 1 Race Chooser for Player 4 (Purple) at (Center of Region 016 <gen>) facing Default building facing degrees
Unit - Create 1 Race Chooser for Player 5 (Yellow) at (Center of Region 016 <gen>) facing Default building facing degrees
Unit - Create 1 Race Chooser for Player 6 (Orange) at (Center of Region 016 <gen>) facing Default building facing degrees
Unit - Create 1 Race Chooser for Player 7 (Green) at (Center of Region 016 <gen>) facing Default building facing degrees
Unit - Create 1 Race Chooser for Player 8 (Pink) at (Center of Region 016 <gen>) facing Default building facing degrees
Unit - Create 1 Race Chooser for Player 9 (Gray) at (Center of Region 016 <gen>) facing Default building facing degrees
Unit - Create 1 Race Chooser for Player 10 (Light Blue) at (Center of Region 016 <gen>) facing Default building facing degrees
Unit - Create 1 Race Chooser for Player 11 (Dark Green) at (Center of Region 016 <gen>) facing Default building facing degrees
Unit - Create 1 Race Chooser for Player 12 (Brown) at (Center of Region 016 <gen>) facing Default building facing degrees
07-17-2008, 01:44 AM#2
SeruK
Your trigger is messed up... If I've understood what you want to do I think it should look something like this:

Trigger:
Humans
Collapse Events
Unit - A unit enters YourRegion
Collapse Conditions
(Entering unit) Equal to YourVariable
((Entering unit) is A Hero) Equal to True
Collapse Actions
Unit - Create 2 Peasant for Player 1 (Red) at (Center of YourRegion) facing Default building facing degrees
Unit - Remove (Entering unit) from the game

I couldn't quite make out what you wanted to do with the conditions, so I gave you two alternatives. :P Pick ONE though.
07-17-2008, 01:49 AM#3
FarsalanSX
i was trying to make it so that the buying unit would die but i cant find something for that so i was hoping someone could help me find it or tell me about it.... i can send you my map so far...
07-17-2008, 01:58 AM#4
SeruK
Also that Race Chooser can be made much simpler and more efficient with Arrays (check out the Tutorials).

Create two new variables (ctrl+b), one of the type Player which you can name Players and give it an array size of 12 and one of the type Unit which you name RaceChoosers or something also with the array size 12.
Now, to your map initialization trigger add this:

Trigger:
Initialization
Collapse Events
Map initialization
Conditions
Collapse Actions
Set Players[1] = Player 1 (Red)
Set Players[2] = Player 2 (Blue)
Set Players[3] = Player 3 (Teal)
-------- etc. --------
Set Players[10] = Player 10 (Light Blue)
Set Players[11] = Player 11 (Dark Green)
Set Players[12] = Player 12 (Brown)

Then, head over to your Spirit Choosers trigger and instead of all those do this:

Trigger:
Spirit Choosers
Collapse Events
Time - Elapsed game time is 5.00 seconds
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Unit - Create 1 Keep for Players[(Integer A)] at (Center of YourRegion) facing Default building facing degrees
Set RaceChoosers[(Integer A)] = (Last created unit)

That last thing was if you wanted to refer to it later, like if you want to remove it or make it do something.
07-17-2008, 01:59 AM#5
SeruK
Quote:
Originally Posted by FarsalanSX
i was trying to make it so that the buying unit would die but i cant find something for that so i was hoping someone could help me find it or tell me about it.... i can send you my map so far...
What buying unit? The one entering the region?

If you mean the one entering the region you just Remove (Entering Unit) like I showed you.
07-17-2008, 02:58 AM#6
FarsalanSX
Quote:
Originally Posted by SeruK
That last thing was if you wanted to refer to it later, like if you want to remove it or make it do something.

uh i wanted them to die after they have bought a unit (from the race tavern)
07-17-2008, 11:30 AM#7
SeruK
Quote:
Originally Posted by FarsalanSX
uh i wanted them to die after they have bought a unit (from the race tavern)
Oh, then you have this neat little trick.

Trigger:
DIAF
Collapse Events
Unit - A unit Sells a unit
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 10, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Selling unit) Equal to RaceChooser[(Integer A)]
Collapse Then - Actions
Unit - Kill RaceChooser[(Integer A)]
Collapse Else - Actions
Do nothing
07-17-2008, 08:46 PM#8
FarsalanSX
hey man i cant find the (Selling unit) Equal to RaceChooser[(Integer A)] thing anywhere any help please i even searched it... i'll delete this post when i find it

*edit* nvm found it under unit comparison