Doolittle 0 Posted July 14, 2007 clearRadio - Clean up the content of radio protocol history. What is this command for? If I wanted a radio activation (via trigger) to be local only, would I run this command right when the trigger was activated so that it was not "sent" to all other clients?? If that is the case then this is great! Now I won't have to do two triggers and a lot of publicVars just to make radio commands local only. Can anyone confirm this?? Make Radio Alpha trigger .. repeating... Condition this OnActivation player sideChat "Moo"; clearRadio .... means only the player who actually clicked on the radio button will receive the Moo message, not everyone else on the server, right?? It's hard to test these things. Doolittle Share this post Link to post Share on other sites
5133p39 16 Posted July 14, 2007 I think this command only clears the screen of any already displayed radio messages in the bottom left corner. Share this post Link to post Share on other sites
Taurus 20 Posted July 14, 2007 (again a long post, some interesting findings below) I think this command only clears the screen of any already displayed radio messages in the bottom left corner. Yep. [edit inner] All players online will see "mooo" for a brief second, then it will be cleared out + all "OMG 4 is down!", "Injured CRY!", "Negative", "I'm stuck OMG LOOOLZZZ!" currently listed in the message box. [/edit inner] If you want to clear the radio alpha and etc you need to use: http://community.bistudio.com/wiki/setRadioMsg However, you can not "setRadioMsg" if you do not have any radio messages to begin with,i.e. if you don't see the radio in the mission to begin with you can not "spawn" radio Alpha run-time. using: 1 setRadioMsg "null" (or null, can't remember what clears it) You will end up with a radio with no messages. Unfortunatly as there are no known ways of getting the text which is displayed in the radio, or the player who activate it. I really miss a command "playersInGame" who will return an array of the players currently playing. Maybe it would work if you assign a variable to each playable unit Unit1 Unit2 and etc. then check if local player and <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">switch(player) do{ case Unit1:{ //use radio alpha for unit1 }; case Unit2: { //use radio alpha for unit2 }; }; (or something similar) Now I dunno what will happen if player i.e. Unit1 dies, but thats a respawning issue and you know more about assigning variables to dead units than I do Doolittle so you'll figure it out me thinks. [edit] Tested it, and not very surprisingly it used the radio on both clients but the message was different on both. So maybe creating two trigger alphas with Alpha(1): Cond: this and (player == unit1) onAct: do stuff Alpha(2): Cond: this and (player == unit2) onAct: do stuff Too tired right now to test this, its late or "rather early" here now... 4:30 AM... [edit2] Ok, I tested the above thing of using two radio Alphas and putting that into the condition. When using the radio it triggered on both clients. I'm having this in my init nil = [] execVM "setRadio.sqf"; setRadio.sqf: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">switch(player) do{ case unitSold001:{ 6 setRadioMsg format ["%1",name player]; while{true} do{ waitUntil{ sleep 1; (NOT(alive player)) }; player groupChat "I died CRY!!"; waitUntil{ sleep 1; (alive player) }; unitSold001 = player; sleep 1; }; }; case unitSold002:{ 6 setRadioMsg format ["%1",name player]; while{true} do{ waitUntil{ sleep 1; (NOT(alive player)) }; player groupChat "I died CRY!!"; waitUntil{ sleep 1; (alive player) }; unitSold002 = player; sleep 1; }; }; }; This set the radio message to the names of the players. i.e. player1 would see MyName1 player2 would see MyName2 Now, if you put one radio alpha for player1 to use. And one radio bravo for player2, with conditions as above, and clearing those(for both radios) on init, and then resetting: 1 setRadioMsg format ["%1",name player]; 2 setRadioMsg format ["%1",name player]; in the switch. Player1 would see: MyName1 [empty slot] Player2 would see: [empty slot] MyName2 And in their "action menu -radio" Player1 1 MyName1 Player2 2 MyName1 Just tested this and it works. Player1 uses his radio and it displays "MyName1" Player2 doesn't see anything. Player2 uses his radio "MyName2" Player1 doesn't see anything. However, with this you could only have 10 radio calls for 10 players. As far as I see it this is the only way we could do it to get "local" radio? [edit3] Just found out that reassigning the Unit1 variable to the player and globalVariable that wont work, the server will think "unit null" but as this is done client-side it will not be a problem maybe. (using v.1.05 atm, upgrading 927 MB worth of 1.08 now) Share this post Link to post Share on other sites