nominesine 0 Posted April 12, 2006 I have a Radio Alpha trigger that behaves mysteriously in Multi Player. This is what it is supposed to do: 1) If the variable radioOnline is false it should play one sound (a distorted radio static sound) 2) If radioOnline is true it should play another (the actual radio message) It's set up like this (ad hoc syntax): <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> Condition: this On Activation: if (radioOnline) then {unitName sideRadio "soundFile"} else {unitName sideRadio "staticSound"} Never mind the syntax, I wrote that from memory, and the actual trigger works in the editor. But when I export the mission to MP-missions it doesn't. There is no sound what so ever, and if I include a hint for testing purposes in the syntax, it doesn't show either. Can anyone shed some light on this problem? Is there any known MP problems connected with if-then-else statements? Share this post Link to post Share on other sites
hardrock 1 Posted April 12, 2006 Is the variable radioOnline globally initialized with 'false' or 'true' ? Share this post Link to post Share on other sites
nominesine 0 Posted April 12, 2006 Is the variable radioOnline globally initialized with 'false' or 'true' ? From the init.sqs: radioOnline = false; publicVariable "radioOnline" Do I need to do more? Share this post Link to post Share on other sites
Artak 0 Posted April 12, 2006 Instead of sideradion try the 'say' command. Failing that try explaining what you got a bit further. Share this post Link to post Share on other sites
nominesine 0 Posted April 12, 2006 Instead of sideradion try the 'say' command. Failing that try explaining what you got a bit further. Will try that and report back ASAP. But since the test hint didn't work either I suspect there's something that prevents my if-then-else command from executing. I use an almost identical trigger in another mission, but then it's only an if-then command. And it works in perfectly in MP (there is no radio static if the radio is off line in that one). The simpler if-then technique could of course be used in a chain of triggers, that makes each other fire to produce a static representing a no response. But that's way to unsexy and noobish for my taste. I want a neat and attractive code snippet in a single trigger. Share this post Link to post Share on other sites
Trapper 0 Posted April 12, 2006 But when I export the mission to MP-missions it doesn't. Btw, did you remember that mission editor "exporting" is possible only once per OFP session? All following exports won't overwrite the first export. Share this post Link to post Share on other sites
mr.peanut 1 Posted April 12, 2006 Are you certain the trigger is firing on all clients? What is your trigger condition? From your description it sounds like the trigger is only firing on the (dedicated) server. Share this post Link to post Share on other sites
crashdome 3 Posted April 12, 2006 Not sure if you know this, but publicvariable is like a 'broadcast'. It isn't enough to just say <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">publicvariable "MyVar" and expect it to sync automatically. Every time you change the value of a variable, you must then call 'publicVariable' again to broadcast it to other players. Share this post Link to post Share on other sites
nominesine 0 Posted April 13, 2006 It's not a desync problem. The variable is changed from a trigger, and I was testing the mission alone (acting as server and player on one machine). The problem is not that trigger fires on one machine. The problem is that it doesn't fire at all in MP, but it works in the editor. EDIT: One thing struck me... there is no game logic named "server" placed on the map yet. Could this affect the situation? Does the server game logic have any function besides enabling server side loops??? Share this post Link to post Share on other sites
crashdome 3 Posted April 13, 2006 the server game logic was and always will be simply a standard way to check if a specfic client was actually the server. It's like a community standard since somebody discovered it. It could just as easily be a logic named "Dorothy" or an AI unit named "Jeff" but logics work the best and naming it "server" makes code look better. So, NO, it doesn't do anything else Share this post Link to post Share on other sites
mr.peanut 1 Posted April 13, 2006 It's not a desync problem. The variable is changed from a trigger, and I was testing the mission alone (acting as server and player on one machine). The problem is not that trigger fires on one machine. The problem is that it doesn't fire at all in MP, but it works in the editor.EDIT: One thing struck me... there is no game logic named "server" placed on the map yet. Could this affect the situation? Does the server game logic have any function besides enabling server side loops??? This is exactly my point. If the trigger fires on the server only, you will hear nothing. Share this post Link to post Share on other sites
nominesine 0 Posted April 13, 2006 Okay, but Im testing it in MP with one player only = me. That is I act as the server as well as the only client in the game. And it works if I remove the "else" part of the commnd. So I still suspect that there is a problem with if-then-else commands and MP. Share this post Link to post Share on other sites
mr.peanut 1 Posted April 13, 2006 Very weird. Guess you'll have to break it into two if-then statements instead (edit: or two triggers). Gotta love the kludge... Share this post Link to post Share on other sites
nominesine 0 Posted April 13, 2006 Very weird. Guess you'll have to break it into two if-then statements instead (edit: or two triggers). Gotta love the kludge... Thank's. Thats what I did, finally. Share this post Link to post Share on other sites