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

Debug Message in JASS AIs

Status
Not open for further replies.
Level 4
Joined
Sep 13, 2014
Messages
106
BJDebugMessage seems to break the AI.

Where do these functions write to?

Code:
native DebugS               takes string str                            returns nothing
native DebugFI              takes string str, integer val               returns nothing
native DebugUnitID          takes string str, integer val               returns nothing
native DisplayText          takes integer p, string str                 returns nothing
native DisplayTextI         takes integer p, string str, integer val    returns nothing
native DisplayTextII        takes integer p, string str, integer v1, integer v2 returns nothing
native DisplayTextIII       takes integer p, string str, integer v1, integer v2, integer v3 returns nothing
native DoAiScriptDebug      takes nothing                               returns boolean

debug call Trace("SleepInCombat\n")      // (effectively calling DisplayText, but with a debug in the front for some reason)

Also, are there any AIs (JASS or GUI) that people have built that I can look at and compare my AIs to? Does anyone do AI stuff?

Also, to edit my JASS AIs, do I just use notepad, or is there something better I can do?

And is it possible to compile AI code to catch errors?
 
Last edited:
AFAIK those display/debug natives don't do anything. Some people thought that it was used by the creators and would only run in a developer wc3/debugging wc3 mode.

Some people used to use JassCraft for it, but I don't remember whether it even supports common.ai. To syntax check AI code, you can either run pJASS on it through its command-line interface or you can put the code into JassNewGenPack and try saving. You'll have to declare all the natives you use.
http://www.wc3c.net/vexorian/jasshelpermanual.html#ndf

For example, if you use DebugS in your code, you'd have to add a line with the native declaration somewhere in your code:
JASS:
native DebugS               takes string str                            returns nothing

// after that, you can use it without syntax errors...
call DebugS("abc")
 
Status
Not open for further replies.
Top