Jump to content
Sign in to follow this  
Kaputnik

Trigger created by script will not execute a script in it's activation

Recommended Posts

Hey guys,

Been messing around with the stalker and Namalsk stalker mods for Arma along with trigger scripting and I'm having a bit of an issue.

As a test I have a trigger in the mission editor activated by Radio Bravo with the following activation line.

null = [] execVM "anomaly.sqf";

and here is anomaly.sqf

trg=createTrigger["EmptyDetector",getMarkerPos "mark"];

trg setTriggerArea[5,5,0,false];

trg setTriggerActivation["ANY","PRESENT",false];

trg setTriggerStatements[this,ANOMALY = [thistrigger, 5, 1] execVM "DAPANOMALIES\Scripts\Trampoline.sqf",nul];

trg setTriggerTimeout [0, 0, 0, false];

trg setTriggerText "Anomaly"

the script call for trampoline.sqf in the activation field does not work here,it does work for a trigger created in the editor, also, I replaced the script call with a hint at one point and it appeared, which suggests to me that the problem is the activation field in particular.

If anyone has any suggestions or notices an obvious flaw Id be super thankful if you'd let me know!

Regards,

Kaputnik

Share this post


Link to post
Share on other sites

I think it is in here:

trg setTriggerStatements[this,ANOMALY = [thistrigger, 5, 1] execVM "DAPANOMALIES\Scripts\Trampoline.sqf",nul];

I dont know what is inside the script "Trampoline.sqf", but there most likely is a "_this select 0", which means it grabs the first from the array, which I highlighted in RED, and I think it needs to be the trigger NAME, which is trg... maybe.

To make it more understandable, "select 1" would in your case select the "5", and "select 2" would return the "1" inside the [], that just aside.

Try that.

Maybe rename the "trg" to something else, like "customtrg1" and "customtrg2" for the next, and so on.

I generally stay away from using simple object names like trg or trg1, some of them are used inside the game itself or may be used inside a existing map/script, resulting in all kinds of errors.

Share this post


Link to post
Share on other sites

Trigger statements need to be strings. I would try this:

trg setTriggerStatements["this", "ANOMALY = [thistrigger, 5, 1] execVM 'DAPANOMALIES\Scripts\Trampoline.sqf'",""];

Share this post


Link to post
Share on other sites

Hey, got it working, it was both the lack of "" around the script call AND the misnaming of the 0th variable(i.e. trg), thanks to both of you for your help!

this is the corrected line if it helps anyone else

trg setTriggerStatements["this","ANOMALY = [trg, 5, 1] execVM 'DAPANOMALIES\Scripts\Trampoline.sqf'",""];

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×