I'm trying to print a custom text on the
I founded an alternative way (yet it's advanced) from one of the Tutorial page on this site, using the
But this version throws a massive error list called
According to this article, a function that is pointed by the keyword
Any solutions?
Player(0)
's in-game screen in Vanilla Jass style for a practice, but World Editor never print it even though the code does not throw any syntax error while it's being saved.
JASS:
// Custom Script Name: foo
function fooAction takes nothing returns nothing
// variable initialization
local integer red
local string message
// variable assignment
set red = 0
set message = "hello world!"
// invoke a built-in function
// used a different native function from common.j instead of DisplayTimedTextToPlayer() wherer it's used in BJDebugMsg
call DisplayTextToPlayer(Player(red), 0, 0, message)
endfunction
function InitTrig_foo takes nothing returns nothing
// variable declaration
local trigger t = CreateTrigger()
// invoke a built-in function called TriggerAddAction
call TriggerAddAction(t, function fooAction)
// kill memory leak
set t = null
endfunction
I founded an alternative way (yet it's advanced) from one of the Tutorial page on this site, using the
initializer
keyword with Library
like this;
JASS:
library Bar initializer init
// Throws a syntax error;
private function barAction takes nothing returns nothing
local integer red = 0
local string message = "hello world bar!"
call DisplayTextToPlayer(Player(red), 0, 0, message)
endfunction
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerAddAction(t, function barAction)
set t = null
endfunction
endlibrary
But this version throws a massive error list called
Unknown compile error
from the first line where the library
starts.According to this article, a function that is pointed by the keyword
initializer
is equivalent to InitTrig_*
outside of the library
block though, none of them works on my map right now.Any solutions?