which uses a modified typetest.xml document to allow hand scripted code to be injected into a scenario, I found a way to do the same thing without having to modify typetest.xml. The technique is the same, hacking the trigger generator and forcing it to prematurely end its definition of a command/trigger, then injecting your own code into the trigger system, and finally starting a new command/trigger to catch the block you ended so the trigger generator is none the wiser.
line 5 ends forces the end of the internally generated trigger started in line 1. This technique uses comments to confuse the trigger generator. When you chat in the code, it is surrounded with end/start comment blocks. What ends up happening is all the code the trigger generator creates is on the inside of commments, and your code is on the outside. Lines 7 & 8 are repeated for each line of handwritten code you wish to include in the final trigger file. So now the RMS is almost as powerful as the editor. Now, if I can only figure out how to forbid units in the RMS.... [This message has been edited by TwentyOneScore (edited 04-29-2003 @ 08:42 AM).]
01) int id = rmCreateTrigger("DeclareGlobalsStart");
02) rmSwitchToTrigger(id);
03) rmSetTriggerActive(false);
04) rmAddTriggerEffect("Send Chat");
05) rmSetTriggerEffectParam("Message", "\"); }} /*", false);
06) /******** Chat in all your code here ********/
07) rmAddTriggerEffect("Send Chat");
08) rmSetTriggerEffectParam("Message", "*/ int myVar=1; /*", false);
09) /******** END of your code ********/
10) rmAddTriggerEffect("Send Chat");
11) rmSetTriggerEffectParam("Message", "*/ rule _DeclareGlobalsEnd inactive { if (1==1) { trChatSend(0, \"", false);
line 11 starts up a new dummy trigger to catch the close of the trigger started in line 1.
"Just invite him over for dinner. Turn him from an enemy into a friend. Then when he's least expecting, BAM! The old fork in the eye!" - M.S.
--
Member °ƒ Tsunami Studios <<< Play TOS Maps - 9 Maps - Avg Rating: 4.67! >>>