PDA

View Full Version : Simple trigger question


a_p3rf3ct_circl3
08-19-2005, 1:24 AM
Ok this is probably a simple question for anyone else but me (bcuz im lazy)

Im making an rpg and i have a Tavern hero selection type my trigger looks like this:

Choose em
Events
Unit - A unit Sells a unit
Conditions
(Unit-type of (Selling unit)) Equal to |cffffcc00Heroes of Light|r
(Unit-type of (Selling unit)) Equal to |cff000000Heroes of Darkness|r
((Sold unit) is A Hero) Equal to True
Actions
Player Group - Pick every player in (All players) and do (Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player))
Unit - Move (Sold unit) instantly to (Center of Beginning <gen>)
Player - Set (Owner of (Sold unit)) Food cap to 0

But what happens the hero doesnt appear in region: Begining, infact the hero isnt even created!

need help! plz

XZminX
08-19-2005, 7:45 AM
(Unit-type of (Selling unit)) Equal to |cffffcc00Heroes of Light|r
(Unit-type of (Selling unit)) Equal to |cff000000Heroes of Darkness|r


Ok! Whats that? You're comparing Unit type to string... (you used color code) How did you do that? The color code is unnecessary. Just make a comparison to unit type. Why check unit type anyway??? Will someone else buy heroes in your map except the players?


Player Group - Pick every player in (All players) and do (Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player))
Unit - Move (Sold unit) instantly to (Center of Beginning <gen>)
Player - Set (Owner of (Sold unit)) Food cap to 0

What you do here is to make every player unavailable to buy another hero of sold type. And you have two unit types defined, right? Does it make any sence? Assign a variable to sold unit and check if that variable not equal to no unit to see if any unit is created. If not you made an error in Object Editor with making the Tavern. If there is a unit, move it to your region and don't forget to move the camera aswell. (it looks nicer)

a_p3rf3ct_circl3
08-19-2005, 3:56 PM
If there is a unit, move it to your region and don't forget to move the camera aswell. (it looks nicer)

well when that unit enters the region a dialog box pops up so the camera doesnt move

XZminX
08-19-2005, 6:11 PM
Just add a wait action before the dialog pups up so the camera has enough time to move.

a_p3rf3ct_circl3
08-20-2005, 1:22 AM
well i got it to work (thanks) and i added variable "soldhero" i think it is and did Set soldhero = (sold unit) and it worked:)