HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Starting Units for Players Whose Race is Unknown

10-20-2006, 07:44 AM#1
karukef
I'm sure some of you might have read this, but I found it rather funny :)

Taken straight out of Blizzard.j:
Collapse JASS:
//===========================================================================
// Starting Units for Players Whose Race is Unknown
//   - 12 Sheep, placed randomly around the start location
//
function MeleeStartingUnitsUnknownRace takes player whichPlayer, location startLoc, boolean doHeroes, boolean doCamera, boolean doPreload returns nothing
    local integer index

    if (doPreload) then
    endif

    set index = 0
    loop
        call CreateUnit(whichPlayer, 'nshe', GetLocationX(startLoc) + GetRandomReal(-256, 256), GetLocationY(startLoc) + GetRandomReal(-256, 256), GetRandomReal(0, 360))
        set index = index + 1
        exitwhen index == 12
    endloop

    if (doHeroes) then
        // Give them a "free hero" token, out of pity.
        call SetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_HERO_TOKENS, bj_MELEE_STARTING_HERO_TOKENS)
    endif

    if (doCamera) then
        // Center the camera on the initial sheep.
        call SetCameraPositionLocForPlayer(whichPlayer, startLoc)
        call SetCameraQuickPositionLocForPlayer(whichPlayer, startLoc)
    endif
endfunction
10-20-2006, 07:53 AM#2
Wyvernoid
Yeah, I remember it was something like several sheep? And btw... what about putting this in off topic.
10-20-2006, 12:38 PM#3
Rising_Dusk
// Give them a "free hero" token, out of pity. Haha, that's funny.
At least they had their sense of humor when making BJ.
10-20-2006, 11:46 PM#4
Anitarf
Yes, I noticed this recently, when looking through melee game functions as a guideline for my altered melee. It's odd, what's this race supposed to be anyway? Perhaps a method to add a fifth race? Food for thought.
10-21-2006, 02:26 AM#5
karukef
Well, the call to MeleeStartingUnitsUnknownRace comes at the end of some "if race is blah"-chain, and I sort of think they added this one just as a joke. And maybe partly to give developers some obvious hint in case they somehow managed to start a game without a race. Instead of "why are there no units?" they get sheep and know why.
10-22-2006, 02:28 PM#6
Naakaloh
I once switched the call to MeleeStartingUnitsOrc, with that function. When I played Orc I never got to use the army of sheep because I had no buildings and lost the game.