• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

InitBlizzard

Status
Not open for further replies.
JASS:
function InitBlizzard takes nothing returns nothing
    // Set up the Neutral Victim player slot, to torture the abandoned units
    // of defeated players.  Since some triggers expect this player slot to
    // exist, this is performed for all maps.
    call ConfigureNeutralVictim()

    call InitBlizzardGlobals()
    call InitQueuedTriggers()
    call InitRescuableBehaviorBJ()
    call InitDNCSounds()
    call InitMapRects()
    call InitSummonableCaps()
    call InitNeutralBuildings()
    call DetectGameStarted()
endfunction
What are all these actually doing so I can remove them as needed. I'm modifying the map script directly, outside of any editor.
 
  • ConfigureNeutralVictim() - Sets up Player(13) [neutral victim]. Player(13) is passive to other players, but players are aggressive to it (players will auto-attack the neutral victim units, but neutral victim units won't attack players unless forced to via triggers). iirc, units are moved over to neutral victim in melee maps once their base is destroyed.

    e.g. If you kill someone's base in a melee map (i.e. they are defeated), they lose control of their units (they are moved over to neutral victim), and the units won't attack you anymore (they'll just stand there, even if you attack them).
  • InitBlizzardGlobals() - This sets up the bj globals that need to be initialized to some value when the map starts. It will set up these variables:
    JASS:
    // used as boolexprs for their corresponding functions
    filterIssueHauntOrderAtLocBJ
    filterEnumDestructablesInCircleBJ
    filterGetUnitsInRectOfPlayer
    filterGetUnitsOfTypeIdAll
    filterGetUnitsOfPlayerAndTypeId
    filterMeleeTrainedUnitIsHeroBJ
    filterLivingPlayerUnitsOfTypeId
    
    bj_FORCE_PLAYER[] // slots 0-15
    bj_FORCE_ALL_PLAYERS
    
    // cached values from the start of the map
    bj_cineModePriorSpeed
    bj_cineModePriorFogSetting
    bj_cineModePriorMaskSetting
    
    // this is rather trivial, since arrays should default with these values
    bj_queuedExecTriggers[] // slots 0-99, initialized with "null"
    bj_queuedExecUseConds[] // slots 0-99, initialized with "false"
    
    bj_isSinglePlayer
    
    // miscellaneous sounds used by BJ functions, e.g. quests/victory/defeat dialogs
    bj_rescueSound
    bj_questDiscoveredSound
    bj_questUpdatedSound
    bj_questCompletedSound
    bj_questFailedSound
    bj_questHintSound
    bj_questSecretSound
    bj_questItemAcquiredSound
    bj_questWarningSound
    bj_victoryDialogSound
    bj_defeatDialogSound
    
    bj_delayedSuspendDecayTrig
    
    bj_MELEE_MAX_TWINKED_HEROES
  • InitQueuedTriggers() - Sets up bj_queuedExecTimeout to fire when the trigger queue timer expires.
  • InitRescuableBehaviorBJ() - It'll iterate through the players and check if any of them are flagged as "rescuable". If so, then it will register events for when a unit owned by that player is rescued. When that happens, an indicator will be placed around the unit, he'll change colors and owner, a rescue sound will be played, and the map will be pinged.
  • InitDNCSounds() - Sets for the rooster sound to be played once morning hits (time = 6.00), and for the wolf sound to play once night hits (time = 18.00). It will also set ambient sounds whenever the appropriate times are reached.
  • InitMapRects() - Initializes bj_mapInitialPlayableArea to cover the map area, and bj_mapInitialCameraBounds to cover the map camera bounds.
  • InitSummonableCaps() - It sets the max tech for siege engines (with barrage) and troll berserkers to 0, unless the player has that already upgraded when the initialization starts. It also limits the number of skeletons for each player to 25 (interesting fact).
  • InitNeutralBuildings() - Sets up stock updating and slots, etc. Also registers the "Sold event", so that items will decrease in stock once it is purchased from a shop.
  • DetectGameStarted() - Fires a 0.01 second timer. After it expires, bj_gameStarted will be set to true.

If you are using a lot of GUI or BJ's, then you should keep them. If not, then you can probably get around to removing some. I'd recommend keeping InitMapRects(), InitDNCSounds(), DetectGameStarted() (if you are using the cinematic BJ's), and InitBlizzardGlobals() (maybe ConfigureNeutralVictim() too if you are working on a melee map).
 
I did learn some, thanks for the explanation. The reason I'm asking is because I'm trying to code an entire map by hand (importing the jass file overwrites anything the editor generates). Since I'm not using a BJs I was curious what I could remove. It's not a melee map, it's actually just a scratchpad map I've been using to screw around in. Reading into this revealed a lot of interesting stuff about how Warcraft 3 works and how blank the engine is. Thank you.Tanget: Why the 25 skeleton limit? I'm sure I've had more at one point (12 Necromancers plus 3 heroes all with rod of necromancy really turns battles around).
 
I did learn some, thanks for the explanation. The reason I'm asking is because I'm trying to code an entire map by hand (importing the jass file overwrites anything the editor generates). Since I'm not using a BJs I was curious what I could remove. It's not a melee map, it's actually just a scratchpad map I've been using to screw around in. Reading into this revealed a lot of interesting stuff about how Warcraft 3 works and how blank the engine is. Thank you.Tanget: Why the 25 skeleton limit? I'm sure I've had more at one point (12 Necromancers plus 3 heroes all with rod of necromancy really turns battles around).

Same. I always figured that much of those stuff were hardcoded in.

Not sure about the 25 skeleton limit. I guess it was for balancing necromancer + meat wagon spamming. I too feel like I might've had more than 25 skeletons before. I haven't actually tested it.

But when you consider how 25 skeletons would look like, maybe I haven't had that many. :p
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
I remember removing one of those, though not exactly what, the game didn't load the UI and the units were uncontrollable.

EDIT: Oh! I remember, I removed the InitBlizzard lol... sorry...
 
I wonder what all these variables are used for (like bj_gamestarted). +Rep for your help Purgeandfire.

bj_gamestarted is used as a check before setting up volume groups (if it comes during map initialization, it'll delay setting the volumes until after 0.01 seconds elapsed game time), and it is used for cinematic mode (if you start the cinematic mode during map init, it'll fade the interface over 0 seconds).

If you're ever curious about what something in particular does or is used for, just check out the Blizzard.j:
http://wiki.thehelper.net/wc3/jass/Blizzard.j
 
Status
Not open for further replies.
Top