| 09-16-2003, 09:43 AM | #1 |
I've been trying for a while to make a trigger but I can't seem to get it right. I have a shop that sells three ivory towers. I only want 3 ivory towers in play at any point either as items in an inventory or as built towers on the ground. Now, I can make it so that when a built tower is destroyed it adds an ivory tower to the shop and I can make it so that if the item is destroyed it adds an ivory tower to the shop. What I can't seem to do is make it so that when a hero puts an ivory tower where he isn't supposed to (they're only allowed to be in certain regions), it destroys the tower it's building, and replaces the item in the heros inventory. There doesn't seem to be an action where I can do something like Create Ivory Tower for Owner of Triggering Unit's Hero. Is there any way to do what I want to do? |
| 09-16-2003, 10:35 AM | #2 | |
Quote:
The IS actually. If you're talking about replacing the ITEM, it's under < Item - Create item > And then create item and give to triggering unit. If that doesn't work (what the heck?) Do an action with the condition < Owner of unit = Player 42 > and then do whatever you like to player 42. 42 is the answer to life and the universe. |
| 09-17-2003, 12:14 AM | #3 |
The thing is I only want the item to be replaced if he places it in the wrong place. From what I can tell this requires a seperate trigger to detect the tower being built and then check where it is. Event: Unit - A unit Uses an item Condition: (Item-type of (Item being manipulated)) Equal to Ivory Tower Action: Set HeroMakingTower = (Hero manipulating item) That is my first trig. Now I use this one to detect actual tower being placed. Event: Unit - A unit Begins construction Conditions: (Unit-type of (Triggering unit)) Equal to Scout Tower And - All (Conditions) are true Conditions (BottumHumanTowerZone <gen> contains (Triggering unit)) Equal to False (LeftHumanTowerZone <gen> contains (Triggering unit)) Equal to False (RightHumanTowerZone <gen> contains (Triggering unit)) Equal to False Actions: Unit - Remove (Triggering unit) from the game Hero - Create Ivory Tower and give it to HeroMakingTower Now the one thing I'm missing (I think I haven't actually tested this trigger) is that I need to display text to the player about why his tower was cancelled. There seems to be no way to do Display Text to Owner of Triggering Unit. Ideas? |
| 09-17-2003, 12:17 AM | #4 | |
Quote:
Ahh... but I'm sure there is. |
| 09-17-2003, 12:23 AM | #5 |
Game - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) for 30.00 seconds the text: blahblah That might work..... |
| 09-17-2003, 12:52 AM | #6 |
Sweet Das. Thanks. My trigger has another problem. For some reason it just creates the item and puts it on the ground and it counts a unit being removed as a unit being destroyed so it acts like there's one less tower in play every time someone misplaces a tower. |
| 09-17-2003, 01:06 AM | #7 |
Your part where it sets the variable to the hero manipulating item unit must not be working. Can't really think of a solution for this... its getting late and im tired. :bgrun: For the second part im guessing what you mean is that when it removed the building its placing another in the shop and giving one back to the player? If so you could just let it not give the item back to the unit and keep it creating the one in the shop but then he would have to walk back and get another every time one was destroyed. Either that or you can just set it so when it removes the building, it also sets the shop to have 1 less ivory tower after. |
| 09-17-2003, 03:03 AM | #8 |
The ideal scene is that if he places it wrong he gets another one in his inventory and then the tower is vaporized. Period. Is there any way to get rid of it without it registering as dying? Maybe cancel construction? |
| 09-17-2003, 03:34 AM | #9 |
Grrr this makes no sense. This trigger isn't working: Unit - A unit Acquires an item (Item-type of (Item being manipulated)) Equal to Ivory Tower Set HumanTowersInPlay = (HumanTowersInPlay + 1) If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions HumanTowersInPlay Less than 3 Then - Actions Neutral Building - Remove Ivory Tower from Goblin Merchant 0175 <gen> Neutral Building - Add Ivory Tower to Goblin Merchant 0175 <gen> with 1 in stock and a max stock of 1 Else - Actions Do nothing Now I used those same actions for the shop in two seperate triggers so I know they work which means something is wrong with the conditions of this statement. What's up? This is even weirder. I put a Game - display message in there with the shop manipulation to see if it was getting to that part of the trigger and it is. There is no conceivable reason for this **** not to work. |
| 09-17-2003, 03:52 AM | #10 |
That's ****ing wack. If you put a remove item from shop and an add item to shop right next to eachother it doesn't work but if you add a wait of .01 seconds between it works fine. |
| 09-17-2003, 04:27 AM | #11 |
This is the best I can do and it's not working. Unit Group - Pick every unit in (Units owned by PlayerMakingTower matching (((Picked unit) is A Hero) Equal to True)) and do (Hero - Create Ivory Tower and give it to (Picked unit)) PlayerMakingTower has the value of the player who started the tower so this seems like it should work. I'm so stuck. |
