HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

HeroChooseSystem HCS

07-21-2008, 01:49 AM#1
Blubb-Tec
HCS - HeroChooseSystem

I decided to post this since I wanted to remake the (GUI) herochoose I was using before. Then again, I thought "if you're going to make one anyway, why not release it?"

So, what does this system offer, what makes it "special"?

1. It features a variable number of teams
That's right. You can have 1-12 teams, for 12 players, or even 16 teams if you want to include all the neutral players, although noone will probably ever want to do that.
Hidden information:
The testmap contains only 4 teams(I didn't have more ppl to test it with, and I don't know how I order a unit to buy a unit from another unit >.> If anyone tells me that, I'll test the maximum of 16 teams.)


2. It "looks" good
Ever played AotZ or DoE? Well, then you basically know how this system looks like: It will give every choosable hero an ability that the user can activate in order to choose that hero.
Also you can define a custom camera-setting for each team, the camera will get locked to that setting aslong as the system is running.

4. It's easy to use
It's not hard to use at all, still it will provide you with a very flexible way of handling choosed heroes, and starting and ending the herochoose.

5. Includes randomness
It will take care of choosing a random hero if a player wants one, you'll only have to tell the system which unit(type) it is that will give a random hero.
Also the system will give random heroes to players who weren't fast enough to choose one - unless you disable this, of course.

6. It's customizable
You can choose if you want to enable or disable multiple picking of the same hero, if you want the heroes only to be hidden instead of removed(for remakes), you can specify the error-msg given to players that can't pick a certain hero, and you can specify the effect that will be used when a hero is picked.

7. It is remake-friendly
You can run it as often as you want. Aslong as wc3 doesn't crash, no buts.

8. Its user friendly
It saves the alliance settings you've done with the DummyPlayer and restores
them when the system is finished, no need to worry there. Also it makes it
impossible for players to choose heroes they shall not choose.

The attached example-map, which also includes the system, shows that this system is really easy to use. I'll also post the example-script into this thread, so people can look through it without having to dl/open the map.


First, the documentation:
Expand JASS:


Then the actual system:
Expand JASS:


and the example from the attached map:
Expand JASS:


Changelog:
Code:
v1.2f: got rid of the UnitUserData requirement, now working fully withhashtables(requires 1.24(1.23b+) now. turned the changelog upside down, so that is shows recent changes first(>.>)
v1.2e: fixed another bug with repicking, and updated the test-map to a working one
v1.2d: fixed another bug concerning randomness, and one concerning remakes and repicking
v1.2c: fixed the 1.2b testmap which wasn't working, and fixed the camera-lock.
v1.2b: fixed some bugs with the random function, which e.g. led to people sometimes not getting a hero at the end of the timer when there was no random picker
v1.2: big changes in usage, syntax for almost all functions changed. Best to look into the Documentation to see the changes.
Now includes it's own timer and timerwindow, and automatically creates the hero for the player, also takes care of applying the camera and selecting the hero.
v1.1: added a periodic-reset camera, removed the onlyHideHeroesAtEnd boolean, 
players will have to remove the chooseable heroes themselves.
Also added a function HCS_RepickHero which allows addition of a
-repick mode.
v1.1b: fixed a bug that prevented the alliance-restoring from working in most cases
fixed a bug that disabled the multiPick option
fixed a bug that was able to make heroes unchooseable when players used one of their abilities
v1.0: first release

Thanks for reading, I'm always happy about comments, don't hold back your breath on anything!
Attached Images
File type: jpgHCSIcon.jpg (543.3 KB)
Attached Files
File type: w3xHCSv1.2f.w3x (40.8 KB)
07-21-2008, 02:54 AM#2
chobibo
Is this a Hero Selection System?
07-21-2008, 06:54 AM#3
darkwulfv
Quote:
Is this a Hero Selection System?
Did you uh... read the title? Or the thread?


On-topic: This looks snazzy, although there's been 1001 of these before. Guess we'll see what the mods think.
07-21-2008, 01:34 PM#4
chobibo
Sorry, I was just wondering if what I was thinking was right, my fault, I was in a rush when I posted that.

The System looks good, supports randomizing and re picking heroes, makes life easier for those who make AoS maps.
07-21-2008, 02:11 PM#5
Blubb-Tec
oh well, re picking is not supported. just multiple picking of the same hero.
Also maybe today or tomorrow, I'll release v1.1 with a periodic-set camera, from what I heard the only possibility to "keep" the camera locked.
For the re-picking, I'd have to think of a way to put a single player back into his original force. well, since that seems to be a desirable feature, I'll include that as well.
07-21-2008, 05:53 PM#6
chobibo
I got confused about the remake lol, I thought it was a repick. Anyways, Good Luck. Oh and adding repick would be good really great.
07-22-2008, 06:54 PM#7
Blubb-Tec
Version 1.1 released; Changelog in first post, it now includes:
-A REALLY locked camera, players can't trick it anymore.
-the function HCS_RepickHero, it allows for a player to repick his hero.
-A Screenshot/icon for the system(nothing great though :/)

Just a question, is the documentation of system/config/example understandable, or is it too crappy?

Edit: also, if anyone sees memory leaks in the (uncommented) script, please tell me.
08-02-2008, 11:56 PM#8
Malf
In the testmap, when you random a hero using the Tinker, the hero you get isn't selected so you will still have the Tinker as your selected hero.
08-03-2008, 12:54 PM#9
Blubb-Tec
Quote:
Originally Posted by Malf
In the testmap, when you random a hero using the Tinker, the hero you get isn't selected so you will still have the Tinker as your selected hero.

mhhh I don't really understand your problem. I just tested it again with the 1.1 testmap from this thread, and chose the tinker as player 1, got a random hero, did a -repick, picked the tinker again, got another random hero.
Maybe you can tell me which player-slot you used?
08-03-2008, 04:18 PM#10
Rising_Dusk
What's the deal with all of the force copying functions? Those seem... I don't know, unnecessary? I'm sure you could do all of the same things without the extra function calls sapping (However little) speed from the system.

Additionally, I had a few minor concerns. When a hero is selected by a team member, it should automatically hide the unselected heroes assuming everyone from the team has selected. Also, I was unable to test, but it hides/cleans up the timer as soon as all players from all teams select as well I hope. Additionally, it should select the hero (Like, for the player, unit selection) upon selection.

I like it though, it's cute.
08-03-2008, 11:47 PM#11
Blubb-Tec
ahh, finally some more feedback :D Well then, let me answer all those things..

Quote:
Originally Posted by Rising_Dusk
What's the deal with all of the force copying functions? Those seem... I don't know, unnecessary? I'm sure you could do all of the same things without the extra function calls sapping (However little) speed from the system.
Ah yes, I thought about that multiple times too, but then I like short calls in my init functions, like set iX = intParam or call CopyGroup(g, g2). And since I needed the copy-functions inside my init-functions, I chose to not inline the copy-functions


Quote:
Originally Posted by Rising_Dusk
Additionally, I had a few minor concerns. When a hero is selected by a team member, it should automatically hide the unselected heroes assuming everyone from the team has selected.
That is a good idea, but I'm not sure if that will be favorable for maps that make use of the repick-function? I would then have to unhide the heroes again etc. I could implement a boolean for hiding heroes when all players from a team have chosen a hero though. But I'm not sure if it would really be worth the effort...


Quote:
Originally Posted by Rising_Dusk
Also, I was unable to test, but it hides/cleans up the timer as soon as all players from all teams select as well I hope.
The herochoose-timer with its timer-dialog is only part of the testmap, the system itself only has a timer for periodically resetting the camera. That one is only paused when the herochoose ends, simply because I wasn't sure if destroying/recreating it for every remake would be better or worse.
And since the testmap includes a repick-mode, I think it is best not to hide/destroy the herochoose-timer before the time is up.


Quote:
Originally Posted by Rising_Dusk
Additionally, it should select the hero (Like, for the player, unit selection) upon selection.
Again, that is only a matter of the testmap, since the system itself only tells the map's script which unittype was picked, so the user has full control over the creation of the chosen hero.
I'll add that though when(if?) I release another version, since I basically only forgot it in the example-map ^_^


Quote:
Originally Posted by Rising_Dusk
I like it though, it's cute.
thanks
08-05-2008, 12:00 PM#12
Blubb-Tec
v1.1b released, fixed some bugs.
08-09-2008, 05:51 PM#13
Rising_Dusk
Quote:
Originally Posted by Blubb-Tec
Ah yes, I thought about that multiple times too, but then I like short calls in my init functions, like set iX = intParam or call CopyGroup(g, g2). And since I needed the copy-functions inside my init-functions, I chose to not inline the copy-functions
I'm still 100% certain that this system is doable without all of those unnecessary extra functions. I mean, the main reason I say that is because in all of the hero selections I've made I have never needed to copy a group or a force, it seems like unnecessary steps. Also, the BJ GroupPickRandomUnit() doesn't leak or anything, just has a few weird conditionals. If you just apply it's internals directly it wouldn't be a problem.

Also, I'm confused. Why do you have so much stuff in the test map if it isn't a part of the system? That's misleading to people like me that test it to see all of what your system does. Also, selecting the hero for the player and monitoring timers -- To me -- Is a key part of the hero selection system. So if it isn't in your system now, I highly recommend you incorporate it.
08-10-2008, 11:26 AM#14
Blubb-Tec
Quote:
Originally Posted by Rising_Dusk
I'm still 100% certain that this system is doable without all of those unnecessary extra functions. I mean, the main reason I say that is because in all of the hero selections I've made I have never needed to copy a group or a force, it seems like unnecessary steps. Also, the BJ GroupPickRandomUnit() doesn't leak or anything, just has a few weird conditionals. If you just apply it's internals directly it wouldn't be a problem.
Well I guess I can change to code to work without those copy-functions, so I'll just go and do that. I just don't quite get what you said about applying GroupPickRandomUnit()'s internals directly, because my GroupGetRandomUnit() function looks very similar to that one, it just uses another method.

Quote:
Originally Posted by Rising_Dusk
Also, I'm confused. Why do you have so much stuff in the test map if it isn't a part of the system? That's misleading to people like me that test it to see all of what your system does. Also, selecting the hero for the player and monitoring timers -- To me -- Is a key part of the hero selection system. So if it isn't in your system now, I highly recommend you incorporate it.
Originally I wanted to grant the user full control over the hero creation and start/end of the selection, since some users might be using something else than a timer to determine the end of their herochoose system.
But creating the hero, selecting it etc shouldn't be a problem for the system, would only require an x and y param for every team, and I'll just go and build that timer into the system, since probably 99% of all mappers use timers to end their herochoose anyway.

So I'll put all those changes into the next version, shouldn't be too much so I figure I'll be able to release it later today.

Edit: v1.2 released, changelog in first post.
Edit2: hotfixed v1.2, repicking was not disabled by default. The file only had 1 view, so I didn't release v1.2a or so..
09-03-2008, 05:09 PM#15
Blubb-Tec
version 1.2b out, fixed a few bugs with the random-function