• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

custom spells in Blizzard.j file

Status
Not open for further replies.
anyone had luck with adding custom spells to the blizzard.j file?
Every attempt I made to add a new trigger resulted in the map select race/player section to vanish in-game.

I see in the Nirvana mod custom scripts are successfully implemented in it
and I poke around it a bit I couldn't figure it out.
I add the custom trigger in jass, I add the variables associated with it to the global variables list but still can't get it to run.

Any ideas?
 
Out of curiosity, why would you want to do this to begin with? You can just use a regular trigger or the map's header.

Anyway, if you would like a custom blizzard.j for your map, then you may be able to import it under the path "Scripts/Blizzard.j" using the import manager. Just make sure you grabbed the Blizzard.j from war3patch.mpq, not war3.mpq or war3x.mpq.
 
Out of curiosity, why would you want to do this to begin with? You can just use a regular trigger or the map's header.

Anyway, if you would like a custom blizzard.j for your map, then you may be able to import it under the path "Scripts/Blizzard.j" using the import manager. Just make sure you grabbed the Blizzard.j from war3patch.mpq, not war3.mpq or war3x.mpq.

It's for my mod. I wanted players to be able to trade between gold/lumber and at the moment I use items system which I find lacking. With this I will be able to make trade using 2 abilities which I can set both the location of the icons (x,y) add a system massage and sound and remove the need for mediums like a hero to get the items.

Edit: Also it will allow me to add better custom spells, not just making ones from blizzard's spells.
 
Last edited:
Are you sure you don't have syntax errors in your blizzard.j?

I haven't personally tried injecting a custom blizzard.j into the war3patch.mpq, but usually the issue you described is due to a parse/syntax error at some point. Start off simple: just add a function that creates a unit in the center of the map:
JASS:
function TestBlizzardJ takes nothing returns nothing
    call CreateUnit(Player(0), 'hfoo', 0, 0, 0)
endfunction

Be sure that it parses in the regular editor, put the function in your blizzard.j above InitBlizzard, and call it from InitBlizzard() using call TestBlizzardJ(). Keep in mind that the order in which you put your functions matters. If it still doesn't work, report back and we'll see if there is an alternative.
 
Are you sure you don't have syntax errors in your blizzard.j?

I haven't personally tried injecting a custom blizzard.j into the war3patch.mpq, but usually the issue you described is due to a parse/syntax error at some point. Start off simple: just add a function that creates a unit in the center of the map:
JASS:
function TestBlizzardJ takes nothing returns nothing
    call CreateUnit(Player(0), 'hfoo', 0, 0, 0)
endfunction

Be sure that it parses in the regular editor, put the function in your blizzard.j above InitBlizzard, and call it from InitBlizzard() using call TestBlizzardJ(). Keep in mind that the order in which you put your functions matters. If it still doesn't work, report back and we'll see if there is an alternative.

Ok I tested that and it works. I will try adding a trigger with an event/condition next.

Edit:

I tested it using a simple event like esc cinematic sequence but menus vanish again. It seems whenever I try to create a trigger that happens. Here is the code I use.

JASS:
function Trig_TestTrade_Actions takes nothing returns nothing
    call AdjustPlayerStateBJ( 1000, GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
endfunction

//===========================================================================
function InitTrig_TestTrade takes nothing returns nothing
    set gg_trg_TestTrade = CreateTrigger(  )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_TestTrade, Player(0) )
    call TriggerAddAction( gg_trg_TestTrade, function Trig_TestTrade_Actions )
endfunction

I added it like you told me - before initBlizzard and called initTrig_TestTrade within initBlizzard.
Also added gg_trg_TestTrade to the global variables with value =null.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
into your map, either by using JNGP and vJass, or into the map header.

If you put anything into mpqs, you will either have to redistribute this mpq archive, or it will be local to you, or you will have to import the whole blizzard.j file into your map which is already wasting a lot of space.
 
into your map, either by using JNGP and vJass, or into the map header.

If you put anything into mpqs, you will either have to redistribute this mpq archive, or it will be local to you, or you will have to import the whole blizzard.j file into your map which is already wasting a lot of space.

I'm not making a map I'm making a mod which effects all melee maps.
 
Eureka! I've cracked it. The whole thing was to put the trigger creation and TriggerRegisterPlayerEvent in the initBlizzard function while actions remain as a separate function. Variables are also declared in the initBlizzard function as local variables.


JASS:
function Trig_TestTrade_Actions takes nothing returns nothing
    call AdjustPlayerStateBJ( 1000, GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
endfunction

//===========================================================================




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.
    local trigger gg_trg_TestTrade = CreateTrigger(  )


    call ConfigureNeutralVictim()

    call InitBlizzardGlobals()
    call InitQueuedTriggers()
    call InitRescuableBehaviorBJ()
    call InitDNCSounds()
    call InitMapRects()
    call InitSummonableCaps()
    call InitNeutralBuildings()
    call DetectGameStarted()

    call TriggerRegisterPlayerEventEndCinematic( gg_trg_TestTrade, Player(0) )
    call TriggerAddAction( gg_trg_TestTrade, function Trig_TestTrade_Actions )
endfunction
 
Status
Not open for further replies.
Top