I have a map where I use a custom galaxy script that I wrote in a text editor and imported using the Import Manager. In this script I call some "libNtve_" functions like libNtve_gf_HideGameUI() and libNtve_gf_CreateDialogItemButton(). In the trigger editor I create a custom script to include the galaxy file, and use the Initialization Function feature of the custom script to call an init function from my galaxy file.
This all works fine as long as there is at least one other trigger that exists in the trigger editor. If I delete the other triggers, leaving only the custom include script, then suddenly it doesn't recognize any of the "libNtve_" function calls in the galaxy script and gives a syntax error on those lines.
If I add an empty trigger in the trigger editor and disable it, then it works again. So it appears that there has to be at least one trigger that exists (even if it's disabled) in order for a custom galaxy script to have access to the "libNtve_" functions.
Can anyone explain why this happens? I can give more detailed instructions on how to duplicate the problem, if you want.
Add a line to your script (not in a function, just at the top of the script):
include"TriggerLibs/NativeLib"
It is required for the script to "find" the native functions.
If you have at least 1 Gui - trigger, this line gets inserted automatically; otherwise its missing.
I have a map where I use a custom galaxy script that I wrote in a text editor and imported using the Import Manager. In this script I call some "libNtve_" functions like libNtve_gf_HideGameUI() and libNtve_gf_CreateDialogItemButton(). In the trigger editor I create a custom script to include the galaxy file, and use the Initialization Function feature of the custom script to call an init function from my galaxy file.
This all works fine as long as there is at least one other trigger that exists in the trigger editor. If I delete the other triggers, leaving only the custom include script, then suddenly it doesn't recognize any of the "libNtve_" function calls in the galaxy script and gives a syntax error on those lines.
If I add an empty trigger in the trigger editor and disable it, then it works again. So it appears that there has to be at least one trigger that exists (even if it's disabled) in order for a custom galaxy script to have access to the "libNtve_" functions.
Can anyone explain why this happens? I can give more detailed instructions on how to duplicate the problem, if you want.
Add a line to your script (not in a function, just at the top of the script):
It is required for the script to "find" the native functions.
If you have at least 1 Gui - trigger, this line gets inserted automatically; otherwise its missing.
Ok, thanks. I did compare the generated scripts when there was a trigger and when there wasn't a trigger, but I didn't notice that
gets changed to
when a trigger doesn't exist. Durr.