Comrades in Arms Discussion Board

Full Version: Created trigger for distraction issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
First, thank you Alwarren for taking the time for testing the mission.

Now the problem is a created trigger for simulated distraction involving a spawned ammunition on a truck and supposedly enemy unit reacting and relocating to the scene of explosion.
Worked just fine when I tested it on editor but of course on dedicated it's a different issue.

Here's what's launched on BLUFOR activated trigger when approaching a task:
Code:
nul = execVM ""scripts\launch.sqf"";hint parsetext format [""<t size='1.0' color='#FF00FF' align='center'>%1</t> Use the radio to signal Nikos about the distraction"", name player];";

And here's the launch.sqf:
Code:
[] spawn {
         private ["_trg"];
         _trg = createTrigger ["EmptyDetector",getPos player];
         _trg setTriggerArea[5,5,0,true];
         _trg setTriggerActivation["CHARLIE","PRESENT",true];
         _trg setTriggerStatements["this", "nuldf = [] execVM 'scripts\kaboom.sqf';", ""];
         3 setRadioMsg "Ask for a distraction" ;
    };

Here is the kaboom.sqf:
Code:
if (isServer)
then
{
radon = true;
publicVariable "radon";
bomb = "R_80mm_HE" createvehicle getmarkerpos "pom";
};
Of course this one is missing a dedicated check as well as "private [_x]" var list....
The enemy units waypoint condition is tied to the "radon" variable.

I bet someone spots immediatelly what's missing?
Any help appreciated.

The general idea is that the sniper team can only take the required shot from a pier which has a motorized patrol near and it needs to be distracted elsewhere with a radio call.
(04-27-2014, 03:24 PM)VanhA link Wrote: [ -> ]First, thank you Alwarren for taking the time for testing the mission.

My pleasure. Knight and me played it yesterday, and we absolutely LOVED it.

Quote:The general idea is that the sniper team can only take the required shot from a pier which has a motorized patrol near and it needs to be distracted elsewhere with a radio call.

We got the radio trigger and the hint, so that part worked. What didn't work was the kaboom part. If I were to venture a guess, then I'd say the trigger only runs on the client and not on the server.

I would recommend to change the trigger statements in launch.sqf:
Code:
_trg setTriggerStatements ["this", [""'scripts\kaboom.sq"",""BIS_fnc_execVM"",false] spawn BIS_fnc_MP;, ""];

(No guarantee this is syntax error free, I am having a migrane right now and might not be able to think straight enough)

This should run the script guaranteed on the server only.
Well, I tried that with fixing the typos but no-go...
Also modified as
Code:
_trg setTriggerStatements [[["this"], ["scripts\kaboom.sqf"],"BIS_fnc_execVM", false,] spawn BIS_fnc_MP;, ""];
But it says missing a "[" etc...
Maybe I should change the whole thing as addAction?
This one seems to be working:
Code:
_trg setTriggerStatements ["this", "[""scripts\kaboom.sqf"",""BIS_fnc_execVM"",false] spawn BIS_fnc_MP;", ""];

Argh, didn't see that message before. Yeah, there are quotes missing around the statement in your previous version, that's why it doesn't work.

Sorry for not replying.