Jump to content
Sign in to follow this  
scajolly

ERROR: if (triggeractivated trigger1) then {

Recommended Posts

The line "if (triggeractivated trigger1) then {" does not seem to yield a true value.

Nor does ...{triggeractivated trigger1}...

Can anyone help me?

|#|if

type code, expected Bool

The entire sqf is

hint "out";

sleep 3;

if (true) then {

hint "in1";

"smarker" setMarkerPos (getMarkerPos "obj1");

"flag" setMarkerPos (getMarkerPos "obj1");

sleep 3;

if (triggeractivated trigger1) then {

hint "in2";

"smarker" setMarkerPos (getMarkerPos "obj2");

"flag" setMarkerPos (getMarkerPos "obj2");

};

};

Right now, trigger1 is OPFOR present. It does NOT activate on init of the mission, but waits for opfor to enter it. Meaning it activates AFTER the script has been called. I've no idea if this is what is hindering my mission.

Edited by SCAJolly

Share this post


Link to post
Share on other sites

Hi...If I understand you correctly maybe you can try it this way :-

hint "out";
sleep 3;

waituntil {triggeractivated trigger1};

hint "in1";
"smarker" setMarkerPos (getMarkerPos "obj1");
"flag" setMarkerPos (getMarkerPos "obj1");

waituntil {triggeractivated trigger2};

hint "in2";
"smarker" setMarkerPos (getMarkerPos "obj2");
"flag" setMarkerPos (getMarkerPos "obj2");

Share this post


Link to post
Share on other sites

It works! Thank you!

I had put waitUntil {...} THEN {, which returned an IF error.

God I hate scripting.

This is why. The script is as follows,

_sMarker = _this select 0;

_sObj1 = _this select 1;

_sObj2 = _this select 2;

_sTrig = _this select 3;

if (true) then {

_sMarker setMarkerPos getMarkerPos _sObj1;

waitUntil {triggeractivated _sTrig};

_sMarker setMarkerPos getMarkerPos _sObj2;

};

I get an error saying

"waitUntil {|#|triggeractivated _sTrig};"

error Triggeractivated: Type string, expected Object

Edited by SCAJolly

Share this post


Link to post
Share on other sites

What does it say if you output this:

hint format ["%1",_sTrig];

before the if (true) ... (which I hope is only a placeholder :))

I have a hunch it will say "any". Which means the trigger isn't actually passed to the script. The keyword this doesn't exist for triggers, only thislist. Means you have to name the trigger and send in the triggers name.

Share this post


Link to post
Share on other sites

Or he might be doing

[...,"myTrig"] execvm...

Instead of [...,myTrig]

Share this post


Link to post
Share on other sites
Or he might be doing

[...,"myTrig"] execvm...

Instead of [...,myTrig]

That's exactly it.

These are the nuances I can't find explained on the biki. :) Thank you for your help!

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  

×