HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Changing an armys controllers

07-20-2008, 08:01 PM#1
FarsalanSX
hey guys im making a map with a friend and mostly what i need is one last line of triggering... i need the trigger to be like

Unit - Unit dies
Dying unit is equal to "X King"
change control over all units of "owner of Dying Unit" to Neutral Hostile

i dun have the trigger sorry for bad format but this is my current trigger

Trigger:
Kings
Collapse Events
Unit - A unit Dies
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Unit-type of (Dying unit)) Equal to King of the Humans
Collapse Actions
Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + ( has died to + (Name of (Owner of (Killing unit)))))
Game - Defeat (Owner of (Dying unit)) with the message: Good Luck Next time...
Player - Set name of (Owner of (Dying unit)) to Rebellious Horde
Player Group - Make (All allies of (Owner of (Dying unit))) treat (All players) as an Enemy
07-20-2008, 08:18 PM#2
SeruK
First, make a Unit Group variable called TempGroup. Then, do this.

Trigger:
Actions
Set TempGroup = (Units in (Playable map area) owned by (Owner of (Dying unit)))
Unit Group - Pick every unit in TempGroup and do (Unit - Change ownership of (Picked unit) to Neutral Hostile and Retain color)
Custom script: call DestroyGroup(udg_TempGroup)

FYI, you do all that Custom scripting to prevent leaks. Tut here if you're interested in making your map not crash.
07-20-2008, 08:47 PM#3
FarsalanSX
THANK YOU i hope this works
Trigger:
Kings
Collapse Events
Unit - A unit Dies
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Unit-type of (Dying unit)) Equal to King of the Humans
(Unit-type of (Dying unit)) Equal to Lord of the Bandits
(Unit-type of (Dying unit)) Equal to Dwarven King
(Unit-type of (Dying unit)) Equal to Orc King
(Unit-type of (Dying unit)) Equal to Undead King
(Unit-type of (Dying unit)) Equal to Elven King
(Unit-type of (Dying unit)) Equal to Furbolg King
(Unit-type of (Dying unit)) Equal to Gnoll King
(Unit-type of (Dying unit)) Equal to Troll King
(Unit-type of (Dying unit)) Equal to Anna Kondra
Collapse Actions
Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + ( has died to + (Name of (Owner of (Killing unit)))))
Game - Defeat (Owner of (Dying unit)) with the message: Good Luck Next time...
Player - Set name of (Owner of (Dying unit)) to Rebellious Horde
Set TempGroup = (Units in (Playable map area) owned by (Owner of (Dying unit)))
Unit Group - Pick every unit in TempGroup and do (Unit - Change ownership of (Picked unit) to Neutral Hostile and Change color)
Custom script: call DestroyGroup(udg_TempGroup)


Thanks for all the help you have givin me for my beta map =) (im not taking all the credit for it my friend done the terrain based from the original Village builder DSM. i will release the Beta as soon as we test
07-20-2008, 09:26 PM#4
SeruK
Quote:
Originally Posted by FarsalanSX
Thanks for all the help you have givin me for my beta map =) (im not taking all the credit for it my friend done the terrain based from the original Village builder DSM. i will release the Beta as soon as we test
No problem mate, that's why we're here. :>