Are LUA apis identical to Jass?

Status
Not open for further replies.
Level 3
Joined
Nov 3, 2018
Messages
12
I'm trying to run the following code:

Code:
function SpawnerActions()
    print "I am a test string."
    CreateNUnitsAtLoc(1, "hfoo", Player(0), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
end



onTriggerInit(function ()
    Spawner = CreateTrigger()
    TriggerRegisterTimerEventPeriodic(Spawner, 2)
    TriggerAddAction(Spawner, SpawnerActions)
end)

Using Bribe's global initialization for LUA. Output prints the string as excepted but does not spawn any unit. Any idea?
 
Level 3
Joined
Aug 6, 2019
Messages
74
Thanks. Worked.
By chance, do you have a reference guide with all of these quirks packed together or something? How did you know? What does FourCC even mean...
function ForCC(id)
local i=string.byte(id,1)
i=i*256+string.byte(id,2)
i=i*256+string.byte(id,3)
i=i*256+string.byte(id,3)
i=i*256+string.byte(id,4)
return i
end
 
Status
Not open for further replies.
Top