• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Ability selection for heroes in Tavern

Status
Not open for further replies.
Level 2
Joined
Mar 20, 2016
Messages
15
Hi guys!


I want to create a map like this:
5v5 map
TAVERN WITH 10 heroes


Each player1, 2 , 3 ,4 ...... to chose 5 abilities from different heroes from TAVERN and after choosing those 5 abilities last chosen action to be the hero. I just can't realize how to do this. can anybody help me plz?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Not possible. The command card system does not support previewing hero abilities from inside a tavern.

You could have all 10 heroes pre-placed on the map for players to select and choose abilities from. Each of the heroes is a dummy (not the real hero) with the abilities being sold items which go to the hero selector unit. Triggers translate these dummy items into ability choices to assemble the player's hero with.

The above approach is used by most custom hero maps except instead of separate heroes to advertise the abilities they are stack 4*3 in generic ability shops, usually grouped by some classification scheme.

Do note that such customization is a bad design decision. One might think it offers the player great choice but in reality there are only a few "correct" choices due to how the abilities perform resulting in many abilities never being used while others are used practically always. Better balance can be achieved with tailored heroes with unique skills.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
I guess you could use a spell book ability for each hero and then fill each book with dummy abilities representing the actual abilities each hero has. In response to one of them being used you add the ability to the created hero. There may be issues with running out of unique order IDs if heroes have lots of abilities.
 
Level 2
Joined
Mar 20, 2016
Messages
15
sorted out with tavern and spell book. but i have another issue


When game starts i want all players from 1 to 10 to chose some abilities and create the hero with abilities chosen. I have no ideea how to start... can anybody give me a bit of hand :D?:D

THANKS
 
Level 2
Joined
Mar 20, 2016
Messages
15
Hi..

So i have managed to make hero to buy skills from tavern but not as SPELL BOOK.
Let me explain.

So i have a Tavern where there are 8 different skills. Once the game starts i can chose with my hero some skills and the hero will learn them and use them in game. That's all good to here, but if i'm changing a skill to "spell book" it will put the spell book into inventory and that's all.

I want to make the hero to click on a spell book and chose a spell from inside the spell book. How can i do that? thanks!!!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
I have done that and still doing same. Any other ideas?
There is no way that it will "it will put the spell book into inventory and that's all" if you did what I said. Since that can only happen if it sells an item as only items can go to an "inventory". Either you are not describing what is happening correctly or you are still selling a spellbook item instead of giving the tavern the spellbook ability.
 
Level 2
Joined
Mar 20, 2016
Messages
15
Fixed. Done it again and it worked... i don't know where i did wrong. But now ... if i click on the spell inside the spell book ... the hero is not learning it... If i click to the same spell outside the spell book it is learning it.

Unit - A unit Acquires an item


(Item-type of (Item being manipulated)) Equal to Battle Roar





Actions
Set skill[(Player number of (Triggering player))] = Battle Roar
Wait 0.20 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of skill[(Player number of (Triggering player))] for (Triggering unit)) Less than 1
Then - Actions
Unit - Add skill[(Player number of (Triggering player))] to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of skill[(Player number of (Triggering player))] for (Triggering unit)) Less than 20
Then - Actions
Unit - Increase level of skill[(Player number of (Triggering player))] for (Triggering unit)
Else - Actions
Game - Display to (Player group((Triggering player))) for 5.00 seconds the text: bla bla bla
Player - Add 100 to (Triggering player) Current lumber
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Seeing as your event has the words "Acquires an item" in it there is no way it can respond to an ability being used. The rest of the trigger I cannot judge because all indentation is lost (you did not wrap it in TRIGGER tags).

Either you give the unit the spellbook ability (not sell a spellbook item, you give it the ability the item uses) or you use another approach.

Here is a small list of different approaches.
  • Each hero is represented by a spellbook ability given to the vendor unit. Each hero ability is an ability inside the appropriate spellbook. Each hero ability inside the spell book is given a unique order ID and is based on channel. Each player gets their own vendor so that one can match uses to players.
  • Each hero is represented by an item given to the vendor unit. Each hero ability is an item inside another specific vendor unit. Buying the hero item then forces selection of the other specific vendor unit. Buying the hero ability items then learns the appropriate hero abilities.
  • Each hero and hero ability is represented by an item on a marketplace. Buying a hero item changes the available item choices in the marketplace using triggers to reveal a selection of hero abilities. Each player has their own marketplace to avoid choice conflicts.
 
Level 5
Joined
Nov 21, 2014
Messages
151
how do you put this on triggers? ......................

Trigger in square brackets then slash trigger in brackets.
(
  • (your trigger)
    • [<slash>TRIGGER] ( I can't do it otherwise it will turn it into a trigger :))
  • Give the unit the spellbook ability not the item. Make it a custom spellbook with dummy abilities that don't do anything, and when casted you make it give them a 'real' ability.
  • EDIT: Have you figured it out yet or do I need to give you a helping hand?
 
Last edited:
This is easy. Everyone is making it too hard.

  • Set up the tavern with your heros.
  • Make a trigger that has the event a unit enters playable map.
  • Set variables to save the unit. Hero[Player number(owner of triggering unit)]
  • Hide the hero unit.
  • Now select a new tavern that sells abilities (actually dummy units that look like abilities)
  • Set a number for how many abilities a player can have. AbilityCount[Player number(owner of triggering unit)]
  • When a dummy unit is purchased add the corresponding ability to Hero[Player number(owner of triggering unit)]

    This is done with a series of if/then functions. If DummyUnit is FireBolt then add Fire Bolt to Hero[x]​
  • Set AbilityCount[x] = AbilityCount[x] +1
  • When AbilityCount[x] = MaxAbilities
  • Then Unhide Hero[Player number(owner of triggering unit)]
  • Trigger Player to select hero

You can make the extra taverns flying units with tiny models but normal sized selections circles and place them right on top of the first tavern, so it looks like the same tavern is selected. If the player selects somthing else, just make him select the ability tavern again. You can even make an ability tree of taverns so dummy units could be called Fire Abilities or Passive Spells. Remember to remove dummies as soon as the are purchased. I don't like the Item idea because tomes leak and items are in a separate OE section, but you could use dummy items just as easily.
 
Level 8
Joined
Jan 28, 2016
Messages
486
I've never played DotA Imba but I assume the system your talking about is similar to the one in Legends of DotA map. I can't say for certain how it's done and even though it sounds quite simple on paper, it's quite an undertaking. As DSG has said, you would need a spellbook for each Hero and 5 dummy abilities for each spellbook. Not to mention the actual abilities themselves. I'm not trying to discourage you but unless you're willing to commit a lot of time and effort into this, then it will be a difficult project logistically speaking. Still possible though.

Creating the spellbooks and dummy abilities isn't all that difficult, just time-consuming. The triggers on the other hand can become problematic. What you'll probably need is something along these lines:
  • An array to store all the dummy abilities,
  • Turn-based system for players to pick abilities,
  • Hero selection phase after players have chosen their abilities,
  • And checks for certain conditions (Eg: when a player hasn't picked anything).
Again, easier said than done.

As for your trigger, it won't work for the reason DSG told you. I've come up with a possible solution but it's very basic and would require more information about your map and additional triggers to actually function properly. Anyway something like this could work:
  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set AbilitiesStored[1] = Pyromancer 1
      • Set AbilitiesStored[2] = Pyromancer 2
      • Set AbilitiesStored[3] = Pyromancer 3
      • Set AbilitiesStored[4] = Pyromancer 4
      • Set AbilitiesStored[5] = Pyromancer 5
      • Set AbilitiesStored[6] = Lich King 1
      • Set AbilitiesStored[7] = Lich King 2
      • Set AbilitiesStored[8] = Lich King 3
      • Set AbilitiesStored[9] = Lich King 4
      • Set AbilitiesStored[10] = Lich King 5
      • Set AbilitiesIndexMax = 10
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set PlayerAbilities[(Player number of (Picked player))] = (((Player number of (Picked player)) - 1) x 5)
  • Ability Draft Selection
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • For each (Integer AbilitiesIndex) from 1 to AbilitiesIndexMax, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to AbilitiesStored[AbilitiesIndex]
            • Then - Actions
              • Set PlayerAbilities[(Player number of (Triggering player))] = (Ability being cast)
              • Set PlayerAbilities[(Player number of (Triggering player))] = (PlayerAbilities[(Player number of (Triggering player))] + 1)
              • Player Group - Pick every player in (All players) and do (Actions)
                • Loop - Actions
                  • Player - Disable (Ability being cast) for (Picked player)
            • Else - Actions
There are a couple of reasons for storing the dummy abilities into an ability array at map init:
  1. Easier to keep track of when editing/adding more Heroes/abilities
  2. Able to loop through each ability without editing the loop in the 2nd trigger
The Ability Draft Selection trigger basically loops through all the dummy abilities until it finds the one that is being cast. It then saves it into the PlayerAbilities under the specific player's number and then adds +1. The way this is setup is a bit confusing; PlayerAbilities[0 to 4] are for Player 1 (Red), PlayerAbilities[5 to 9] for Player 2 (Blue) and so on. I'm also assuming that once an ability is chosen, it's disabled for all players so that it cannot be selected from that point onwards.
 
Level 5
Joined
Nov 21, 2014
Messages
151
This is easy. Everyone is making it too hard.

  • Set up the tavern with your heros.
  • Make a trigger that has the event a unit enters playable map.
  • Set variables to save the unit. Hero[Player number(owner of triggering unit)]
  • Hide the hero unit.
  • Now select a new tavern that sells abilities (actually dummy units that look like abilities)
  • Set a number for how many abilities a player can have. AbilityCount[Player number(owner of triggering unit)]
  • When a dummy unit is purchased add the corresponding ability to Hero[Player number(owner of triggering unit)]

    This is done with a series of if/then functions. If DummyUnit is FireBolt then add Fire Bolt to Hero[x]​
  • Set AbilityCount[x] = AbilityCount[x] +1
  • When AbilityCount[x] = MaxAbilities
  • Then Unhide Hero[Player number(owner of triggering unit)]
  • Trigger Player to select hero

You can make the extra taverns flying units with tiny models but normal sized selections circles and place them right on top of the first tavern, so it looks like the same tavern is selected. If the player selects somthing else, just make him select the ability tavern again. You can even make an ability tree of taverns so dummy units could be called Fire Abilities or Passive Spells. Remember to remove dummies as soon as the are purchased. I don't like the Item idea because tomes leak and items are in a separate OE section, but you could use dummy items just as easily.
Probably wanna use a local int for the [x] btw
 
Level 8
Joined
Jan 28, 2016
Messages
486
I'm back with some potentially bad news. I don't know if anyone else has noticed this but when you add a Hero ability via triggers, it is set to Level 1 by default and cannot be upgraded when your Hero levels up. Does anyone have a solution to this?
 
Level 8
Joined
Jan 28, 2016
Messages
486
I went through the thread and checked out the test maps; that pretty much solves that. Would still require a fair amount of effort to get this whole system done though.
 
Status
Not open for further replies.
Top