hopy
Active Member
- Reaction score
- 64
Hey everyone, a pretty annoying little trigger here that I cant get to work, so I'm hoping you guys will be able to detect the problems in it and hopefully we can get it to work.
The thing I'm trying to create is a way that upgrades unit1 (Warrior) into unit2 (Berserker) afther unit1 uses the upgrade ability located in a spellbook on the Warrior.
This ability, called Upgrade to Berserker, has a casting time, no mana cost, and it's based on Channel with War Stomp (Tauren Chieftan's stomp ability) as Base ID. The hotkey for the Warstomp is B, and the spellbooks hotkey is T.
I've already made the whole unit1 changes into unit2 trigger, the gold, lumber and food costs and everything. The only thing I still need is changing the trigger in such a way that it allows multiple units to upgrade, and start upgrading at once.
I've made two triggers that I thought would work and do exactly what I wanted them to do, but the problem is they don't work at all.
What's this trigger supposed to do?
When A unit starts the upgrade ability (triggering unit):
- Places the Triggering into the unit group: Upgrade_Group.
- Picks every other Warrior currently being selected by the player.
- Places the Picked Unit into the unit grouo: Upgrade_Group.
- Forces the Picked Unit/player to open the spellbook and cast the upgrade ability.
- Places every unit that was selected when the trigger started back into the players selection.
Why the Upgrade_Group? Why the Upgrade_Group in the trigger conditions? That's to prevent an endless loop... D:
What oh what is trigger supposed to do? :O
- It checks if the player has enough gold, lumber and food. If that's not the case the upgrading unit is removed from Upgrade_Group and the player gets a massage telling him/her that he sucks and needs more recourses. >:
- Decreases recourses of the player and replaces the Warrior with a Berserker.
- Origonal Warrior is than removed from the unit group.
Now what happens is... absolutely nothing...
I've added some debug massages into the first trigger (Berserker start) that was supposed to show all the names of units in Upgrade_Group at the end of the first trigger. This was tested using 3 Warrior units selected while one of them casted the upgrade ability, the result was that instead of 3x the massage "Warrior" I got 2x "Customo023" I believe it was, and all units got deselected and none of them upgraded.
Thanks for any help, and +rep for any usefull replies.
(Now a small question that I wanted to ask: Is it posible to increase the amount of letters you can place in Quest? Because if I place more than x symbols in one quest page they wont show).
The thing I'm trying to create is a way that upgrades unit1 (Warrior) into unit2 (Berserker) afther unit1 uses the upgrade ability located in a spellbook on the Warrior.
This ability, called Upgrade to Berserker, has a casting time, no mana cost, and it's based on Channel with War Stomp (Tauren Chieftan's stomp ability) as Base ID. The hotkey for the Warstomp is B, and the spellbooks hotkey is T.
I've already made the whole unit1 changes into unit2 trigger, the gold, lumber and food costs and everything. The only thing I still need is changing the trigger in such a way that it allows multiple units to upgrade, and start upgrading at once.
I've made two triggers that I thought would work and do exactly what I wanted them to do, but the problem is they don't work at all.
Trigger:
- Berserker Start
- Events
- Unit - A unit Begins casting an ability
- Conditions
- ((Matching unit) is in Upgrade_Group[(Player number of (Owner of (Triggering unit)))]) Not equal to True
- (Ability being cast) Equal to Upgrade to Berserker
- Actions
- Unit Group - Add (Triggering unit) to Upgrade_Group[(Player number of (Owner of (Triggering unit)))]
- Set Unit_Group = (Units owned by (Owner of (Triggering unit)) matching ((((Matching unit) is selected by (Owner of (Triggering unit))) Equal to True) and (((Unit-type of (Matching unit)) Equal to Warrior) and (((Matching unit) is in Upgrade_Group[(Player number of
- Selection - Clear selection for (Owner of (Triggering unit))
- Unit Group - Pick every unit in Unit_Group and do (Actions)
- Loop - Actions
- Unit Group - Add (Picked unit) to Upgrade_Group[(Player number of (Owner of (Triggering unit)))]
- Selection - Select (Picked unit)
- Game - Force (Owner of (Triggering unit)) to press the key T
- Game - Force (Owner of (Triggering unit)) to press the key B
- Selection - Remove (Picked unit) from selection
- Loop - Actions
- Selection - Select Unit_Group for (Owner of (Triggering unit))
- Custom script: call DestroyGroup (udg_Unit_Group)
- Events
What's this trigger supposed to do?
When A unit starts the upgrade ability (triggering unit):
- Places the Triggering into the unit group: Upgrade_Group.
- Picks every other Warrior currently being selected by the player.
- Places the Picked Unit into the unit grouo: Upgrade_Group.
- Forces the Picked Unit/player to open the spellbook and cast the upgrade ability.
- Places every unit that was selected when the trigger started back into the players selection.
Why the Upgrade_Group? Why the Upgrade_Group in the trigger conditions? That's to prevent an endless loop... D:
Trigger:
- Berserker
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- ((Matching unit) is in Upgrade_Group[(Player number of (Owner of (Triggering unit)))]) Equal to True
- (Ability being cast) Equal to Upgrade to Berserker
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Owner of (Triggering unit)) Current gold) Greater than or equal to 70
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Owner of (Triggering unit)) Current lumber) Greater than or equal to 4
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Owner of (Triggering unit)) Food used) Less than or equal to (((Owner of (Triggering unit)) Food cap) - 1)
- Then - Actions
- Player - Set (Owner of (Triggering unit)) Current gold to (((Owner of (Triggering unit)) Current gold) - 70)
- Player - Set (Owner of (Triggering unit)) Current lumber to (((Owner of (Triggering unit)) Current lumber) - 4)
- Unit - Replace (Triggering unit) with a Berserker using The new unit's default life and mana
- Unit Group - Remove (Triggering unit) from Upgrade_Group[(Player number of (Owner of (Triggering unit)))]
- Else - Actions
- Game - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the text: |cffff0000You need ...
- Unit Group - Remove (Triggering unit) from Troll_Group[(Player number of (Owner of (Triggering unit)))]
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- Game - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the text: |cffff0000You need ...
- Unit Group - Remove (Triggering unit) from Troll_Group[(Player number of (Owner of (Triggering unit)))]
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- Game - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the text: |cffff0000You need ...
- Unit Group - Remove (Triggering unit) from Troll_Group[(Player number of (Owner of (Triggering unit)))]
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
What oh what is trigger supposed to do? :O
- It checks if the player has enough gold, lumber and food. If that's not the case the upgrading unit is removed from Upgrade_Group and the player gets a massage telling him/her that he sucks and needs more recourses. >:
- Decreases recourses of the player and replaces the Warrior with a Berserker.
- Origonal Warrior is than removed from the unit group.
Now what happens is... absolutely nothing...
I've added some debug massages into the first trigger (Berserker start) that was supposed to show all the names of units in Upgrade_Group at the end of the first trigger. This was tested using 3 Warrior units selected while one of them casted the upgrade ability, the result was that instead of 3x the massage "Warrior" I got 2x "Customo023" I believe it was, and all units got deselected and none of them upgraded.
Thanks for any help, and +rep for any usefull replies.
(Now a small question that I wanted to ask: Is it posible to increase the amount of letters you can place in Quest? Because if I place more than x symbols in one quest page they wont show).