• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[AI] [solved] Debug Script Not Working. Ideas?

Status
Not open for further replies.
Level 17
Joined
Mar 16, 2008
Messages
638
I'm trying to debug an AI script. I was sending messages at the beginning of each function but they weren't sent quick enough, before it crashed. So I tried implementing these functions to wait until the message is send before running the rest of the function, but now it's not sending any messages. The script is still running though, just not sending the messages. Any ideas how to get it working?

set up functions:
JASS:
globals
    player                  debug_player               = Player(4)
    string                  debug_toPrint              = ""
endglobals


//= DEBUG WAIT ========== credit: Bribe =====================================
function WaitPrint takes string toPrint returns nothing
    set debug_toPrint = toPrint //you must define a string called debug_toPrint in the globals block
    call ExecuteFunc("WaitPrint_Exec")
endfunction
function WaitPrint_Exec takes nothing returns nothing
    local string toPrint = debug_toPrint
    call TriggerSleepAction(0)
    call DisplayTextToPlayer(debug_player, 0, 0, toPrint)
endfunction

example of the first and seventh function to be debugged:
JASS:
//===========================================================================
function CheckLastCommand takes boolean pop returns integer
    local integer cmd = GetLastCommand()
call WaitPrint ("1")
    if (pop) then
        call PopLastCommand(  )
    endif
    return cmd
endfunction
//===========================================================================
function ResetAttackUnits takes nothing returns nothing
call WaitPrint("7")
    set awGold = 0
    set awWood = 0
    call InitAssaultGroup(  )
endfunction

these are only some relevant snips of the script.

edit: solved seems
JASS:
call ExecuteFunc("WaitPrint_Exec")
works when it's simply changed to
JASS:
call WaitPrint_Exec()
 
Last edited:
Status
Not open for further replies.
Top