Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
I just wanna explain that the error related to "gg_trg_Detonador_sin_nomber_002" being undeclared probably happened because you used the "Syntax Check" button instead of saving the map. That button doesn't check the entire map script, but only the scope being visible at run time. Since that variable isn't being declared there, it threw such error. I recommend that you save your map if you want to check for any real errors.
I just wanna explain that the error related to "gg_trg_Detonador_sin_nomber_002" being undeclared probably happened because you used the "Syntax Check" button instead of saving the map. That button doesn't check the entire map script, but only the scope being visible at run time. Since that variable isn't being declared there, it threw such error. I recommend that you save your map if you want to check for any real errors.
Let's take another approach. Despite the error being shown, your piece of code primarily won't run because there's no event associated with the trigger, and the trigger itself doesn't reference your "HelloWorld" function even if it had a proper event.
Change your script to this:
JASS:
function HelloWorld takes nothing returns nothing
call BJDebugMsg("Hello World!")
endfunction
//===========================================================================
function InitTrig_Detonador_sin_nombre_002 takes nothing returns nothing
local trigger triggerVar = CreateTrigger()
call TriggerAddAction(triggerVar, function HelloWorld)
call TriggerRegisterTimerEvent(triggerVar, 1.00, false)
endfunction
JASS:
//===========================================================================
// The function name below is generated by the editor when converting from GUI to JASS. It should respect the "trigger name".
// This function is called by another "hidden" function (Main -> InitCustomTriggers)
function InitTrig_Detonador_sin_nombre_002 takes nothing returns nothing
local trigger triggerVar = CreateTrigger() // Local variable, type: Trigger, Name: triggerVar = Initializes a new trigger object.
call TriggerAddAction(triggerVar, function HelloWorld) // TriggerAddAction appends a function ("HelloWorld" in this case) to a trigger, and such function is fired when using events or running this trigger.
call TriggerRegisterTimerEvent(triggerVar, 1.00, false) // This registers a timer event which expires in 1 second and doesn't repeat (Just like "Time Elapsed" GUI event)
endfunction
Here's how the trigger works so far:
1 - Map loads, and InitTrig_Detonador_sin_nombre_002 function is called by the game automatically.
2 - A new trigger object is created and assigned to a local variable
3 - Adds an action and event to the trigger object, referencing the local variable.
4 - After timer event expires, the "action" (function) added to the trigger is called. (Calls HelloWorld function)
5 - Prints "Hello World" to all possible clients.
Let's take another approach. Despite the error being shown, your piece of code primarily won't run because there's no event associated with the trigger, and the trigger itself doesn't reference your "HelloWorld" function even if it had a proper event.
Change your script to this:
JASS:
function HelloWorld takes nothing returns nothing
call BJDebugMsg("Hello World!")
endfunction
//===========================================================================
function InitTrig_Detonador_sin_nombre_002 takes nothing returns nothing
local trigger triggerVar = CreateTrigger()
call TriggerAddAction(triggerVar, function HelloWorld)
call TriggerRegisterTimerEvent(triggerVar, 1.00, false)
endfunction
JASS:
//===========================================================================
// The function name below is generated by the editor when converting from GUI to JASS. It should respect the "trigger name".
// This function is called by another "hidden" function (Main -> InitCustomTriggers)
function InitTrig_Detonador_sin_nombre_002 takes nothing returns nothing
local trigger triggerVar = CreateTrigger() // Local variable, type: Trigger, Name: triggerVar = Initializes a new trigger object.
call TriggerAddAction(triggerVar, function HelloWorld) // TriggerAddAction appends a function ("HelloWorld" in this case) to a trigger, and such function is fired when using events or running this trigger.
call TriggerRegisterTimerEvent(triggerVar, 1.00, false) // This registers a timer event which expires in 1 second and doesn't repeat (Just like "Time Elapsed" GUI event)
endfunction
Here's how the trigger works so far:
1 - Map loads, and InitTrig_Detonador_sin_nombre_002 function is called by the game automatically.
2 - A new trigger object is created and assigned to a local variable
3 - Adds an action and event to the trigger object, referencing the local variable.
4 - After timer event expires, the "action" (function) added to the trigger is called. (Calls HelloWorld function)
5 - Prints "Hello World" to all possible clients.
Because you simply call your hello world function.
The InitTrig stuff is only there to attach an event and establish your trigger. If you directly call your function from another trigger, you don't need it at all.
You need the InitTrig if you want to build event triggers in JASS. But calling Jass functions from GUI also works. Its just a matter of how much you want to commit coding in Jass versus applying a hybrid of GUI and Jass.
Because you simply call your hello world function.
The InitTrig stuff is only there to attach an event and establish your trigger. If you directly call your function from another trigger, you don't need it at all.
You need the InitTrig if you want to build event triggers in JASS. But calling Jass functions from GUI also works. Its just a matter of how much you want to commit coding in Jass versus applying a hybrid of GUI and Jass.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.