Jump to content
Sign in to follow this  
froggyluv

Delaying the Radio Call

Recommended Posts

How do you disable a radiotrigger ie. Radio Alpha, until another unit is in his set position. I'm trying to give the player access to the call only after a sniper is in a set position but when i place the radio trigger over the waiting position and add "sniper in this list" it actually ctd's. Without it, the player has access to the radio command right off the bat which could throw the whole mission off. Sniper is the name of the unit before anyone asks :D

Share this post


Link to post
Share on other sites

You need two triggers, one for the radio and the other for the checking of the sniper. Name the second trigger "sniper_trigger" and type the following in the radio trigger, in the condition line :

this and (sniper in sniper_trigger list)

Share this post


Link to post
Share on other sites

Interesting, but I get an error that I'm missing an ')' right before the 'list'.

Share this post


Link to post
Share on other sites

Radio triggers with conditions more than "this" crash the client, saw that in another post. :)

You could just create the Radio trigger on the fly once conditions are correct as well.

Share this post


Link to post
Share on other sites

Sorry, but could you walk me thru that a little - that is creating another trigger on the fly?

Share this post


Link to post
Share on other sites
Interesting, but I get an error that I'm missing an ')' right before the 'list'.

Yep i made an inversion :

this and (sniper in list sniper_trigger)

Share this post


Link to post
Share on other sites

That still freezes up the game if I test it and try to call the radio early.

I did as you said, gave the Sniper now named "alpha", his waypoint rigger named 'sniper_trigger'. The radio trigger which is global I gave the condition:

this and (alpha in list sniper_trigger)

and this trigger is also a switch as the radio is telling Alpha to proceed but alas, it freezes the game if called early.

---------- Post added at 07:10 PM ---------- Previous post was at 06:55 PM ----------

Edit- it works fine if Alpha is actually within his waypoint trigger but crashes if he is not :confused:

Share this post


Link to post
Share on other sites

So as kylania said, there's a bug with the radio triggers condition line... you must then create a radio trigger when the first trigger is activated. It's not that hard. Just some "createtrigger" then "settriggeractivation".

Share this post


Link to post
Share on other sites
Sorry, but could you walk me thru that a little - that is creating another trigger on the fly?

There's a few ways of doing this, but here's one.

First make a trigger that will enable the radio. Mine has an OnAct of:

nul = [] execVM "addRadio.sqf";

That calls the addRadio.sqf as shown below:

[color="SeaGreen"]// Create a radio trigger ALPHA, not repeatable called "Activate Radio"[/color]
_radio = createTrigger ["EmptyDetector", [0,0,0]];
_radio setTriggerArea [0, 0, 0, true];
_radio setTriggerActivation ["ALPHA", "PRESENT", false]; [color="SeaGreen"]// set to true if repeating.[/color]
_radio setTriggerText "Activate Radio"; [color="SeaGreen"]// title for the radio option.[/color]
_radio setTriggerStatements ["this", "nul = [] execVM ""myRadioAction.sqf""", ""];

[color="SeaGreen"]// Let the player know the radio is now available.[/color]
hint "Radio option available!";

That will create a Alpha Radio trigger in the middle of nowhere which is displayed as "Activate Radio" and when triggered will run whatever script you want, in this case one called myRadioAction.sqf as shown below:

hint "You've activated your radio!";

So, one pre-placed trigger to open the Radio option. One script called by that pre-placed trigger to create a radio one on the fly, and a second script to do whatever the radio is supposed to.

Share this post


Link to post
Share on other sites

Thanks Kylania. I can sorta of follow and your script does work but I don't know how to simply tell 'Alpha' to switch to it's next waypoint thru scripting. I've been depending on those 'switch' triggers too long I guess.

Is there no easier way then to write a waypoint script in your "Myradioaction.sqf"?

Share this post


Link to post
Share on other sites

The ALPHA in the above example is a code word for "Radio Alpha", not a unit name or anything.

I'm a little confused about what you mean by 'switch to it's next waypoint'.

How exactly is this radio option supposed to work in your mission? Ignoring coding, what do you expect to happen or be available to the player?

Share this post


Link to post
Share on other sites

Ok, I've got a Sniper named Alpha, who treks off at the beginning of the mission to establish his sniping position. The player and his team our off to run other errands for a while, but once the PC is ready, he is to radio his Sniper that it's time to get moving. The Sniper was held in a 'Hold' waypoint and the PC has the 'Radio Alpha' command which is a switch trigger attached to the sniper's (also named Alpha, probably bad idea)Hold waypoint. Once called in, the Sniper will then proceed to engage + meet up with player.

So basically I was using the Radio Alpha call to release the sniper from his Hold command. the only problem with that, was that the radio is offered from the start so an unwary player might call him too early.

Share this post


Link to post
Share on other sites

Ok, that's even easier, just need the first script.

Go ahead and setup your waypoint and the HOLD waypoint and put a SWITCH trigger synched to the HOLD waypoint with condition of:

gocode

Setup some trigger that determines when the errands the player is doing is finished, have that call the following script:

_radio = createTrigger ["EmptyDetector", [0,0,0]];
_radio setTriggerArea [0, 0, 0, true];
_radio setTriggerActivation ["ALPHA", "PRESENT", false]; // set to true if repeating.
_radio setTriggerText "Call in sniper"; // title for the radio option.
_radio setTriggerStatements ["this", "gocode = true;", ""];

That will create a radio option that will release the sniper from his HOLD waypoint.

Share this post


Link to post
Share on other sites

Ahhh, thanks that seems to have done it, at least in testing phase :)

I guess I tried something similar as using a variable ie, Gocode = true, in the editor rather than scripts but it just didn't seem to work. Guess thats why it pays to learn scripting.

Thanks again!

Share this post


Link to post
Share on other sites

Hi Kylania,

I am trying to do something like this in ARMA 2:

- I have a DIALOG with a SPY and, only after this DIALOG and IF this DIALOG Happens (this routine is ready and working with a GAME LOGIC Object and Waypoints for the DIALOG - OFPEC BASIC TUTORIAL DIALOG) I want a RADIO CALL CHARLIE to appears in the RADIO to MOVE SABOTEURS to a CITY.

I can MOVE the SABOTEURS with a RADIO Trigger AND Synchronizing it, but the point is: I don't want this RADIO SIGN ON if something Happened wit the SPY, or the PLAYER did not TALK to the SPY to know about that.

Understood ?

I think it's something near what you told us above. But I don't know where to put this code or how make this work.

Thanks for now !

Share this post


Link to post
Share on other sites

You can "disable" a radio option via this command:

3 setRadioMsg "NULL"

So in the init.sqf you'd use the above code to turn off Radio Charlie then during your dialog you'd turn it back on via:

3 setRadioMsg "Move Saboteurs to the City"

Share this post


Link to post
Share on other sites

Thanks a LOT Kylania, it worked Very well.

I simply put the first line to the INIT CODE in the PLAYER:

3 setRadioMsg "NULL"

And them put the second in the LAST DIALOG with the SPY Waypoint -> On Act BOX.

3 setRadioMsg "Move Saboteurs to the City"

But, just only to know how, if I want to use the createTrigger command how can I proceed to do that ? Using the SWITCH, GOCODE and the way that you describe above ? Where can I put that CODES ?

Edited by chicao77

Share this post


Link to post
Share on other sites

I got a demo mission at home which shows how to add a trigger from another trigger, I'll post that tonight.

Share this post


Link to post
Share on other sites
I got a demo mission at home which shows how to add a trigger from another trigger, I'll post that tonight.

Hy Kilania !

Can you POST your mission for us ? Thanks a LOT !

Share this post


Link to post
Share on other sites

Here it is! Sorry for the delay. Radio Alpha and Bravo work from the start. Blow up the car with your SMAW to enable Radio Charlie.

Demo mission

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  

×