Hi
So I'm having some great fun toying around with the custom script feature, as I find it way too tedious to input all I want into the interface of the editor. I tend to create testtriggers within the interface and then open View Script just to get the hang of how one are to type the triggers.
I have, however, run into some difficulties.
When I test my map, the custom scripted triggers won't run, even though I find them identical to the ones created by the interface. Of course I have to put the initializations of each trigger within each custom script, but there must be something I've missed.
Here is a screenshot from when I test my map, clearly showing that the trigger TestDisplay isn't running.
Edit: I've seemed to localized the problem. In the View Script view there's a Trigger Initialization which contains all the triggers implemented through the UI, it looks like this:
I guess I need to have a gt_TestDisplay_Init(); inside that void InitTriggers () aswell, but since that cannot be altered in the custom script, well that's when I don't know how to proceed.
So basically, my query is how to get a gt_TestDisplay_Init(); inside the InitTriggers () using script, as TestDisplay is based on a custom script.
So I'm having some great fun toying around with the custom script feature, as I find it way too tedious to input all I want into the interface of the editor. I tend to create testtriggers within the interface and then open View Script just to get the hang of how one are to type the triggers.
I have, however, run into some difficulties.
When I test my map, the custom scripted triggers won't run, even though I find them identical to the ones created by the interface. Of course I have to put the initializations of each trigger within each custom script, but there must be something I've missed.
Code:
trigger gt_TestDisplay;
bool gt_TestDisplay_Func (bool testConds, bool runActions) {
// Actions
if (!runActions) {
return true;
}
gv_randQue = RandomInt(0, 5);
UIDisplayMessage(PlayerGroupAll(), c_messageAreaChat, StringExternal(gv_Questions[0][gv_randQue].lv_Question));
UIDisplayMessage(PlayerGroupAll(), c_messageAreaChat, StringExternal(gv_Questions[0][gv_randQue].lv_Alternative[0]));
UIDisplayMessage(PlayerGroupAll(), c_messageAreaChat, StringExternal(gv_Questions[0][gv_randQue].lv_Alternative[1]));
UIDisplayMessage(PlayerGroupAll(), c_messageAreaChat, StringExternal(gv_Questions[0][gv_randQue].lv_Alternative[2]));
UIDisplayMessage(PlayerGroupAll(), c_messageAreaChat, StringExternal(gv_Questions[0][gv_randQue].lv_Alternative[3]));
returntrue;
}
//--------------------------------------------------------------------------------------------------
void gt_TestDisplay_Init () {
gt_TestDisplay = TriggerCreate("gt_TestDisplay_Func");
TriggerAddEventTimeElapsed(gt_TestDisplay, 5.0, c_timeGame);
}
Here is a screenshot from when I test my map, clearly showing that the trigger TestDisplay isn't running.
Edit: I've seemed to localized the problem. In the View Script view there's a Trigger Initialization which contains all the triggers implemented through the UI, it looks like this:
Code:
//--------------------------------------------------------------------------------------------------
// Trigger Initialization
//--------------------------------------------------------------------------------------------------
void InitTriggers () {
gt_Round1_Init();
gt_Bepa_Init();
}
I guess I need to have a gt_TestDisplay_Init(); inside that void InitTriggers () aswell, but since that cannot be altered in the custom script, well that's when I don't know how to proceed.
So basically, my query is how to get a gt_TestDisplay_Init(); inside the InitTriggers () using script, as TestDisplay is based on a custom script.