BoweryBaker 0 Posted November 23, 2004 I'm trying to think of a way that if one of these radioes from these mods is fired off, since they are a weapon, that could somehow get an audio file to play. Â Scenario: Â Your team will be assigned a radio but we'll only be able to contact you as soon as you turn it on. Â We'll be waiting. Â Once your radio is activated we'll know its safe to transmit to you, so keep it off unless you're sure our transmission won't be picked up. Â Then when you turn it on, be somewhere safe from the enemy and put the transmission on for the whole team to hear. Â Is this possible? Â maybe [radioweaponname, radioman, audio file]exec "transmission.sqm" So what you get is, you're the radioman, you fire the radio weapon after choosing it, an audio file plays. How simple! Yes in this case thats a good thing. Talk to me scripters, is this possible? If so, please tell me, then release to ofpec. Share this post Link to post Share on other sites
theavonlady 2 Posted November 23, 2004 Maybe you could use the "FIRED" event handler, if the radio addon actually works as a fired weapon. Share this post Link to post Share on other sites
BoweryBaker 0 Posted November 23, 2004 It does! Thats a start. Thanks. Share this post Link to post Share on other sites
Locke@Germany 0 Posted November 23, 2004 Should be easy to realise. Also some (maybe all, don't know for sure) of the radios already got a soundeffect when fired. And "theavonlady" is right, use the fired-event. Share this post Link to post Share on other sites
BoweryBaker 0 Posted November 23, 2004 This should work: first name your radio man "radioman" then get the editor name of his radio. Then in the init field of the radioman type in: radioman AddEventHandler ["fired",{_this exec "onfiring.sqs"}] Â in the on activation field of the trigger put in: radioman say "nameofaudiofile" I just need the trigger to know that the script has been executed. Â Like condition: Â "onfiring.sqs" or something like that. Â I just don't know where to put the returned value of if the weapon is fired. The research continues... Share this post Link to post Share on other sites
Wadmann 0 Posted November 23, 2004 A quote from Igor Drukov's EH guide: Quote[/b] ]Here are the returned values of the most famous EH, "fired", which can be added to either vehicles or men :_this select 0 : who fired ; _this select 1 : with what weapon ; _this select 2 : with what muzzle (your M16, or M203 ?) _this select 3 : mode ? (either single, or burst, or auto) _this select 4 : the type of ammo used. Technically, what does it mean ? That if you type : joe AddEventHandler ["fired",{_this exec "onfiring.sqs"}] you can start your "onfiring" script with : _man=_this select 0 _ammo=_this select 4, the script will have recognized these values. You may find the complete tute here. Â I hope that this gets you going in the right direction as you idea sounds great (pun intended)! Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Wadmann EDIT: Oh, I see want you are looking for. You could then try: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_man = this select 0 _weap = this select 1 ?_weap = correctradioname goto #message #message _man say "yourmessage" ;or even [_man] exec "radiomessage.sqs" I am not a scripter and this was put together at work so check all syntax but you should get the idea. You would also need something to point to #end if weapon was not the radio. Hopefully a real scripter will come along and help you out proper. Maybe try this in scripting and editing or even over at OFPEC. Share this post Link to post Share on other sites
BoweryBaker 0 Posted November 23, 2004 I tried this as my onfiring.sqs file: radioman = this select 0 SJB_TOS_Satcom = this select 1 ?SJB_TOS_Satcom = SJB_TOS_Satcom goto #message #message radioman say "evac" Nothing worked. So I figured I'd change the init from: radioman AddEventHandler ["fired",{_this exec "onfiring.sqs" "}] to: radioman AddEventHandler ["empty",{_this exec "onfiring.sqs"}] still nothing happened. I still got that generic static noise. i'm thinking of going into the binarized tos seals deal, looking at the scripting to the weapon and seeing what makes the static noise, thats the answer right there. Share this post Link to post Share on other sites
RED 0 Posted November 23, 2004 Try this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _radioman = _this select 0 _radio= _this select 1 ?_radio == "SJB_TOS_Satcom": goto "message" exit #message _radioman say "evac" RED Share this post Link to post Share on other sites
BoweryBaker 0 Posted November 23, 2004 Thanks for clearing that up Red. Â I think the problem is in the event handler. Â is dryfire an event handler? Â the satcom doesn't necessarily fire. Â Its a dryfire that makes the static noise happen and it doesn't have ammo. Â So is there a dryfire event handler? I'm looking at the name of the ammo for the satcom and it says displayNameMagazine="SatCom Battery"; shortNameMagazine="Battery"; I don't want this thing to fire off a missile though....thats why I'm hoping I can get a sound to play from dryfire alone. Where can I get an eventhandlers list? Share this post Link to post Share on other sites
RED 0 Posted November 23, 2004 Yes you are correct, if a weapon doesn't have ammo it won't fire. Unfortunately there is no such eventhandler that will help you get around this. RED Share this post Link to post Share on other sites
BoweryBaker 0 Posted November 23, 2004 So I guess I'll load up the battery and see what happpens... Share this post Link to post Share on other sites
RED 0 Posted November 23, 2004 The only eventhandlers are: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> "Killed" object:killer   "Hit" object:causedBy,scalar:howMuch   "Engine" bool:engineState     "GetIn" string:position (1),object:unit   "GetOut" string:position (1),object:unit     "Fired" string:weapon,string:muzzle,string:mode,string:ammo   "IncomingMissile" string:ammo,object:whoFired   "Dammaged" string:selectionName,scalar:howMuch   "Gear" bool:gearState   "Fuel" bool:fuelState Taken from the command ref. RED Share this post Link to post Share on other sites
BoweryBaker 0 Posted November 23, 2004 class SJB_TOS_Satcom: LAWLauncher { scopeWeapon=2; scopeMagazine=2; nameSound="weapon" model="\SJB_TOSM4\SJB_Satcom.p3d"; modelOptics=""; picture="\SJB_TOSM4\inventory\w_satcom.paa" sound[]={"\BAS_Weap\satcom\mic_out1.wav",20,1}; reloadSound[]={"\SJB_TOSM4\sound\mic_out1.wav",20,1}; drySound[]={"\SJB_TOSM4\sound\loop.wav",20,1}; weaponType=WeaponSlotSecondary; magazineType=WeaponNoSlot; ammo="SJB_TOS_Satcom"; displayName="SatCom AN/PSC-5D"; displayNameMagazine="SatCom Battery"; shortNameMagazine="Battery"; reloadTime=1.0; canLock=1; valueWeapon=20; optics=0; forceOptics=0; count=100; primary=0; uiPicture="\SJB_TOSM4\satcom\icon_rto.paa"; canDrop=1; }; that is from the cpp of the satcom. as you can see it has no magazines entry, therefore it cannot be fired, therefore i cannot trigger a sound file to play for if this weapon is fired. It would seem. Share this post Link to post Share on other sites
BoweryBaker 0 Posted November 23, 2004 There was this one time I tried it, and I didn't get a sound at all, no static no nothing. I think i got close that time. Share this post Link to post Share on other sites
RED 0 Posted November 23, 2004 There are two ways I can think of to get this working, but both require that you make a new radio addon (or atleast change the config slightly) 1. Just change the dry sound to something else, but that will only allow one sound so will probably not be what you are looking for. 2. Make it use a magazine, detect that it has been fired, then add a magazine each time it does. RED Share this post Link to post Share on other sites
General Barron 0 Posted November 23, 2004 Shouldn't this be in the ME&S board? Anyway, you could get the same end result just the same by using either an action, or a radio trigger. That way, there is no need to make a new addon. Is there any particular reason why this stuff has to be initiated from the left mouse button? Share this post Link to post Share on other sites
BoweryBaker 0 Posted November 23, 2004 Yes. To make you remember your job if you're the radioman amidst confusion. Share this post Link to post Share on other sites
General Barron 0 Posted November 23, 2004 Yes. Â To make you remember your job if you're the radioman amidst confusion. I'm not following you. How would using an action instead of "firing" the radio be different? Share this post Link to post Share on other sites
Jackal326 1181 Posted November 24, 2004 No-one likes a huge action menu, makes performing urgent actions take more time than you have in most cases (e.g. "Wear Beret", "Wear Helmet", "Trigger Radio", "Swat fly", "Break wind", "Reload M4A1 Magazine" etc - not only looks unsightly, but hinders gameplay). BoweryBaker, I know we spoke on MSN about this yesterday, and just to remind you, making a new addon would definately be the easiest way, add a magazine (and the ammo type - if I'm not mistake its the ammo/bullet fired that is detected by the "fired" eventhandler, not the magazine), and then go from there. Also, you're free to modify the config.cpp of my SATCOM in your new addon (please don't alter the existing config as that'll cause conflicts), the model how-ever you'll need to gain the permission of the BAS Team (Deadmeat, Tigershark etc). Share this post Link to post Share on other sites
BoweryBaker 0 Posted November 25, 2004 I know this isn't going to make any difference, but you usually got to pick up the phone before the talking commences. That's why I wanted it that way. Mods feel free to close the thread. This is impossible. Share this post Link to post Share on other sites
Jackal326 1181 Posted November 30, 2004 Its not impossible if you simply make your own radio addon (feel free to use my config coding as a base, but you'll have to ask Deadmeat's/BAS' permission for the model), and give it a magazine (and ammo, then you can use the "fired" event-handler. As the addon will only be about 800kb max. it can easily be distributed with your mission/campaign. Share this post Link to post Share on other sites