• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] [help] Jass simple glitch but confusing!

Status
Not open for further replies.
Level 12
Joined
Aug 7, 2004
Messages
875
Hey I made some functions on the custom script space. And in the initialization I called those functions.

JASS:
function Trig_Initialization_Actions takes nothing returns nothing
    local integer x = 0
    set udg_heroselector[1] = gg_unit_ncop_0015
    set udg_heroselector[2] = gg_unit_ncop_0016
    set udg_heroselector[3] = gg_unit_ncop_0017
    set udg_heroselector[4] = gg_unit_ncop_0018
    set udg_heroselector[5] = gg_unit_ncop_0019
    set udg_heroselector[6] = gg_unit_ncop_0020
    set udg_heroselector[7] = gg_unit_ncop_0021
    set udg_heroselector[8] = gg_unit_ncop_0022
    set udg_heroselector[9] = gg_unit_ncop_0023
    set udg_heroselector[10] = gg_unit_ncop_0024
    //call DisableTrigger( gg_trg_RWarningAzer )
    //call DisableTrigger( gg_trg_RWarningAzerAdvance )
    //call DisableTrigger( gg_trg_RWarningAzerAdvance2 )
    //call DisableTrigger( gg_trg_RWarningAzerAdvance3 )
    //call DisableTrigger( gg_trg_RWarningLord )
    //call DisableTrigger( gg_trg_RWarningLordAdvance )
    //call DisableTrigger( gg_trg_RWarningLordAdvance2 )
    //call DisableTrigger( gg_trg_RWarningLordAdvance3 )
    loop
        exitwhen x > 9
        call InitPlayerSettings(Player(x), true, true, 750, 12, 160)
        set udg_tax[x+1] = 10
        if(PlayerIsPlaying(Player(x))) then
            if(GetConvertedPlayerId(Player(x)) < 5) then
                call ForceAddPlayerSimple( Player(x), udg_teamOne )
            else
                call ForceAddPlayerSimple( Player(x), udg_teamTwo ) 
            endif
        endif
        set x = x + 1
    endloop
    set udg_MultiboardTitle = ( "|c00FFD51CScore board:" + "" )
    set udg_objective = "Achieve a score of 50,000 gold before the enemy team does."
    set udg_GoldLevel = 1
    set udg_harvest[1] = 'A001'
    set udg_harvest[2] = 'A004'
    set udg_harvest[3] = 'A005'
    set udg_harvest[4] = 'A006'
    set udg_harvest[5] = 'A007'
    call SetSkyModel( "Environment\\Sky\\Outland_Sky\\Blizzard_Sky.mdl" )
    call UseTimeOfDayBJ( false )
    call SetTimeOfDay( 24.00 )
    call ForForce( GetPlayersAll(), function BountyOn )
    set udg_TownHall[1] = gg_unit_h003_0025 
    set udg_TownHall[2] = gg_unit_h003_0026
    set udg_TownHall[3] = gg_unit_h003_0027
    set udg_TownHall[4] = gg_unit_h003_0028
    set udg_TownHall[5] = gg_unit_h003_0029
    set udg_TownHall[6] = gg_unit_h003_0030
    set udg_TownHall[7] = gg_unit_h003_0031
    set udg_TownHall[8] = gg_unit_h003_0032
    set udg_TownHall[9] = gg_unit_h003_0033
    set udg_TownHall[10] = gg_unit_h003_0034
    set udg_p[1] = gg_rct_gm1 
    set udg_p[2] = gg_rct_gm2 
    set udg_p[3] = gg_rct_gm3
    set udg_p[4] = gg_rct_gm4
    set udg_p[5] = gg_rct_gm5
    set udg_p[6] = gg_rct_gm6
    set udg_p[7] = gg_rct_gm7
    set udg_ResearchX = 0
    set udg_Construct[1] = gg_rct_Construct1
    set udg_Construct[2] = gg_rct_Construct2
    set udg_Construct[3] = gg_rct_Construct3
    set udg_Construct[4] = gg_rct_Construct4
    set udg_Construct[5] = gg_rct_Construct5
    set udg_Construct[6] = gg_rct_Construct6
    set udg_Construct[7] = gg_rct_Construct7
    set udg_Construct[8] = gg_rct_Construct8
    set udg_Construct[9] = gg_rct_Construct9
    set udg_Construct[10] = gg_rct_Construct10
    call ForForce( GetPlayersAll(), function DisableABG )
    call ForForce( GetPlayersByMapControl(MAP_CONTROL_COMPUTER), function InsertAI )
    call ForceRemovePlayerSimple( Player(10), udg_aiG )
    call ForceRemovePlayerSimple( Player(11), udg_aiG )
    call GetHost()
call InitTrig_GetPlayerColour()
call InitPlayerLeave()
[COLOR="Red"]call InitTeamkill()[/COLOR]
call InitSmoothCamera()
call InitDestructibleResurrection()
call InitUnitDeathBoolean()
call InitChatSetup() <<<<<<<<
[COLOR="Red"]call InitTrig_orderMine()[/COLOR]<<<<<<
call InitTrig_AbilityTargetMC()
[COLOR="Red"]call InitTrig_checkmine()[/COLOR] <<<<<<<
call InitSpawnUnit()
[COLOR="Red"]call GC_CreateMultiboard()[/COLOR] <<<<<<
call CreepRespawn_Setup()
call InitTrig_AI_footman()
endfunction

//===========================================================================
function InitTrig_Initialization takes nothing returns nothing
    set gg_trg_Initialization = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Initialization, function Trig_Initialization_Actions )
endfunction

The problem is the ones in red did not get called. Moreover I made an execution function here...

JASS:
function Trig_ExecuteMain_Actions takes nothing returns nothing
    call CreateLeaderboardBJ( GetPlayersAll(), "Team score:" )
    call LeaderboardDisplayBJ( true, GetLastCreatedLeaderboard() )
    call LeaderboardAddItemBJ( Player(10), GetLastCreatedLeaderboard(), GetPlayerNameColoured(Player(10)) + "Azeroth: ", 0 )
    call LeaderboardAddItemBJ( Player(11), GetLastCreatedLeaderboard(), GetPlayerNameColoured(Player(11)) + "Lordaeron: ", 0 )
    call LeaderboardSetStyleBJ( GetLastCreatedLeaderboard(), true, true, true, true )
    call LeaderboardSetStyleBJ( GetLastCreatedLeaderboard(), true, true, true, true )
    call AddUnitToStockBJ( 'E000', BarneyInnTavern(), 1, 1 ) <<<<< stops
    call AddUnitToStockBJ( 'H009', BarneyInnTavern(), 1, 1 )
    call AddUnitToStockBJ( 'H008', BarneyInnTavern(), 1, 1 )
    call AddUnitToStockBJ( 'H007', BarneyInnTavern(), 1, 1 )
    call AddUnitToStockBJ( 'O002', BarneyInnTavern(), 1, 1 )
    call AddUnitToStockBJ( 'O001', BarneyInnTavern(), 1, 1 )
    call AddUnitToStockBJ( 'H00I', BarneyInnTavern(), 1, 1 )
    call AddUnitToStockBJ( 'N00L', BarneyInnTavern(), 1, 1 )
    call AddUnitToStockBJ( 'N00P', BarneyInnTavern(), 1, 1 )
    call AddUnitToStockBJ( 'H00J', BarneyInnTavern(), 1, 1 )
    call AddUnitToStockBJ( 'H00U', BarneyInnTavern(), 1, 1 )
    call AddUnitToStockBJ( 'O004', ThreeMoonsTavern(), 1, 1 )
    call AddUnitToStockBJ( 'H00X', ThreeMoonsTavern(), 1, 1 )
    call AddUnitToStockBJ( 'H00Y', ThreeMoonsTavern(), 1, 1 )
    call MultiboardDisplay( board, true )
    call StopMusicBJ( true )
    call EndThematicMusicBJ(  )
    call ForForce( GetPlayersAll(), function ApplyCamera )
    call PlaySoundBJ( gg_snd_BattleNetDoorsStereo2 )
    call StartTimerBJ( udg_Time, false, 90.00 )
    call CreateTimerDialogBJ( udg_Time, "|c004460C4Pick Hero:|r" )
    call TimerDialogDisplayBJ( true, GetLastCreatedTimerDialogBJ() )
endfunction

//===========================================================================
function InitTrig_ExecuteMain takes nothing returns nothing
    set gg_trg_ExecuteMain = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_ExecuteMain, 0.10 )
    call TriggerAddAction( gg_trg_ExecuteMain, function Trig_ExecuteMain_Actions )
endfunction

It worked up to the point i marked as red and then stops... by means the unit was not added to the stocks music was not stopped, and the battlenet door sound wasn't played.

THIS IS IRRITATING ME!!

Is there implications in JASS i must understand here? Like this is a real killer bug... :razz:
 
Level 12
Joined
Aug 7, 2004
Messages
875
Those functions work in my previous map, I am migrating into a new terrain while converting all the systems into full JASS. Those functions called however are already JASS. I'm wondering why though at the DB function, it stops right here
call LeaderboardSetStyleBJ( GetLastCreatedLeaderboard(), true, true, true, true) call AddUnitToStockBJ( 'E000', BarneyInnTavern(), 1, 1 ) <<<<< stops

So when I test the game only the leaderboard is shown, and unit was not added to stock, and if u see after this line there are sound calls and everything, I checked it it wasn't even called.

This is weird...
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
By default, the bottom function of a trigger (the int function) will always automaticly be called by WC3 and thus does not need to be called. Also remember, you can not call functions that are located phisically bellow the place of calling in the actual end script file.
 
Level 12
Joined
Aug 7, 2004
Messages
875
Yes if I call that it will return a missing function error.

Well I don't understand why the sound is not called, and the heroes are not added to the tavern, I've checked the BarneyInnTavern() and it returns a valid unit.

This is an example of InitTriggerName I use
JASS:
function InitCameraSmooth takes nothing returns trigger
local trigger t = CreateTrigger()
call RegisterTriggerEvent(t, blah blah blah)
call AddTriggerAction(t, blah blah blah)
return t
endfunction
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
There is a limate to the number of processes a execution can preform (like a trigger being triggered). Maybe you have hit that limate so add a few TriggerSleepAction() (check spelling and wording since it might not be right) throughout the main int function and see if that makes a difference. I have noticed that with systems like a random terane generator or terane changer, that limate is easily hit so maybe you are preforming so much you have hit that limate as well? Running a function via the execute function which takes a string for the function name and then runs it breakes this limate (the executed function receives its own limate) so maybe try using that if it is your problem which is quite unlikely.
 
Level 12
Joined
Aug 7, 2004
Messages
875
I got a better idea.

I will try to treat every trigger function like in GUI. So for every package I put in a trigger place in world editor that is converted into custom script. And I will make every InitTrigger form using global trigger values instead of returning local triggers.

Maybe this will fix the odd issues. However with respect to the DB function, you can see there is a Pan Camera action, it didn't get called also.


If you guys been following my goldrush map progress - I'm trying to migrate all the old stuff into a new terrain file. What I did was import objects, import import/exports, and the triggers. The problem is everytime I compile it always show errors in the

function CreateBuildingsForPlayer1 returns nothing
endfunction
...
 
Status
Not open for further replies.
Top