wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Samples
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-30-2005, 10:31 AM   #1
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,905

Submissions (37)

Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)

Hero Contest #3 - 2nd Place

Default Selection System 7.0

NOTE: You have been redirected in order for our attachments to be made available to you. This will only last two minutes; these measures where taken to avoid hotlinking and bandwidth theft.
To avoid these restrictions Log in or Register

This is the selection system I made some time a long , updated little time ago.
Version Info:
 Version 7.0
     - Fixed some leaks caused by blizzard functions
     - Fixed some triggeraction leaks
     - Fixed a bug with cleanup not working
     - Has an option for a time limit for choosing a hero.
     - Implementing and Configuring was changed a little, still a setup trigger is needed to set
       the teams / Hero Created trigger and that stuff.
     - It is now possible to easily edit the strings used by the Selection System.

patch


Collapse JASS:
//******************************************************************************************************
//*
//*                        Vexorian Hero Selection System VII functions
//*                        ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//*     To Implement The Selection System functions to your map, you first need some stuff
//*  to be already implemented in your map:
//*
//*     - The SimError function (see above)
//*     - The GetPlayerNameColored function (see above)
//*     - Some Global Variables (see below)
//*
//*    Then copy this trigger and change the rawcodes to the right ones in your map.
//*
//* Note: You can edit the messages used by the Selection system, they are extracted from the
//* Art - Special field of the Choose Hero Ability. Feel free to translate them to your language
//* Or to modiffy them to fit the style of your map.
//*
//******************************************************************************************************

//======================================================================================================
// Input constants
//
constant function hss_ChooseHeroSpellId takes nothing returns integer
    return 'A000' //Rawcode of the Choose Hero Spell in your map
endfunction

constant function hss_RandomHeroSpellId takes nothing returns integer
    return 'A002' //Rawcode of the Random Hero Spell in your map
                  //Use 0 to disable the random hero feature
endfunction

constant function hss_SelectionArrowSpellId takes nothing returns integer
    return 'A001' //Rawcode of the Selection Arrow ability.
endfunction

constant function hss_ComputerHeroes takes nothing returns boolean
    return true //if you want computer heroes use true, otherwise use false
endfunction

constant function hss_DoCleanup takes nothing returns boolean
    return true //if it is true, the hero gallery will be removed once everybody got its hero.
endfunction

constant function hss_DoubleHeroesEnabled takes nothing returns boolean
    return false //If it is true, a player can choose heroes that were already chosen, when it is false
                 //he is not able to do that, and chosen heroes become 'ghosts'
endfunction

constant function hss_TimeLimit takes nothing returns integer
    return 10 //Time limit for hero selection, use 0 here to disable the time limit.
endfunction

constant function hss_KillInactive takes nothing returns boolean
    return false //if it is true, When the time limit ends, players get defeated instead of a random hero
endfunction


//******************************************************************************************************
//*
//*      Theorically you won't need to change these functions unless you know JASS and want
//*  to improve the Selection System to fit better on your map.
//*
//* ..........................
//* : Input Global Variables : (Used by the mapper to configure the Selection system)
//* ``````````````````````````
//*  group           udg_hss_SelectableHeroes     Heroes used by the selection system
//*
//*  group           udg_hss_AvailableHeroes      Heroes use by Random Hero functions
//*
//*  rect     array  udg_hss_HeroSection          Determines a Player's Hero Gallery (1 to 12)
//*
//*  rect     array  udg_hss_HeroCreation         Determines a Player's Hero Spawn Rect (1 to 12)
//*
//*  trigger         udg_hss_CreatedHeroTrigger   Determines the trigger to be executed after hero creation
//*
//* ...........................
//* : Output Global Variables : (Used to store the results of the Selection system)
//* ```````````````````````````
//*  unit     array  udg_hss_Heroes               Stores a player's hero after its creation (1 to 12)
//*                                           13 to 24 temporary store the current selected hero
//*
//******************************************************************************************************

//======================================================================================================
//  Filter functions:
//
function hssFilterIsPossible takes nothing returns boolean
    return IsUnitInGroup(GetFilterUnit(), udg_hss_SelectableHeroes) and RectContainsUnit( udg_hss_HeroSection[GetConvertedPlayerId(bj_groupEnumOwningPlayer)], GetFilterUnit() )
endfunction

function hssFilterIsAvailable takes nothing returns boolean
    if GetTriggerUnit() == null and FirstOfGroup(udg_hss_AvailableHeroes) == null then
         //* In Case a Weird thing happened and there were not heroes available for computers
         return hssFilterIsPossible()
    endif
 return IsUnitInGroup(GetFilterUnit(), udg_hss_AvailableHeroes) and RectContainsUnit( udg_hss_HeroSection[GetConvertedPlayerId(bj_groupEnumOwningPlayer)], GetFilterUnit() )
endfunction

function hssFilterIsComputerWithoutHero takes nothing returns boolean
    return (GetPlayerController(GetFilterPlayer()) == MAP_CONTROL_COMPUTER) and (udg_hss_Heroes[GetConvertedPlayerId(GetFilterPlayer())] == null) // and udg_hss_Heroes[GetPlayerId(GetFilterPlayer()) + 13] == null
endfunction
//======================================================================================================
function hss_Message takes integer i returns string
    return GetAbilityEffectById(hss_ChooseHeroSpellId(),EFFECT_TYPE_SPECIAL,i)
endfunction


//===========================================================================================
function SetPlayerHero takes player id, unit hero, string suffix returns nothing
//
// Determines a player's hero
//  - id player argument is self explanatory (Create the hero for that player)
//  - hero unit argument is self explanatory too (The hero that was in the gallery)
//  - suffix string argument is added to the "(Player) has selected the (Hero)" message
//
// Will Run the trigger udg_hss_CreatedHeroTrigger after creating the hero
// (Use last created unit to reffer to the hero)
//
 local integer P=GetPlayerId(id)+1
 local real x=GetRectCenterX(udg_hss_HeroCreation[P])
 local real y=GetRectCenterY(udg_hss_HeroCreation[P])

    if (id == null) or (P > 12) or (hero == null) then
        return //* Invalid Request, halt the function
    endif

    call GroupRemoveUnit( udg_hss_AvailableHeroes, hero ) //*Makes Hero Unselectable by Random Hero button / Computers
    if not hss_DoubleHeroesEnabled() then
        //*In case DoubleHeroesEnabled is false, make hero unselectable
        call SetUnitColor( hero, GetPlayerColor(id) )
        call UnitAddAbility(hero,'Aloc')
        call SetUnitVertexColor( hero, 255, 255, 255, 127 )
    endif

    //* Create the new hero, select it and move the camera
    set udg_hss_Heroes[P]=CreateUnit(id, GetUnitTypeId(hero),x,y, bj_UNIT_FACING )
    call SelectUnitAddForPlayer( udg_hss_Heroes[P], id )
    call SetCameraPositionForPlayer(id, x, y)
    call DisplayTextToForce( GetPlayersAll(), GetPlayerNameColored(id)+hss_Message(1)+GetUnitName(hero)+" "+suffix)

    //* In case there is a CreateHeroTrigger, Execute it and make sure Last Created Unit works
    if udg_hss_CreatedHeroTrigger != null then
        set bj_lastCreatedUnit=udg_hss_Heroes[P]
        call ConditionalTriggerExecute( udg_hss_CreatedHeroTrigger )
    endif
endfunction


//============================================================================================================
function hss_GetRandomHero takes player a, boolean forced returns unit
// Chooses a random hero, depending on the conditions, if forced is true it will even choose heroes that
// were already selected, if there are no available heroes left
//
 local group heroes=CreateGroup()
 local unit current
 local boolexpr B=Condition(function hssFilterIsAvailable)
    set bj_groupEnumOwningPlayer=a //* I use that Blizzard variable to make sure the filter chooses only the heroes a player can have

    call GroupEnumUnitsOfPlayer(heroes,Player(PLAYER_NEUTRAL_PASSIVE),B)
    set current = GroupPickRandomUnit(heroes)
    if (current == null) and forced then //* No more available heroes, use a repeated hero
        set bj_groupEnumOwningPlayer=a
        call DestroyBoolExpr(B)
        set B=Condition(function hssFilterIsPossible)
        call GroupEnumUnitsOfPlayer(heroes,Player(15),B)
        set current = GroupPickRandomUnit(heroes)
    endif
    call DestroyGroup(heroes)
    call DestroyBoolExpr(B)
 set udg_hss_Heroes[100]=current //Temp use of Heroes[100] to fix the leak of the return value
 set current=null
 set B=null
 set heroes=null
 return udg_hss_Heroes[100]
endfunction

//===========================================================================================
function hss_OrderToPreviewHero takes nothing returns nothing
// 
//   When A hero from the gallery is issued an order, check if it was the choose hero or the
// Random Hero Button, after that block the order by pausing the unit and ordering it to stop
//
 local unit selunit=GetTriggerUnit()
 local player selplayer=GetOwningPlayer(selunit)

    if GetIssuedOrderId() == OrderId("stop") or GetUnitUserData( selunit) == 1 or (udg_hss_Heroes[13+GetPlayerId(selplayer)] != selunit) or (udg_hss_Heroes[1+GetPlayerId(selplayer)] != null) then
        //* A lot of conditions added because this trigger was causing massive lag
        //* Also prevent it from selecting a hero if the player already has a hero (fix 0:00:0 time exploit) *//
        set selunit=null
        set selplayer=null
        return
    endif
    call SetUnitUserData(selunit,1) //* Part of the things that help this trigger to be lag-free, this trigger won't run when the unit has a Custom Value of 1

    if GetIssuedOrderId() == 852273 then //*Select Hero Clicked
        call SetUnitOwner( selunit, Player(PLAYER_NEUTRAL_PASSIVE), true )
        call UnitRemoveAbility( selunit,hss_SelectionArrowSpellId()) //* Remove the Selection Arrow Special Effect
        call SetPlayerHero(selplayer, selunit, "")

    elseif GetIssuedOrderId() == 852277 then //*Random Hero Clicked

        set udg_hss_Heroes[100]=hss_GetRandomHero(selplayer,false)
        if (udg_hss_Heroes[100] == null) then
            //* There is a chance that the map had an incredibly low number of heroes and that eventually there
            //  weren't heroes available, in that case show an error message instead of continuing with the selection
            call SimError(GetOwningPlayer(selunit), hss_Message(2))
        else
            call SetUnitOwner(selunit, Player(PLAYER_NEUTRAL_PASSIVE), true )
            call UnitRemoveAbility(selunit, hss_SelectionArrowSpellId()) //* Remove the Selection Arrow Special Effect
            call SetPlayerHero(selplayer, udg_hss_Heroes[100], hss_Message(3)) //* Calls the SetPlayerHero function with a "(Random Hero)" suffix for the message
        endif
    else
        call SimError(GetOwningPlayer(selunit), hss_Message(4)) //* The Player was trying to use an ability, show an error to him/her/ it?
    endif
    //* Pause the unit, order it to stop and unpause the unit, so it ignores the issued order
    set selunit=GetTriggerUnit()
    call PauseUnit( selunit, true)
    call IssueImmediateOrder( selunit, "stop" )
    call PauseUnit(selunit, false)
    call SetUnitUserData( selunit, 0 )
 set selunit=null
 set selplayer=null
endfunction

//===========================================================================================
function hss_HeroIsClicked takes nothing returns nothing
// 
//    This function is executed when a Player Clicks an unit, if the unit belongs to his gallery,
// Give the unit to the player, and show the Selection Arrow, if it doesn't, restore the previus
// selected unit.
//
 local unit sel=GetTriggerUnit()
 local player sp=GetTriggerPlayer()
 local integer a
 local unit old=udg_hss_Heroes[13+GetPlayerId(sp)] //* Save the current hero that is selected by the player into a variable

    if old != sel then //* Just to make "clicking a hero a lot of times till it says something funny" possible
        call SetUnitOwner( old, Player(15), true ) //* give the last unit back to Neutral Passive
        call UnitRemoveAbility( old, hss_SelectionArrowSpellId()) //* Remove the Selection Arrow Special Effect
        set udg_hss_Heroes[13+GetPlayerId(sp)] = null //* Clear the Global Variable

        if udg_hss_Heroes[GetConvertedPlayerId(sp)] == null and IsUnitInGroup(sel,udg_hss_SelectableHeroes) and IsUnitOwnedByPlayer(sel,Player(15)) then

            //* The Hero is a member of the Possible Selectable Heroes
            if RectContainsUnit( udg_hss_HeroSection[GetConvertedPlayerId(sp)], sel ) then
                //* The Hero can be used by the player
                call SetUnitManaPercentBJ( sel, 100 )  //* Just in case the map author forgot to give the hero mana (So the hero abilities buttons don't show up blue)
                set udg_hss_Heroes[13+GetPlayerId(sp)] = sel //* Save the selected unit into a global
                call UnitAddAbility(sel, hss_SelectionArrowSpellId()) //* Show the Selection Arrow Special Effect
                call SetUnitUserData( sel,1) //* Just In case. (See the OrderToPreviewHero function for more information)
                call SetUnitOwner( sel, sp, true ) //* Give the selected unit to the player
                call SetUnitUserData( sel,0) //* Just In case. ^
            else
                //* The Hero doesn't belong to the player's team, show error message
                call SimError(sp, hss_Message(5))
            endif
        endif
    endif
 set sel=null
 set sp=null
 set old=null
endfunction

//===========================================================================================
function hss_HeroShareVision takes nothing returns nothing
//
// Executed for every Selectable Hero, makes sure a player can choose it and if that is true,
// makes the player share vision with the hero, so the player can click on the hero
//
    if RectContainsUnit( udg_hss_HeroSection[bj_forLoopAIndex+1], GetEnumUnit() ) then
       call UnitShareVision( GetEnumUnit(), Player(bj_forLoopAIndex), true)
    endif
endfunction

//===========================================================================================
function hss_MakePlayerChooseHero_child takes nothing returns nothing
 local player id=bj_groupEnumOwningPlayer
 local unit current = udg_hss_Heroes[GetPlayerId(id) + 13]
    call PolledWait(GetRandomReal(0.5,3))
    call SetUnitUserData( current, 0)
    if IsUnitOwnedByPlayer( current, id) then
        call IssueImmediateOrderById( current, 852273)
    endif
 set id=null
 set current=null
endfunction

function hss_MakePlayerChooseHero takes player id, unit hero returns boolean
//
// Makes a Player Choose a hero, but makes sure it looks as if the player choosed it
// calls hss_MakePlayerChooseHero_child in another thread, returns false if the hero
// wasn't selectable / the player already had a hero.
//
 local boolean res=false
    if (id==null) then
        return false
    endif
    if (udg_hss_Heroes[GetPlayerId(id) + 13] != null) and (udg_hss_Heroes[GetPlayerId(id) + 13] != hero) then
        call SetUnitOwner( udg_hss_Heroes[GetPlayerId(id) + 13], Player(15), true ) //* give the last unit back to Neutral Passive
        call UnitRemoveAbility( udg_hss_Heroes[GetPlayerId(id) + 13], hss_SelectionArrowSpellId()) //* Remove the Selection Arrow Special Effect
    endif
    if (udg_hss_Heroes[GetPlayerId(id)+1] == null) and IsUnitInGroup(hero,udg_hss_SelectableHeroes) and IsUnitOwnedByPlayer(hero,Player(15)) then
        set udg_hss_Heroes[GetPlayerId(id) + 13] = hero
        call UnitAddAbility( hero, hss_SelectionArrowSpellId())
        call SetUnitOwner( hero, id, true)
        set bj_groupEnumOwningPlayer=id
        call ExecuteFunc("hss_MakePlayerChooseHero_child") //Creates a new thread
        set res=true
    endif
 set hero=null
 set id=null
 return res
endfunction

function hss_AIChoose takes nothing returns nothing
 local integer a=0
 local force forcevar=CreateForce()
 local player ai
 local unit current
 local boolexpr B=Condition(function hssFilterIsComputerWithoutHero)
    loop
        call TriggerSleepAction( GetRandomReal(0.05, 2) ) //* To make things realistic
        call ForceClear(forcevar)
        call ForceEnumPlayers(forcevar,B) //* Enum Computer Players that don't have heroes into a force
        set ai = ForcePickRandomPlayer(forcevar)
        //* Once ai==null the force is empty => there are no more computer players that need a hero
        exitwhen (ai==null) or (a>40) //* About the a>40 : There is a chance that it would happen (Low number of available heroes)
        set current=hss_GetRandomHero(ai,(a>30)) //* a>30 because it could be that a player was about to select somebody
        if (current!=null) then
            call hss_MakePlayerChooseHero(ai, current)
        endif
        set a=a+1
    endloop
    call DestroyForce(forcevar)
    call DestroyBoolExpr(B)
 set B=null
 set current=null
 set forcevar=null
 set ai=null
endfunction

function StartVxHSS takes boolean rand, boolean comps, boolean cleanup returns nothing
//
// (The Main Function that Starts the Selection System and Finishes it)
//
// - rand    boolean argument determines the availability of the random hero option.
// - comps   boolean argument determines if Computer Players can Choose their Heroes
// - cleanup boolean argument determines if the gallery heroes are removed once everybody gets a hero.
//
 local group heroes=CreateGroup()
 local unit current
 local integer a=0
 local real x //* To easily save a coordinate I use x and y
 local real y
 local trigger UnitSel=CreateTrigger()
 local trigger UnitOrder=CreateTrigger()
 local force forcevar
 local player ai
 local timer t=null
 local timerdialog td=null
 local triggeraction uoac=TriggerAddAction(UnitOrder, function hss_OrderToPreviewHero)
 local triggeraction usac=TriggerAddAction(UnitSel, function hss_HeroIsClicked)

    set bj_wantDestroyGroup=false
    call GroupAddGroup(udg_hss_SelectableHeroes,heroes)
    loop
        set current = FirstOfGroup(heroes)
        exitwhen (current == null) //* Clearly better than a ForGroup call
        //* Hero Setup for the Selection System:
        call GroupRemoveUnit(heroes, current)
        call UnitRemoveAbility(current, 'Amov' ) //* Removes movement
        call UnitAddAbility(current, 'Abun' )    //* Abun is Cargo Hold (Orc burrow)
                                                 //* It will remove the attack button
                                                 //* But the damage stats still show
        call UnitAddAbility(current, hss_ChooseHeroSpellId() ) //* Adds Choose Hero Button
        if rand then
            call UnitAddAbility(current, hss_RandomHeroSpellId() ) //* Adds Random Hero Button
        endif
        //* Register Order events for the hero
        call TriggerRegisterUnitEvent( UnitOrder, current, EVENT_UNIT_ISSUED_TARGET_ORDER )
        call TriggerRegisterUnitEvent( UnitOrder, current, EVENT_UNIT_ISSUED_POINT_ORDER )
        call TriggerRegisterUnitEvent( UnitOrder, current, EVENT_UNIT_ISSUED_ORDER )
    endloop
    call DestroyGroup(heroes)
    loop
        exitwhen a>11
        set x=GetRectCenterX(udg_hss_HeroSection[a+1])
        set y=GetRectCenterY(udg_hss_HeroSection[a+1])
        //* Move camera and spacebar point for the player
        if GetLocalPlayer() == Player(a) then
            call SetCameraPosition(x,y)
            call SetCameraQuickPosition(x,y)
        endif
        set bj_forLoopAIndex=a
        call ForGroup( udg_hss_SelectableHeroes, function hss_HeroShareVision)
        call TriggerRegisterPlayerSelectionEventBJ( UnitSel, Player(a), true ) //* Register a selection event for the player
        set a=a+1
    endloop
    //* Setup Completed
    call TriggerSleepAction(0)
    if (hss_TimeLimit()>0) then
        set t=CreateTimer()
        call TimerStart(t,hss_TimeLimit(),false,null)
        set td=CreateTimerDialogBJ(t,hss_Message(0))
        call TimerDialogDisplay(td,true)
    endif
    if rand and IsMapFlagSet(MAP_RANDOM_HERO) then
        //* Random Hero feature is enabled and the Game Created Checked the Random Hero Option
        //* So this will automatically choose a Random Hero for every player
        set a=0
        loop
            exitwhen a>11
            call TriggerSleepAction(0) //* Just to give war3 a breathing space
            if (GetPlayerSlotState(Player(a)) == PLAYER_SLOT_STATE_PLAYING) and (comps or GetPlayerController(Player(a)) != MAP_CONTROL_COMPUTER) then
                //* The Player is playing (uh?)
                //* Computer Players shouldn't automatically get a hero if comps is false
                call SetPlayerHero(Player(a), hss_GetRandomHero(Player(a),true), hss_Message(6)) //* Calls the SetPlayerHero function with an "(Automatic)" preffix
            endif
            set a=a+1
        endloop
    elseif comps then
        //* Automatically Choose random heroes for computer players when comps is true
        call ExecuteFunc("hss_AIChoose")
    endif

    //Periodic Check
    //* The Function will now loop till the time every player has a hero, so the gallery and the
    //  variables will be cleared
    set x=0 //* Now it gets funny, I am using the x real variable as a time counter
    loop
        set a=0
        set y=0 //* Even more funny the y real counts the players that didn't choose a hero yet
        loop
            exitwhen a>11
            if (udg_hss_Heroes[a+1] == null) and (GetPlayerSlotState(Player(a)) == PLAYER_SLOT_STATE_PLAYING) and (comps or (GetPlayerController(Player(a))!=MAP_CONTROL_COMPUTER)) then
                //* The Player Doesn't have a hero yet, ignore Computer Players in case comps is false
                if (t!=null) and (TimerGetRemaining(t)<=0) then
                    if hss_KillInactive() then
                        call CustomDefeatBJ(Player(a),hss_Message(8))
                    else
                        call SetPlayerHero(Player(a), hss_GetRandomHero(Player(a),true), hss_Message(7)) //* Calls the SetPlayerHero function with a "(Forced)" preffix
                    endif
                endif
                set y=y+1
            elseif (GetLocalPlayer()==Player(a)) then
                call TimerDialogDisplay(td,false)
            endif
            set a=a+1
        endloop
        exitwhen (y <= 0)
        call TriggerSleepAction(0)
    endloop

    //* Every player has already selected a hero, so start self destruction (So your map has a little more memory available)
    loop
        set current = FirstOfGroup(udg_hss_SelectableHeroes)
        exitwhen current == null or not cleanup //* So it won't remove the gallery when removegallery is false
        call GroupRemoveUnit(udg_hss_SelectableHeroes, current)
        call RemoveUnit( current)
    endloop
    //* Variable Cleanup :
    call DestroyTimer(t)
    call DestroyTimerDialog(td)
    call DestroyGroup(udg_hss_SelectableHeroes)
    call DestroyGroup(udg_hss_AvailableHeroes)
    call TriggerRemoveAction(UnitSel,usac)
    call DestroyTrigger(UnitSel)
    call TriggerRemoveAction(UnitOrder,uoac)
    call DestroyTrigger(UnitOrder)
    set a=1
    loop
        exitwhen a>12
        call TriggerSleepAction(0)
        call RemoveRect(udg_hss_HeroSection[a])
        call RemoveRect(udg_hss_HeroCreation[a])
       set udg_hss_HeroSection[a] = null
       set udg_hss_HeroCreation[a] = null
       set udg_hss_Heroes[13+a-1] = null
       set a=a+1
    endloop
 set t=null
 set td=null
 set uoac=null
 set usac=null
 set udg_hss_SelectableHeroes=null
 set udg_hss_AvailableHeroes=null
 set forcevar=null
 set heroes=null
 set current=null
endfunction

//============================================================================================================
function VxHSS takes nothing returns nothing
// Will call the StartVxHSS which works like before for compatibility's sake.
//
    call StartVxHSS((hss_RandomHeroSpellId()>0),hss_ComputerHeroes(),hss_DoCleanup())
endfunction

//===========================================================================
function InitTrig_Selection_System takes nothing returns nothing
// If you make your map with JASS, you can simply have the setup process here, but call VxHSS
// in another thread
endfunction

Attached Images
File Type: png ssh.png (104.6 KB, 1971 views)
Attached Files
File Type: w3x hss.w3x (60.4 KB, 1863 views)
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-30-2005, 10:34 AM   #2
Blade.dk
.
 
Blade.dk's Avatar


Respected User
 
Join Date: May 2005
Posts: 1,990

Submissions (15)

Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)

Approved Map: Azeroth's Arcane ArenaSpell session 01 winner

Send a message via MSN to Blade.dk
Default

Best selection system ever .
__________________
Spell Making Course: Part 1: Making a simple stomp spell.
I wonder if I'll ever finish part 2.
Blade.dk is offline   Reply With Quote
Old 12-30-2005, 12:28 PM   #3
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

agreed, but If I remember correctly its sort of a pain to set up and all, I think I'll just stick with taverns to save space
emjlr3 is offline   Reply With Quote
Old 12-30-2005, 12:47 PM   #4
Blade.dk
.
 
Blade.dk's Avatar


Respected User
 
Join Date: May 2005
Posts: 1,990

Submissions (15)

Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)

Approved Map: Azeroth's Arcane ArenaSpell session 01 winner

Send a message via MSN to Blade.dk
Default

I had no problems when I should set it up, and that is months ago, back when I was new to JASS.
__________________
Spell Making Course: Part 1: Making a simple stomp spell.
I wonder if I'll ever finish part 2.
Blade.dk is offline   Reply With Quote
Old 12-30-2005, 04:55 PM   #5
Belphegor666
User
 
Belphegor666's Avatar
 
Join Date: Jul 2004
Posts: 787

Submissions (1)

Belphegor666 is on a distinguished road (16)

Default

I have no JASS experience but I have a question.
My Timer window (with the title "choose a hero") has no text in it?! From where am I supposed to enter it? A nice paragraph with a marked text would be nice.
I was searching the script manualy using search in notepad, but no luck .

BTW how did you make your scripts work in without entering them in the CSS (custom script section), Vex? It's Voodo ain't it
Belphegor666 is offline   Reply With Quote
Old 12-30-2005, 05:00 PM   #6
Blade.dk
.
 
Blade.dk's Avatar


Respected User
 
Join Date: May 2005
Posts: 1,990

Submissions (15)

Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)

Approved Map: Azeroth's Arcane ArenaSpell session 01 winner

Send a message via MSN to Blade.dk
Default

It is the text extracted from the first "art - special" field on the "Select this Hero" ability.
__________________
Spell Making Course: Part 1: Making a simple stomp spell.
I wonder if I'll ever finish part 2.
Blade.dk is offline   Reply With Quote
Old 12-30-2005, 05:00 PM   #7
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,905

Submissions (37)

Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)

Hero Contest #3 - 2nd Place

Default

I think it is supposed to be in one ability?

Edit: blade is fast
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 12-30-2005, 05:04 PM   #8
Belphegor666
User
 
Belphegor666's Avatar
 
Join Date: Jul 2004
Posts: 787

Submissions (1)

Belphegor666 is on a distinguished road (16)

Default

Tnx I'll if it works...
Works like a charm tnx Vex... owe you credits

Last edited by Belphegor666 : 12-30-2005 at 07:16 PM.
Belphegor666 is offline   Reply With Quote
Old 12-31-2005, 04:59 PM   #9
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

Quote:
Originally Posted by Blade.dk
I had no problems when I should set it up, and that is months ago, back when I was new to JASS.

ditto, I was just saying it took a while to set up, not like his JASS spells, that take like 2 minutes, if I remeber correctly it took me like half an hour to get working


however, once it's working, it's a wonderful thing
emjlr3 is offline   Reply With Quote
Old 12-31-2005, 05:19 PM   #10
Magnum123
User
 
Join Date: Apr 2004
Posts: 70

Magnum123 has little to show at this moment (0)

Default

Great system. Takes a while to implement, but gives a lot of information on the hero you want to play before you select it.
Magnum123 is offline   Reply With Quote
Old 09-10-2006, 09:04 AM   #11
nooK
n1nja
 
nooK's Avatar
 
Join Date: Dec 2005
Posts: 211

nooK will become famous soon enough (30)nooK will become famous soon enough (30)

Default

Critical Bug:
Select your hero when the timer hits 0, and you get your selected hero and a forced one. The timing is very easy you can manage it every time...
nooK is offline   Reply With Quote
Old 09-10-2006, 01:41 PM   #12
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,905

Submissions (37)

Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)

Hero Contest #3 - 2nd Place

Default

I added to the first post an updated version of the [Selection System] code that would fix this problem
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 09-11-2006, 01:11 PM   #13
Chuckle_Brother
Oh for the sake of fudge
 
Chuckle_Brother's Avatar


Respected User
 
Join Date: Dec 2005
Posts: 782

Submissions (2)

Chuckle_Brother will become famous soon enough (53)Chuckle_Brother will become famous soon enough (53)

Send a message via ICQ to Chuckle_Brother Send a message via AIM to Chuckle_Brother Send a message via MSN to Chuckle_Brother Send a message via Yahoo to Chuckle_Brother
Default

Nice to see this up and about again.

Sexy system Vex.
__________________
"...you play a mean banjo"
Chuckle_Brother is offline   Reply With Quote
Old 09-24-2006, 10:29 AM   #14
nooK
n1nja
 
nooK's Avatar
 
Join Date: Dec 2005
Posts: 211

nooK will become famous soon enough (30)nooK will become famous soon enough (30)

Default

Another bug: If timers hits 0, and two players still havenĀ“t chosen they can get the same hero, even if Double Heroes is false.
nooK is offline   Reply With Quote
Old 10-06-2006, 08:55 PM   #15
BertTheJasser
xyzi - our universe
 
BertTheJasser's Avatar
 
Join Date: May 2005
Posts: 742

Submissions (2)

BertTheJasser has a spectacular aura about (111)BertTheJasser has a spectacular aura about (111)BertTheJasser has a spectacular aura about (111)BertTheJasser has a spectacular aura about (111)

Default

@nooK: This will only happen if no non-allready-selected heroes are choosen
__________________
Note: Bye... I had a lot of fun here!
Special thanks to Vexorian who helped me learn jass, the real jass and always helped me when problems occured, I would call him somehow my mentor. Pipedream, who made amazing Grimoire and helped me acclerating my map (currently at 99% finished, no developement atm).

Vote for Linux Ports in general of Blizzard products: http://www.PetitionOnline.com/ibpfl/

Last edited by BertTheJasser : 10-06-2006 at 09:14 PM.
BertTheJasser is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 12:40 PM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services