I wrote a random maze generator in Galaxy Script, and it all compiles. However, when I go to run it, an error in-game occurs when I fire the event (a chat message). The code that should fire is as follows (I won't show all functions for sake of size)
include "TriggerLibs/natives"
include "TriggerLibs/NativeLib"
also i don't use galaxy but triggers usually have '(bool testConds, bool runActions)' signature and it seems that TriggerCreate expects them? not sure just guessing
Nerf is correct. Here is an excerpt from natives.galaxy.
//--------------------------------------------------------------------------------------------------// Triggers//// Each trigger has one script function, registered in TriggerCreate,// which is expected to look like://// bool TriggerFunc (bool testConditions, bool runActions) {// if (testConditions) {// if (<conditions fail>) {// return false;// }// }//// if (!runActions) {// return true;// }// // <do actions>// return true;// }////--------------------------------------------------------------------------------------------------
Your function's parameters don't match the "prototype"; the syntax checker can't be expected to know the validity of the string as a function reference.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I wrote a random maze generator in Galaxy Script, and it all compiles. However, when I go to run it, an error in-game occurs when I fire the event (a chat message). The code that should fire is as follows (I won't show all functions for sake of size)
include "TriggerLibs/natives"
include "TriggerLibs/NativeLib"
void InitTriggers();
void InitLibs();
void InitGlobals();
bool Maze();
/ Triggers
trigger t_Maze;
void InitMap () {
InitLibs();
InitTriggers();
InitGlobals();
}
void InitLibs () {
libNtve_InitLib();
}
void InitTriggers() {
t_Maze = TriggerCreate("Maze");
TriggerAddEventChatMessage(t_Maze, c_playerAny, "-newMaze", true);
}
void InitGlobals() {
}
bool Maze() {
return true;
}
you tried moving
before void InitTriggers() ?
also i don't use galaxy but triggers usually have '(bool testConds, bool runActions)' signature and it seems that TriggerCreate expects them? not sure just guessing
Nerf is correct. Here is an excerpt from natives.galaxy.
Your function's parameters don't match the "prototype"; the syntax checker can't be expected to know the validity of the string as a function reference.