• 🏆 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!

Can't display debug msgs?

Status
Not open for further replies.
Level 15
Joined
Nov 30, 2007
Messages
1,202
Map broken?

Just installed JNGP on my new comp and this don't work in game. Or rather, it doesn't work in my map but it works in a fresh map. :s

And a few minor triggers don't appear to work properly.

JASS:
scope Periodic initializer Init

    private function Periodic takes nothing returns nothing
        call BJDebugMsg("HI!")
    endfunction
    
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterTimerEvent(t, 1., true)
        call TriggerAddAction(t, function Periodic) 
    endfunction

endscope
 

EdgeOfChaos

E

EdgeOfChaos

Delete triggers and test repeatedly until you find which one's causing it to break. There's not much more I could tell you without seeing the map.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
Delete triggers and test repeatedly until you find which one's causing it to break. There's not much more I could tell you without seeing the map.

Okey I found the trigger. But no idea why because I haven't changed it or anything for more then a week. How could it break just now? O:

This is the part that is breaking the map, but it's weird because it worked before... ;p

JASS:
private function AddPreplacedFarms takes nothing returns nothing
        local unit u
        local rect r = GetWorldBounds()
        call TriggerSleepAction(0.1)    // Waits for Unit Indexer
        call GroupEnumUnitsInRect(g,r,null)
        loop
            set u = FirstOfGroup(g)
            exitwhen u == null
            call GroupRemoveUnit(g, u)
            if IsUnitFarm(u) == true then
                call GroupAddUnit(farmGroup, u)
                call UpdateFarm(u)
            endif
        endloop
        call RemoveRect(r)
        set r = null
        set u = null
    endfunction
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
And you are calling this function via normal function call?It would be good to see calling part.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
And you are calling this function via normal function call?It would be good to see calling part.

It's from my spell, I moved it out from the Init to test if it made a difference.

JASS:
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0 
        local player p
        
        loop
            set p = Player(i)
            call TriggerRegisterPlayerUnitEvent(t,p,EVENT_PLAYER_UNIT_CONSTRUCT_START, function OnStart)
            call TriggerRegisterPlayerUnitEvent(t,p,EVENT_PLAYER_UNIT_CONSTRUCT_FINISH, function OnFinish)
            call TriggerRegisterPlayerUnitEvent(t,p,EVENT_PLAYER_UNIT_DEATH, null)
            set i = i + 1
            exitwhen i == bj_MAX_PLAYER_SLOTS
        endloop
        call TriggerAddCondition(t,Condition(function OnDeath))
        
        // Configuration 
            call SetupFarmType('hhou')
            call SetupTerrainYield('Adrg', 1.00)    // Ashenvale: Grassy Dirt
            call SetupTerrainYield('Zgrs', 0.75)    // S. Ruins: Grass
            call SetupFarmGrid(0,0)
            call SetupFarmGrid(128,0)
            call SetupFarmGrid(-128,0)
            call SetupFarmGrid(0,128)
            call SetupFarmGrid(0,-128)
            call SetupFarmGrid(128,128)
            call SetupFarmGrid(-128,128)
            call SetupFarmGrid(128,-128)
            call SetupFarmGrid(-128,-128)
            call SetupFarmGrid(256,0)
            call SetupFarmGrid(-256,0)
            call SetupFarmGrid(0,256)
            call SetupFarmGrid(0,-256)
            set color[0] = "|c00ff0000"     // Lowest Yield
            set color[1] = "|c00bf3f00"
            set color[2] = "|c007f7f00"
            set color[3] = "|c003fbf00"
            set color[4] = "|c0000ff00"     // Highest Yield
            globals
                constant integer    FARM_TILE = 'Vcrp' 
            endglobals
        // Endconfiguration
         loop
            exitwhen color[countColor] == null
            set countColor = countColor + 1
        endloop
        call AddPreplacedFarms()
    endfunction
endscope
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
I don't know what exactly all those Setup functions doing, but in jass there is a limit (oplimit) for how much code you can execute in a single thread.To create a new thread for a function which does too much work, you can use ExecuteFunc or register it to a trigger and evaluate/execute trigger.Instead of,

call AddPreplacedFarms()

use

call ExecuteFunc("AddPreplacedFarms")
 
Status
Not open for further replies.
Top