Jump to content
Sign in to follow this  
CombatComm

createtrigger not working :my script included:

Recommended Posts

Hey guys, so I have a trigger. condition is !alive test. Test being some russian guy just for, well testing purposes. On activation

null=execVM "casav.sqf"

 casav=createTrigger["emptydetector",position player"]; 
casav setTriggerArea [0, 0, 0, true]; 
casav setTriggerActivation ["WEST", "Bravo", true]; 
casav setTriggerStatements ["this", "GroupA10 = CreateGroup West;  
A10CAS = createVehicle ["A10", [(getMarkerPos "A10Spawn") select 0,(getMarkerPos "A10Spawn")
select 1,100], [], 0, "FLY"];  A10Pilot = GroupA10 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
A10Pilot moveInDriver A10CAS;  wp1 = GroupA10 addWaypoint [(getpos player), 0];  wp1 setWaypointSpeed "NORMAL";
wp1 setWaypointType "SAD";=true"]; casav setTriggerText "A10 Close Air Support";

The radio bravo is not added to radio menu as it should be. I already tested the spawn part and thats fine. I just need the bravo added is all. What is the deal with my script guys? Thanks.

Edited by CombatComm

Share this post


Link to post
Share on other sites

Remove the * from [*code] so the tags can work. I know soneone told you to use tags and provided this example but he inserted the * only because otherwise you couldn't see the tags but tho final codeblock instead.

As i guess, you want to create a trigger which is radio activated by "RADIO BRAVO" (0-0-2), then the setTriggerActivation is incorrect:

casav setTriggerActivation ["BRAVO", "PRESENT", true];

Also check the comref

Share this post


Link to post
Share on other sites

Thanks brotha. but it didint work. Something else must be wrong in there. Empty detector? Or is that standard default trigger?

Share this post


Link to post
Share on other sites

casav=createTrigger["emptydetector",position player"];

remove that " behind player. And please remove those * on the [*code] tags.

Share this post


Link to post
Share on other sites

hahaha yah I saw that changed it and got it to work. Thanks again bro! CAS from the baddest bird around is now available.

---------- Post added at 11:19 PM ---------- Previous post was at 11:06 PM ----------

SOOOOOO yah, it actulley didnt work. lol I was a bit premature in my assumption the actual spawn code worked. When used in an editor placed trigger it works just fine HOWEVER, when used in this sqf file something is still amiss. It probably has to do with the settriggerstatement block. Do you guys see anything wrong there? Maybe I have to have everything involved in createtrigger? Including the settriggertimeout etc?

---------- Post added at 11:46 PM ---------- Previous post was at 11:19 PM ----------

Anything guys? I have been tinkering with it a bit but still nothing. So far this is the code I have.

 casav=createTrigger["emptydetector",position player]; 
casav setTriggerArea [0, 0, 0, true]; 
casav setTriggerActivation ["BRAVO", "PRESENT", true]; 
casav setTriggerStatements ["this", ""GroupA10 = CreateGroup West;  A10CAS = createVehicle ["A10", [(getMarkerPos "A10Spawn") select 0,(getMarkerPos "A10Spawn") select 1,100], [], 0, "FLY"];  A10Pilot = GroupA10 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];  A10Pilot moveInDriver A10CAS;  wp1 = GroupA10 addWaypoint [(getpos player), 0];  wp1 setWaypointSpeed "NORMAL";  wp1 setWaypointType "SAD";=true"]; casav setTriggerText "A10 Close Air Support";

Edited by CombatComm

Share this post


Link to post
Share on other sites

casav setTriggerStatements ["this", ""GroupA10.....

Could you please explain the double quotes before GroupA10?

:EDITH:

How about to put the whole group creating stuff into an own script and launcht the script from the created trigger instead? Just an idea.

Share this post


Link to post
Share on other sites

hmmm, perhaps that would work.

---------- Post added at 12:47 AM ---------- Previous post was at 12:38 AM ----------

casav=createTrigger["emptydetector",position player]; casav setTriggerActivation ["BRAVO", "PRESENT", true];  casav setTriggerText "A10 Close Air Support"; casav setTriggerStatements ["this", "null= ExecVM "10cas.sqf"]

Ok at this point its basic as it comes and there is no reason it shouldent work. And yet it dosent. I really think something is messed up with the triggerstatements field, ugh but what do I know. lol

---------- Post added at 12:49 AM ---------- Previous post was at 12:47 AM ----------

hmmm, maybe its the lack of ; at the end, leme try...

---------- Post added at 12:57 AM ---------- Previous post was at 12:49 AM ----------

Thats a big fat negative....

Share this post


Link to post
Share on other sites

["this", "null= ExecVM "10cas.sqf"]

There is a missing "

Try this:

["this", "null= [] execVM ""10cas.sqf""];"

Sometimes it needs those doublequotes to work.

Share this post


Link to post
Share on other sites

Wow, still nothing. This one is a doozy. I placed the same code u gave me above minus the extra " into a editor placed trigger just for troubleshooting and it worked, and since the bravo trigger coming up now works we can effectivly isolate the problem somwhere in the setriggerstatements for sure.

Share this post


Link to post
Share on other sites

So I finnaly figured it out. It ended up being this crazy format here

casav setTriggerStatements ["this", "execVM '10cas.sqf';];", ""];

Share this post


Link to post
Share on other sites

ok so now that thats done does anyone know where I should look to get the radio trigger to be avaialable again but ONLY after so many seconds? I think I did hear that radio triggers are much less configurable....

Share this post


Link to post
Share on other sites

CASAV = true;

_trig = createTrigger["emptydetector", position player];

_trig setTriggerArea [0, 0, 0, true];

_trig setTriggerActivation ["bravo", "present", true];

_trig setTriggerStatements ["this && CASAV", "execVM '10cas.sqf'; CASAV = false; nul = spawn {sleep 300; CASAV = true}", ""];

Share this post


Link to post
Share on other sites

Danm this is the most annoying thing I have done so far lol. Now with the new code input the game crashes str8 to desktop everytime. I dunno if its Arma or the script since is does happen sometimes with other radio activated triggers.

Share this post


Link to post
Share on other sites

If you have a variable in the trigger's condition the game will crash if the variable isn't true. So you have to check wether the variable is true in the executed script and not in the trigger.

if (CASAV) then {




// Your script goes in here






} else {
hint "No Air Support availabe at the moment!";
};

Share this post


Link to post
Share on other sites

Ok let me try this one out

---------- Post added at 09:27 AM ---------- Previous post was at 09:15 AM ----------

if (CASAV) then {




 CASAV = true;
_trig = createTrigger["emptydetector", position player];
_trig setTriggerArea [0, 0, 0, true];
_trig setTriggerActivation ["bravo", "present", true];
_trig setTriggerStatements ["this && CASAV", "execVM '10cas.sqf'; CASAV = false; nul = spawn {sleep 300; CASAV = true}", ""]; 






} else {
hint "No Air Support availabe at the moment!";
};

The script as is now. No radio optoion comes up now so the actual script is being nullified by the if (casac) part it seems. Unless however it takes 300 seconds for it to come up initial, which I dont think. It seems it executes, than waits "sleeps" for 300 seconds before becoming true again. So Im not sure whats going on.

Share this post


Link to post
Share on other sites

No, you got me wrong. Put the "10cas.sfq" in the if-then-else statement, not the creation of the trigger.

Make two scripts. The first creates the trigger but use as condition "this" only:

CASAV = true;
_trig = createTrigger["emptydetector", position player];
_trig setTriggerArea [0, 0, 0, true];
_trig setTriggerActivation ["bravo", "present", true];
_trig setTriggerStatements ["[b]this[/b]", "execVM '10cas.sqf'; CASAV = false; nul = spawn {sleep 300; CASAV = true}", ""];

And then make a second one. "10cas.sqf":

if (CASAV) then {




// Your script goes in here






} else {
hint "No Air Support availabe at the moment!";
};

Edited by IndeedPete

Share this post


Link to post
Share on other sites

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO....hahaha. Thats why. Copy that bro. I appreciate ya coming back and clearing that up.

Share this post


Link to post
Share on other sites

Alright bro so update on this as follows. Now it works wihtout crashing and bravo trigger comes up HOWEVER when I hit bravo it autoimatically comes up as "Air Support not avialble. So I dont even get to spawn the a10 and wait 300 seconds. Do u know whats up with that? Thanks

CASAV = true;
_trig = createTrigger["emptydetector", position player];
_trig setTriggerArea [0, 0, 0, true];
_trig setTriggerActivation ["bravo", "present", true];
_trig setTriggerStatements ["this", "execVM '10cas.sqf'; CASAV = false; nul = spawn {sleep 300; CASAV = true}", ""];

 if (CASAV) then {







	GroupA10 = CreateGroup West;  A10CAS = createVehicle ["A10", [(getMarkerPos "A10Spawn") select 0,(getMarkerPos "A10Spawn") select 1,100], [], 0, "FLY"];
A10Pilot = GroupA10 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
A10Pilot moveInDriver A10CAS;  wp1 = GroupA10 addWaypoint [(getpos player), 0];  wp1 setWaypointSpeed "NORMAL";  wp1 setWaypointType "SAD"; 





} else {
hint "No Air Support availabe at the moment!";
};

Edited by CombatComm

Share this post


Link to post
Share on other sites

Oh yeah, i see. The trigger sets casav to false but the script needs casav to be true. So everytime you hit the trigger the variable is set to false. Try to put the whole variable thing into the "10cas.sqf" itself.

if (CASAV) then {
CASAV = false;



// Your script goes in here





       CASAV = true;
} else {
hint "No Air Support availabe at the moment!";
};

Share this post


Link to post
Share on other sites

danmit it didnt work either. Same sitatuation comes about. I copy and pasted exactly what u put. lol ugh we are soo close. I can just hear that sexy freedom fart coming in for CAS.

Share this post


Link to post
Share on other sites

Trigger1

Condition: !alive test

On Act:trgBravo setTriggerActivation ["bravo", "present", true];

Trigger2

Activation: None

Name: trgBravo

Condition: this

On act: nul = 300 execvm "cas.sqf"

300 being the delay before it's available again.

cas.sqf

trgBravo setTriggerActivation ["none", "present", true];

if (isserver) then {
 GroupA10 = CreateGroup West;
 A10CAS = createVehicle ["A10", [(getMarkerPos "A10Spawn") select 0,(getMarkerPos "A10Spawn") select 1,100], [], 0, "FLY"];
 A10Pilot = GroupA10 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
 A10Pilot moveInDriver A10CAS;
 wp1 = GroupA10 addWaypoint [(getpos player), 0];
 wp1 setWaypointSpeed "NORMAL";
 wp1 setWaypointType "SAD"; 
};

sleep _this;
trgBravo setTriggerActivation ["bravo", "present", true];

More or less copy paste, I wouldn't use global variables unless I needed to refer to them elsewhere.

Using settriggeractivation, you can hide/show the radio trigger from anywhere (trigger, script etc) you want.

Edited by Shuko

Share this post


Link to post
Share on other sites

SHK, is this a new method completely or do Ikeep the scripts I have been working with. Cuz I out 2 treiggers and a scrupt named CAS into my mission folder and HOLY SHIT I wish I knew how to make video on ARMA. lol the funniest thing happens. The minute I hit preview they start spawnign and litterally within 1 minute their are 100s of A10s flying around!

Share this post


Link to post
Share on other sites

It's new, none of that true/false variable stuff. Everything you need is in that post.

Share this post


Link to post
Share on other sites

thats great man. Worked like a charm. Thats what I was looking for just a way to hide the trigger untill they earned it. Im not a fan of the createtrigger. Can be a bit rough. So I put another trigger in there with timeout set to 120 seconds. Since I dont want the player to have CAS forever. The condition

triggeractivated trgbravo

and on activation is

 deletevehicle a10cas; deletevehicle a10pilot

this has worked before just not with this kind of tirgger config. So does that deletevehicle have to be placed in cas.sqf to work? Say at the bottom of the spawning script put the timeout and deletevehicles there? Because as just a trigger set in the editor it dosent seem to delete the a10

---------- Post added at 12:56 PM ---------- Previous post was at 12:27 PM ----------

Awseome, so I got it to work using a public variable that checks if the script was ran. Thanks again to everyone that helped out!

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  

×