Jump to content
Sign in to follow this  
natanbrody

ArmA 3 Beta Editor - Help - Radio's Activated By Trigger

Recommended Posts

Hey Again Guy's

I want to know this time how can I make this scenario:

I am with my squad we have just destroyed a weapons crate therefor succeeding the task. Now we are confused as to what we should do. Then out of nowhere HQ comes on the radio and says that we did a great job and that our next objective is to raid a building in Agia Marina. Then the new task pops up on the screen and we must complete it.

I know I am aiming high with this scenario, If anyone has any idea on how to do it please tell me. :D

Thanks In Advance

Natan Brody :D

Share this post


Link to post
Share on other sites

I meant actually getting HQ to call us on the radio and being able to hear them speaking to us like in some of the showcases...

Share this post


Link to post
Share on other sites

Ahh ok, here's a possibly complicated demo for that kind of thing: darkstarDemo.stratis

There's a few things at work here. On the map will be three units. The player, a riflename named Airboss and a riflename named Darkstar. There is also a GameLogic.

Airboss will be given the GroupID of "Airboss" so that his text will appear to come from someone named AirBoss rather than the default unit name. We do this by this command:

airboss init field:

group this setGroupID ["AirBoss"];

We do the same for Darkstar.

The Gamelogic will play the role of HQ or "Crossroads". We enable that via:

Gamelogic init field:

PAPABEAR=[West,"HQ"];

Then we can initiate communications from "CROSSROADS" using "PAPABEAR" as the object.

We'll have two sound files in this demo. The first is a quick "standby" message we'll play when Papabear talks. The second will be a radio conversation between Airboss and Darkstar. We'll declare these in our description.ext:

description.ext:

overviewText = "Player Communication Demo.";
author = "kylania";
onLoadName = "Darkstar Demo"; 

class CfgSounds
{
// List of sounds (.ogg files without the .ogg extension)
sounds[] = {blue10};

// Definition for each sound
class blue10
{
	name = "blue10";
	sound[] = {\sound\blue10_strike_prime.ogg, db + 10, 1.0};
	titles[] = {0, $STR_BLUE10_SUBTITLE};
};

};

class CfgRadio
{
// List of sounds (.ogg files without the .ogg extension)
sounds[] = {standby};

// Definition for each sound
class ex_cfgradio
{
	name = "ex_cfgradio"; // Name for mission editor
	sound[] = {\sound\standby.ogg, db + 0, 1.0};
	title = $STR_CFGRADIO_SUBTITLE; // Text for radio message
};

};

All the text we'll keep in the stringtable.xml so that you can edit it all without checking all your files.

stringtable.xml:

<?xml version="1.0" encoding="utf-8" ?>
<Project name="Darkstar Demo by kylania">
 <Package name="DarkstarDemo">

   <Container name="InitialHint">
     <Key ID="STR_PAPABEAR_HINT">
       <English>Use Radio Alpha (0-0-1) to play the sound recording.</English>
     </Key>
   </Container>

   <Container name="DescriptionExtText">
     <Key ID="STR_CFGRADIO_SUBTITLE">
       <English>This text is in lower case because it's in the CfgRadio part of description.ext</English>
     </Key>

     <Key ID="STR_BLUE10_SUBTITLE">
       <English>This is a subtitle from the description.ext cfgSound title</English>
     </Key>
   </Container>

   <Container name="AirbossConvo">
     <Key ID="STR_AIRBOSS_1">
       <English>Darkstar - Weasel 21 flies second in strike param.</English>
     </Key>

     <Key ID="STR_DARKSTAR_1">
       <English>Say again last for Darkstar.</English>
     </Key>

     <Key ID="STR_AIRBOSS_2">
       <English>Weasel 21 flight is up for Blue 10.</English>
     </Key>
   </Container>
 </Package>
</Project>

Then the actual execution of the sounds. In init.sqf we'll have Papabear say his hint about using the radio and we'll have airboss use the cfgRadio to play the sound and display the text from there.

init.sqf:

airboss globalRadio "ex_cfgRadio"; // plays the standby soundfile and displays some text.
papabear sideChat localize "STR_PAPABEAR_HINT";  // Shows comms coming from "Crossroads".

Then we have a single trigger to run radio.sqf which is where we have the actual conversation:

radio.sqf:

airboss say "blue10";  // plays the sound file.
airboss sideChat localize "STR_AIRBOSS_1";  // Types the text to sidechat
sleep 3.2; // These values were found via trial and error to get it to display correctly timed.
darkstar sideChat localize "STR_DARKSTAR_1";
sleep 1.45;
airboss sideChat localize "STR_AIRBOSS_2";

Share this post


Link to post
Share on other sites

Thanks Man!! Just what I wanted :D. Very Detailed Description!! Thanks!

---------- Post added at 17:54 ---------- Previous post was at 16:10 ----------

Is there a possiblity you could make write the message again with a blank set of codes. Since it's very confusing now I have tried to do it!!! :D

---------- Post added at 17:56 ---------- Previous post was at 17:54 ----------

I mean explain it again but in a way that beginners understand such as myself

Share this post


Link to post
Share on other sites
I mean explain it again but in a way that beginners understand such as myself

Yes please, I would like this too. I am attempting to change it to my own liking, but not without difficulty...

perhaps if I figure it out, I will post it myself.

Ave,

the_Demongod

Edit: I've figured this all out, for anybody who's interested. I'll try to post it next afternoon.

Edited by the_Demongod

Share this post


Link to post
Share on other sites

All this wonderful scripting was done by kylania, so giant thanks and credits to him. I just deleted the parts I didn't need and tried to thin it out to make customizing it as straightforward as possible. If what I've described doesn't work for you, you can always do what I did and download kylania's darkstarDemo.stratis mission above and just delete parts of the script and see what happens in the editor. If it does work and you are as thrilled as I was when it did, thank him, not me.

This is rather complex, but I'll try to make it as simple as possible:

1. you will need your sound file. mine was just a simple 4 line conversation between the player and an npc.

2. in the editor, place two units. the way I did it, one of them is the player.

3. save the mission, and create 3 files in the mission folder: stringtable.xml, description.ext, and radio.sqf.

lets start with description. the only thing we do here is to define our sound file, and allow arma to use it in the mission.

class CfgSounds
{
// List of sounds (.ogg files without the .ogg extension)
sounds[] = {radio1};

// Definition for each sound
class radio1
{
	name = "radio1";
	sound[] = {\sound\yourfilename.ogg, db + 10, 1.0};
	titles[] = {0, $STR_RADIO1_SUBTITLE};
};

}; 

Paste that into your description.ext. radio1 can be whatever you'd like to call your sound. make sure you've changed yourfilename into whatever your .ogg file is. the db + 10 is your control over the volume, 1.0 is pitch.

As a first test, go into the editor, place a trigger, go to "effects" and see if you can find your sound (I believe it's under "anonymous"). If you can play the sound with the trigger, everything so far has worked fine.

Next we'll move on to the stringtable.xml

from what I can tell, this acts like a library of data, and can be called by the scripts to keep everything from getting cluttered.

paste this:

<Project name="yourmissionname">
 <Package name="whateveryoulike">
   <Container name="reallydoesntmatter">
     <Key ID="STR_UNIT1_1">
       <English>unit 1's first line</English>
     </Key>

     <Key ID="STR_UNIT2_1">
       <English>unit 2's first line.</English>
     </Key>

     <Key ID="STR_UNIT1_2">
       <English>unit 1's second line</English>
     </Key>

  <Key ID="STR_UNIT2_2">
       <English>unit 2's second line</English>
     </Key>
   </Container>
 </Package>
</Project>

The project name, package name, and container name don't really seem to matter, they are just references, and they aren't used in this.

change UNIT1 into the name of your first unit. I'm not sure if it has to be in caps or not, might as well just do it.

do the same for UNIT2, make it the name of your second unit. The contents of these <key>s are what will eventually display in chat when the message sound is played. change the unit's lines into the contents of their conversation. if your conversation is longer, just add an extra

<Key ID="STR_UNIT_#">
<English>yourlinehere</English>
</Key>

change UNIT into whatever unit will say the line, and # is just the number of the line to make it unique. (ex. if it is the unit's 5th line, write "STR_UNIT_5")

So far we've finished the description.ext and the stringtable.xml. now we need to go to our 3rd file: radio.sqf.

radio.sqf is what we use to run our entire conversation. It basically tells the mission to play your sound file, and then which lines from the stringtable to play and when. It should look like this:

unit_p say "radio1";
unit1 sideChat localize "STR_UNIT1_1";
sleep #;
unit2 sideChat localize "STR_UNIT2_1";
sleep #;
unit1 sideChat localize "STR_UNIT1_2";
sleep #;
unit2 sideChat localize "STR_UNIT2_2";

This is rather simple: unit_p say "radio1"; is what tells the sound file to play in the mission. radio1 comes from "class radio1" in the description.ext, so change it to whatever you named your sound. my unit_p was the player. the only way I could get the sound to be heard was if the players name was unit_p. I don't know why that is. I had to add two more lines for the other two players in my mission for it to be heard by everybody. units 1 and 2 are where the sideChat message will come from.

next, you put your STR_UNIT_# lines in the order of the conversation. localize "STR_UNIT1_1"; just tells the mission to look in the stringtable.xml file and display the text found within the given address.

lastly, the #s will depend on your sound file. sleep # is the number of seconds to wait between each chat message. It takes a little toying around with these to get your sideChat messages to line up with your sound file.

Now go to your mission. make a trigger, have it activated by whatever you like. first I'd suggest just making it triggered by Radio Alpha so you can test it and make sure everything worked correctly. Finally, if you want to change the name displayed in the chat (by default it will be something bland like "Alpha 1-1:[text]"), put this line in your unit's Init line:

this setGroupID = ["UNITNAMEHERE"];

And the chat will display the message as coming from UNITNAMEHERE.

In the trigger onAct, put:

0 = [] execVM "radio.sqf";

This runs radio.sqf, which plays your sound file and runs the text you put in stringtable.xml. unfortunately this means that debugging any errors can take quite a while.

Tomorrow I'll try this out using only my instructions to see if I've left anything out, and follow up later. Post if you have any questions or I wasn't clear about something.

Ave,

the_Demongod

Edited by the_Demongod

Share this post


Link to post
Share on other sites

I am trying to make a longer mission, but am having issues with setting up 2 or more sounds, or transmissions. Can someone please take a look at this and give feedback/help. thanks :)

THE FOLLOWING CODE DOES NOT WORK, DO NOT COPY IT :)

overviewText = "The Angels of deah awaken.";
author = "TG UrBAn";
onLoadName = "Angels of Darkness"; 

class CfgSounds
{
// List of sounds (.ogg files without the .ogg extension)
sounds[] = {radio1 test2}; 

// Definition for each sound
class radio1
{
	name = "radio1";
	sound[] = {\sound\radio1.ogg, db + 18, 1.0};
	titles[] = {0, $STR_RADIO1_SUBTITLE};
};

class test2
{
	name = "test2";
	sound[] = {\sound\test2.ogg, db + 18, 1.0};
	titles[] = {0, $STR_TEST2_SUBTITLE};
};
};

Share this post


Link to post
Share on other sites

I wouldn't say im completely new to the editing side of arma but im really new with .SQF's, .EXT's and so on. iv been trying to do exactly what yall are trying to forever now, but i need step by step, like 1+1=2 kind of instructions if anyone is patient enough to help me do so? I put everything in the

libraries/documents/arma3/usersaved/missions/sss.stratis < thats just what i named it.

i put the sounds (file) with the two recordings

libraries/documents/arma3/usersaved/missions/sounds

and im getting (cannot find Radio.sqf) in game when i try to trip the trigger. What am i doing so terribly wrong?

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  

×