Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Question about multiplayer missions

  1. #1
    I'm creating a FDF WW2 co op mission on Suursaari island. This is the first multiplayer mission I have ever created. I do have a few questions though.

    ***I've added two airstrikes that you order with 0-0-1 and 0-0-2. Now in single player the player of course can only have access to the radio if he is a squad leader or alone. However my multiplayer mission has 4 seperate human controled squads. Who has access to the 0-0-1 and 0-0-2 radio commands? I mean there are four different squad leaders.

    ***Is there anything else that I should know about multiplayer missions that needs to be done differently from a single player mission?

    *Edit*
    ***I exported my mission to multiplayer and tested it out as the squad leader of each of the four teams. All four had access to the radio 0-0-1 and 0-0-2. I guess this isn't that much of a problem as long as the each command can still only be used once. I'm wondering, if say the player in squad one call's for 0-0-1 then the other three can't right? Or is it duplicated for all four squads? If that's the case my mission will be screwed up as 2 airstrikes per squad would unbalance the mission big time (that would be eight airstrikes).

    ***Still I am wondering, how could I set it for example so that only one of the four squads can call for the two airstrikes?

    ***A second idea I am toying with is giving one airstrike to team one and the other to team two, but no airstrikes for team 3 and 4 (they don't have radios)

    I hope I'm making sense.




  2. #2
    Quote Originally Posted by [b
    Quote[/b] ] Is there anything else that I should know about multiplayer missions that needs to be done differently from a single player mission?
    yeah... just about everything! (I jest)

    Seriously though... radio triggers execute on all clients... meaning if you have 8 players and a dedicated server (regardless of how many are leaders) and one person triggers the radio, it will run a script 9 times... once on each client/server.

    What you CAN do is use the trusty ol "?(!local server):exit" command to limit the script running once (on the server).

    [EDIT] To elaborate, the good news is that even though there are four leaders, the activation of one will remove it on all machines if the trigger is set to run only once. Radio triggers are no different than normal triggers... they just have different activation techniques.

    To give it to one leader only requires that you set the radio text (setRadioMsg) to null for all other players (i.e via init line or int.sqs). See comref.




  3. #3
    Master Gunnery Sergeant
    Join Date
    May 2 2003
    Posts
    1,360
    Author of the Thread
    Thanks for resonding CrashDome. A few more questions though...

    Quote Originally Posted by [b
    Quote[/b] ]Seriously though... radio triggers execute on all clients... meaning if you have 8 players and a dedicated server (regardless of how many are leaders) and one person triggers the radio, it will run a script 9 times... once on each client/server.
    ***Does this mean that if some one in my mission calls for air support that one plane will camcreate for every person playing plus the server? If so the way the airstrike script works in my mission there will be a massive explosion as 3 to 15 planes all spawn simultaneously in the same spot. If they don’t crash into each other then there will be a massive carpet bombing which will in effect kill any semblance of balance in my mission.

    Quote Originally Posted by [b
    Quote[/b] ]What you CAN do is use the trusty ol "?(!local server):exit" command to limit the script running once (on the server).
    ***So do I just place that line at the beginning of the airstrike.sqs script I'm using?

    Quote Originally Posted by [b
    Quote[/b] ]To give it to one leader only requires that you set the radio text (setRadioMsg) to null for all other players (i.e via init line or int.sqs). See comref.
    ***Could you elaborate on this one a little?

    ***Once again thanks for helping me. If you haven't noticed I'm a complete newbie when it comes to scripting and such (I didn't write the airstrike script I'm using, I simply modified it from an existing one I downloaded of OFPEC back in the day).

  4. #4
    Without knowing the way the script works I am assuming that once the trigger gets activated it WILL run once on each machine thus causing havoc.

    Yes, put that line:
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?&#40;&#33;local server&#41;&#58;exit[/QUOTE] in the beginning of the script AND place a game logic named "server" on the map.

    This will cause all clients to stop executing their scripts and only the server&#39;s will continue thus spawning only one aircraft.

    Regarding the setRadioMsg... see the comref for instructions, but I am pretty sure it is <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">1 setRadioMsg &#34;null&#34;[/QUOTE] and <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">2 setRadioMsg &#34;null&#34;[/QUOTE]

    What I would personally do is add a trigger and in the condition line replace it with :
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player &#33;= dude[/QUOTE] where "dude" is the name of the guy who gets the radio commands
    and put this in the activation line:
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">1 setRadioMsg &#34;null&#34;;2 setRadioMsg &#34;null&#34;;[/QUOTE]

  5. #5
    Master Gunnery Sergeant
    Join Date
    May 2 2003
    Posts
    1,360
    Author of the Thread
    I added the ?(&#33;local server):exit to the begining of each of my two airstrike scripts and also added a gamelogic named server on the map.

    1 setradiomsg "null" hides that radio message from every one though. As a matter of fact I have that in my mission already as both radio messages are "null" until all the Anti aircraft sites on the island are destroyed then they are set from "null" to "Airstrike 1" and "Airstrike 2" respectfully.

    I&#39;m thinking it&#39;s probably alright to just let the four squad leaders share the two airstrikes. They&#39;ll just have to bicker amongst them selves if of them uses one with out the other groups permission. I still am on the fence though, I still also think it would be nice to just let squad one have access to airstrike 1 and squad two have acces to airstike 2.

  6. #6
    Did you try hiding them like ?NOT(player==alpha01):1 setradiomsg "NULL"; in init.sqs or what? It works at least in single player, but it might be a global command though. Someone should make an updated command reference with all the locality info and such, that&#39;d be a lot of work though.

    If it is indeed a global command then I&#39;d use actions instead, addaction command is local, use it like ?player==alpha01:alpha01 addaction ["Airstrike 1","arty1.sqs"];

  7. #7
    Master Gunnery Sergeant
    Join Date
    May 2 2003
    Posts
    1,360
    Author of the Thread
    Quote Originally Posted by [b
    Quote[/b] ]Did you try hiding them like ?NOT(player==alpha01):1 setradiomsg "NULL"; in init.sqs or what?
    ***I just tried that but I have a trigger set up that has 1 setradiomsg "Airstrike 1";2 setradiomsg "Airstrike 2"; which is activated when all the antiaircraft guns are destroyed, prior to that both messages are "null"; Well when the airstrikes are set back from "null" to "Airstrike 1" and "Airstrike 2" every squad leader has access to them again.

    Quote Originally Posted by [b
    Quote[/b] ]If it is indeed a global command then I&#39;d use actions instead, addaction command is local, use it like ?player==alpha01:alpha01 addaction ["Airstrike 1","arty1.sqs"];
    ***I actually have contemplated that. I had trouble getting the script to activate that way though and it had unlimited use (the action remained in the action menu for reuse). However I could just add ***player==alpha01:alpha01 removeaction ["Airstrike 1","arty1.sqs"]; at the end of the airstrike scripts to make it a one time use correct?

    ***Here is the problem I have with adding the script as an action. The command to use the script is onMapSingleClick {[_pos] exec "airstrike.sqs"}; in the activation field of a trigger. I&#39;ve tried Eastman addaction ["Airstrike","onMapSingleClick {[_pos] exec "airstrike.sqs"};"]; But I get an error when the script is used that way.




  8. #8
    Quote Originally Posted by [b
    Quote[/b] ]Well when the airstrikes are set back from "null" to "Airstrike 1" and "Airstrike 2" every squad leader has access to them again.
    Add condition aagunsdead AND player==alpha01 to that trigger, and if there&#39;s a text message or something that should effect all, make a duplicate trigger for that without the player condition.
    Quote Originally Posted by [b
    Quote[/b] ] However I could just add player==alpha01:alpha01 removeaction ["Airstrike 1","arty1.sqs"]; at the end of the airstrike scripts to make it a one time use correct?
    Nope, but in init.sqs: ?player==alpha01:artyaction1=alpha01 addaction ["Airstrike 1","arty1.sqs"];
    And in the _beginning_ of arty1.sqs: player removeaction artyaction1;
    ... so you can&#39;t tap it like crazy while the script is still running, plus you could add a variable to be on the safe side, like in the beginning of arty1.sqs:
    ?arty1activated:exit;
    arty1activated=true;
    player removeaction artyaction1;
    ...
    and declare arty1activated=false in the init.sqs.

    Quote Originally Posted by [b
    Quote[/b] ]
    Here is the problem I have with adding the script as an action. The command to use the script is onMapSingleClick {[_pos] exec "airstrike.sqs"}; in the activation field of a trigger. I&#39;ve tried Eastman addaction ["Airstrike","onMapSingleClick {[_pos] exec "airstrike.sqs"};"]; But I get an error when the script is used that way.
    You can&#39;t pass parameters to scripts with the addaction command. However, you can pass the coordinates to the script with a variable or a marker for example. Like onMapSingleClick {"artymarker" setmarkerpos _pos;true}; and have a marker named artymarker, then with the action exec "arty1dummy.sqs" which in turn calls the real arty script with the markerpos as coordinates, like:
    _coords=getmarkerpos "artymarker";
    [_coords] exec "airstrike.sqs";

  9. #9
    Master Gunnery Sergeant
    Join Date
    May 2 2003
    Posts
    1,360
    Author of the Thread
    Thanks again Metal Heart for your help. I actually got it working from the action menu now for both squad leaders so they each have one airstrike each. I had to create my first first two actual scripts, titled action1.sqs and action2.sqs.

    *** Basically I have a trigger that is condition: all aa are dead and activation hint "Both AA sites are neutralized. Air support is now available.";eastman addaction ["Airstrike","action1.sqs"];westman addaction ["Airstrike","action2.sqs"];

    action1.sqs looks like this...
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    onMapSingleClick {&#91;_pos&#93; exec &#34;airstrike.sqs&#34;};
    strikePilot sideChat &#34;What do you need bombed?&#34;;
    hint &#34;On the map left click to select strike location&#34;;

    exit[/QUOTE]
    Action2.sqs is the same but it&#39;s for the other squad leader.

    ***In the airstrike script I&#39;ve been modifying and using I added in at the start of the script squudleadername removeaction 0 so now each squad leader can only call their airstrike once.

    I only have two questions left.

    1. Is there a way to set the range of an action so that only the squad leader can use it? I notice if your another player and your close enough to the squad leader the airstrike option will apear in your action bar also.

    2. What would be the most efficient way to remove the action from the squad leader if he is killed and then add it to the replacement squad leader? I got to thinking if the leader dies before he calls the airstrike then the rest of the squad is simply out of luck.

  10. #10
    1. No but you can use the addaction locally on him.
    2. Maybe in the leader&#39;s init field do groupx=group this; and have a looping script like this executed from init.sqs for each group:
    #loop
    _ldr=leader groupx;
    ?player==_ldrlayer addaction ["arty","arty.sqs"];
    @not(alive _ldr)
    goto "loop";

    You might also need a variable that prevents this happening once the arty has been used.




Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •