• 🏆 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!

Need help for hero picking system

Status
Not open for further replies.
Level 6
Joined
Jun 19, 2010
Messages
143
I am not sure about is about hero picking functions (system if you already made that). Let says, in GUI, a trigger dealing with event peon (hero picker) enter circle of power to select a hero checks for its conditions before executing the actions.

I have 30 heros, there is a pain and memory consumption when dealing with 30 triggers in the old day of GUI, not to mention another 30 triggers for displaying hero skills to players for their chose.

Let's say I use global variables for all 30 types of heroes, all 30 types of skill tooltips.
Theoretically, Can I benefit from Jass by making firstly 1 function trig_Hero_Selection_Conditions to check the conditions (since they all check for the same conditions), then 30 or less functions trig_Hero_Selection_Actions.
Not sure condition function should be placed above the action function OR the other way around?

//========
then 1 exec functions to call function condition and those 30 functions action.
local trigger t=createtrigger()
call TriggerAddAction(...)
call TriggerAddCondition(...) (the same question about placing them)
return //pick a hero for player by variable[array] defined

Is that all possible to work out? less functions as compared to huge amounts of triggers I used in GUI. I noticed there are many ways to do hero selection but my old system stayed for years up to now I really decide to change it.


Recently I come up with new idea about picking heroes. Neutral hero(level 20 as e.g. of high level) becomes your hero (gettriggerplayer, change owner to trigger player) to let you see all skill details, clickable item or ability to select that hero (since I made hero with 6 skills, I would use item because there is no room for "pick hero" ability),
+ a function set movement speed of all neutral hero to 0 in the hero selection region or pathing blockers to block ally becoming hero from moving.
+ If selection region is where I'd like my hero selected to be in, then maybe a function to remove other neutral heroes, but problem of repick a hero is hard to solve.
either of the two above always requires 1 more function. Your hero returns to neutral when player select another hero. Else, A chosen one is then moved to your place as it's your hero.

I have played some maps with double-click hero selection and find myself hard to click a hero in order to choose one for me.
Tavern does not provide an interactive way of viewing the hero, hero stats, skills. Still but utmost important, I have to correct hero extended tooltip/text. This is painful. Peon could use a dummy skill to pick a hero but that option is not in my favor, many players are just dumb, they donno how to pick a hero!

Hope to see your advices, and if there is a hero picking library/system,...
Thank you very much.
 
Last edited:
Level 17
Joined
Jul 17, 2011
Messages
1,864

if you have no idea hot to make hero selection

you also seem to worry that there would be too much used memory if you do all 30 heroes well the truth is that there is no way around it, you need some way of indexing all of them This requires some work if you want to make it look nice :)
 
Level 4
Joined
Aug 5, 2011
Messages
99
or u can do something like
unit is attacked/unit begins casting an ability
unit type of attacking unit = hero selector/ability being cast = select hero
create (unit of type attacked unit/target unit of abilty) for owner of (attacking unit/casting unit) at (spawn place)

then thers no need to index anything
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
· Create a Region array variable, and Unit Array variable.
· On map Init you loop from 1 to 30 creating Circle of Powers in a circular area
· On map init you loop from 1 to 30 creating the regions and setting (last created región) to Region[Integer A]
· On map init you loop from 1 to 30 creating the corresponding heroes to those regions/circles just increasing the offset a bit and setting the heroes manually to Unit[1], etc., and creating them with Unit[Integer A]
· ON map init you loop from 1 to 30 creating the event "A unit enters Region[Integer A]"


That way, Regions, Circle of Powers, Trigger Events and the Hero Model in the circle are made automatically during game, not manually.

Now, when the event is fired (The unit enters any of the 30 regions) You loop through conditions from 1 to 30 and check if Region [Integer A] has the triggering unit. If it's true, then you give the player the Unit[Integer A] since the Region and Unit arrays are the same (If loop is going through Region[21] it will give Unit[21]). You could improve this by stopping the loop if the system found you're in the first region, not having to check as false the other 29, but I don't know how to.

After this, you can create the unit in a small region with max level and a dummy inmortal unit so the player can test the unit abilities (refreshing the cooldown after every cast) and see how it will be when its skills and stats are maxed. If player doesn't like it, do -repick. If he likes it, he leaves that region and there you create the lvl 1 hero where it's supossed to be for gameplay, and disable -repick for that player.

If you want to save some memory/space, when all players already left the max-lvl area, you can delete/destroy from 1 to 30 Region[Integer A] and pick every unit in the selection area (Includes hero models and circle of powers). I think you can also destroy the selection, repick, and Map Init trigger, since all of them will be unneccesary.


In my opinion, I would just skip all the Circle/Region/Unit/Trigger Event creating, and just create a tavern with good tooltips. Leaving only the maxed hero at the beginning for the player to test and repick if doesn't like. It's a lot easier and most players are familiar with that.
 
Level 6
Joined
Jun 19, 2010
Messages
143
· Create a Region array variable, and Unit Array variable.
· On map Init you loop from 1 to 30 creating Circle of Powers in a circular area
· On map init you loop from 1 to 30 creating the regions and setting (last created región) to Region[Integer A]
· On map init you loop from 1 to 30 creating the corresponding heroes to those regions/circles just increasing the offset a bit and setting the heroes manually to Unit[1], etc., and creating them with Unit[Integer A]
· ON map init you loop from 1 to 30 creating the event "A unit enters Region[Integer A]"
My map was exactly as you said for 3-4years, about 30 regions for neutral heroes, 30 others for hero skill tooltips as to display to the players as D-day map.
That old system is too heavy. I am lazy to fix all buying tooltips for a tavern option. How's about my new idea mentionned previously that I am about to come up with?

Recently I come up with new idea about picking heroes. Neutral hero(level 20 as e.g. of high level) becomes your hero (gettriggerplayer, change owner to trigger player) to let you see all skill details, clickable item or ability to select that hero (since I made hero with 6 skills, I would use item because there is no room for "pick hero" ability),
+ a function set movement speed of all neutral hero to 0 in the hero selection region or pathing blockers to block ally becoming hero from moving.
+ If selection region is where I'd like my hero selected to be in, then maybe a function to remove other neutral heroes, but problem of repick a hero is hard to solve.
either of the two above always requires 1 more function. Your hero returns to neutral when player select another hero. Else, A chosen one is then moved to your place as it's your hero.

I have played some maps with double-click hero selection and find myself hard to click a hero in order to choose one for me.
Tavern does not provide an interactive way of viewing the hero, hero stats, skills. Still but utmost important, I have to correct hero extended tooltip/text. This is painful. Peon could use a dummy skill to pick a hero but that option is not in my favor, many players are just dumb, they donno how to pick a hero!
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
My map was exactly as you said for 3-4years, about 30 regions for neutral heroes, 30 others for hero skill tooltips as to display to the players as D-day map.
That old system is too heavy. I am lazy to fix all buying tooltips for a tavern option. How's about my new idea mentionned previously that I am about to come up with?

Makes me think you do all that manually. I'm saying you can make it all in one trigger that builds it In-game, and it won't increase the map size.

I still think tavern + hero test area + repick is more than enough for most players and it's fairly easy to achieve. You can just copy/paste the skill description (which must have) onto hero selection tooltip, whithout any background.
 
Level 2
Joined
Jan 26, 2012
Messages
5
Please help me in this HERO SELECTION SYSTEM i have a BUG
.
.
.
THIS BUG
HERE.jpg


from ↓

http://www.hiveworkshop.com/forums/triggers-scripts-269/hero-selection-214019/#post2124962
 
Status
Not open for further replies.
Top