View Single Post
Old 04-19-2008, 05:40 PM   #1
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default Hero Selection System 1.30

Hero Selection System 1.30



A dynamic, completely customizable Hero Selection System!

Had originally been using Vex's system for a map I have been playing around with, and finally got fed up with players not being able to view the same hero simultaneously. So, with a little inspiration and minor coding help from Vexs system, and after some discussion with Fulla, this system was born.

Credits to Vexorian for his original system and the GetPlayerNameColored function, and to Fulla for our hero selection discussions. Credits also to Acehart for the original demo map he made, of which its terrain I used as a template for this map.


Read Me - Basic:
Hidden information:
Hero Selection System 1.30 - By: emjlr3

The basic steps to setup the system in your map
*Copy the Select Hero and Random Hero units to your map
*Copy the HSS and GetPlayerNameColored(if not already there) triggers to your map
*Configure he options you can(everything but Choose/RandomHeroOrder)
*Save, if that works, then everything is good, if not, start over and try again from the beginning

*Type -HSSGetOrders while in single player to determine the order ids for selling your selection units
This will create a hero at Player 1s start location. You can select choose hero or random hero on this hero, and it will display the correct order id for that selection. Write these two order ids down, and move to the next step
*Configure the order id options in HSS (ChooseHeroOrder and RandomHeroOrder)
*Add heroes to your map, owned by neutral passive, set their level and abilities learned to whatever you want, add a rect around your hero gallery
*Copy HSSSetup to yor map
*Look through HSSSetup, this is the trigger that will start and setup the system for you. You can have this run after X seconds, as I do, You can execute the trigger later, among many other things. Read through this and configure it to match your maps needs
*Save, if that works, yo are good to go, if not, look through HSSSetup again and see where your syntax went wrong


Read Me - Advanced
Hidden information:
Hero Selection System 1.30 - By: emjlr3

The more advanced configuration required for the system to function, or to be further customized
*All system used global arrays are stored as the id of the player they are for, ex. HSS_HeroSelection = GetPlayerId(unit)
*As seen in HSSSetup in this map, you must store the Hero Selection Gallery Rect and Hero Creation Loc for every player in your map, else the system does not know where they are
HSS_HeroSelection in a rect array used for the hero gallery
HSS_HeroCreation is a location array use for the creation of heroes
*The global trigger HSS_CreatedHeroTrigger will run once a hero is created, if set as a trigger. The created hero can be retrieved as "bj_lastCreatedUnit"
*The global unit array HSS_Heroes refers to heroes selected using the system
*The global group HSS_SelectableHeroes contains to all those heroes initialy selectable using the system
*Since players are given control of Player 15s units, the bong sound is played(unavoidable), and a message is displayed(also unavoidable)
However, in the gameplay constants you can edit this displayed message, as seen in this map
*Selecting the random hero flag before the map is loaded creates random heroes for all players
*You can edit the fields in HSSSetup to load the system when you want, or even completely scratch that trigger and do it yourself some place else, though this is not recommended


Systems Code:
Expand JASS:

Setup Code:
Expand JASS:

Version History:
  • 1.30 - Several new config. options
    Added a function to GetPlayerNameColored Library, to allow for colored hero names
    Minor coding updates/optimizations
    Errors messages now display in red
    Now reports an error if your max computer hero selection time is greater then your total selection time
    Improved the way hero selection messages were displayed
    Minor test map updates
  • 1.20 - Setup and readme completely redone
    HSS is now a library that contains the GetSelectionOrders system
    HSSSetup now sets up the systems variables and starts the HSS
    A few minor coding enhancements per Vexorians advice
    New option for max computer hero selection time
  • 1.10 - Users no longer need to manually input the number of players
    Added error messages in case the map runs out of heroes
    Slight updates/additions to readme
    Slight code updates and optimizations
    A few minor bug fixes(nothing related to system functionality)
  • 1.00 - Initial Release

Please report any and all bugs, and please leave comments and thoughts. Thanks and enjoy!!
Attached Images
File Type: jpg HSS.jpg (296.7 KB, 425 views)
Attached Files
File Type: w3x Hero Selection System 1.30 - emjlr3.w3x (76.5 KB, 410 views)
__________________
emjlr3 is offline   Reply With Quote
Sponsored Links - Login to hide this ad!