Results 1 to 10 of 10

Thread: COOP mission tutorial - How to get your friends to join you on any mission you want.

  1. #1
    Novice Pilot
    Join Date
    Oct 2013
    Posts
    70
    Post Thanks / Like
    Total Downloaded
    0

    COOP mission tutorial - How to get your friends to join you on any mission you want.

    The purpose of this tutorial it to teach people how easy it really is to create a co-operative mission in this game. It was suggested after I got this working that I post so others may have a chance
    at doing the same.

    I searched and tested for some time before a combination of a few solutions allowed my co-op missions to work.
    This has been tested on 3 different missions with friends over the last day in Team Fusion 4 and works fairly seamlessly from what I have seen.

    Summary:
    * Modify config files a tiny bit
    * Rename a script file
    * Load a lobby
    * Type a few commands to choose a plane
    * Fly

    NOTE: Only the server needs to make the following changes. Your friends don't have to do anything.



    Steps:
    1) You must add the following line to your conf.ini or confs.ini

    [rts]
    scriptAppDomain = 0




    2) Create a new mission in the full mission builder or use an existing single player mission and save it in the coop folder described below.


    3) Save the below linked file as your mission name but with .cs as the extension. e.g. scrambledeggs.cs.
    This is the small script which makes this coop stuff all possible

    http://www.mediafire.com/?ana2d8u85kmp6zb

    Put the file into the folder described below.

    If you are using vanilla under windows 7
    C:\Users\yourusername\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Co-Op

    If you are using TeamFusion under windows 7
    C:\Users\yourusername\Documents\1C SoftClub\il-2 sturmovik cliffs of dover - mod\missions\Multi\Co-Op

    You should end up with two files. A .mis file which is the mission you made and saved and a .cs file which is the coop mission script


    4) Load up il2 Cliffs of Dover and go to multiplayer. Start a multiplayer lobby.




    5) Tell your friends to go to multiplayer and join you in the lobby.
    Your friends should start appearing in the lobby.

    6) When everybody has arrives press play. DO NOT do this before everybody is in the lobby.

    7) In the server screen make sure you select realism and turn off (deselect so no dot appears) anything under aircraft switching.
    This is very important to allow people to select their aircraft.


    7.5) Your friends should be able to press "play" as soon as you press ok in
    the server screen.


    8) Start the battle (note you may have to start battle before anybody can type the commands.

    9)At the server briefing screen get your friends to type the following commands


    !aircraft - This will show a list of all available aircraft starting with the id of the aircraft
    !select# - This will place the player into the aircraft, replace # with the id of the aircraft, e.g. !select0 will place you into the first aircraft and so on.

    !help - This will show the available commands if need be






    10) Get everybody to press fly if they do not go directly into the battle

    11) When anybody dies they may press escape to get back to the chat window and type commands again to enter any left over AI aircraft.

    You should now be able to see each other by steam name in game if you have icons allowed turned on.

    Apparently this even works with single player missions. Put the script in with the correct mission name and in the coop folder.
    Use the method above to start a server.

    Thanks go to the below chaps for their stella help:
    1lokos
    danperin
    ATAG_Lolsav
    41Sqn_Banks

    Original Post
    http://forum.1cpublishing.eu/showpos...99&postcount=1

    P.S. I recommend turning any firewalls off for initial testing.
    Last edited by Destraex; Nov-19-2013 at 07:02.

  2. #2
    Novice Pilot
    Join Date
    Oct 2013
    Posts
    70
    Post Thanks / Like
    Total Downloaded
    0

    Re: COOP mission tutorial - How to get your friends to join you on any mission you wa

    Played with 3 other mates tonight. Worked well. But had to make a new lobby few times to change missions.

  3. #3
    Novice Pilot
    Join Date
    Dec 2012
    Location
    spain
    Posts
    97
    Post Thanks / Like
    Total Downloaded
    0

    Re: COOP mission tutorial - How to get your friends to join you on any mission you wa

    Hi, how can add a chat comand to remove a idle airgroup?

    Example

    if (msg.StartsWith("!inicio"))
    {
    AiAirGroup[] army_groups = GamePlay.gpAirGroups(i);
    foreach (AiAirGroup group in army_groups)
    {
    group.Idle = false;
    }


    thx

  4. #4
    ATAG Member ATAG_Lolsav's Avatar
    Join Date
    Jun 2012
    Posts
    4,705
    Post Thanks / Like
    Blog Entries
    1
    Total Downloaded
    16.32 MB

    Re: COOP mission tutorial - How to get your friends to join you on any mission you wa

    Adding more information

    For those who play Coop a extra "snippet" should be added to the script because the ingame triggers were not responding.

    FG28_Kodiak gave the solution:


    You should add these lines to the script (insert it before the last bracket):
    Code:
        public override void OnTrigger(int missionNumber, string shortName, bool active)
        {
            base.OnTrigger(missionNumber, shortName, active);
    
            AiAction action = GamePlay.gpGetAction(ActorName.Full(missionNumber, shortName));
            if (action != null)
            {
                action.Do();
            }
            
        }


    Complete Script with the extra snippet added at the end

    It can be saved as "NameOfYourMission.cs". Just copy paste to notepad, but make sure the extension is "cs" and not "txt". Then place it on the same folder as the mission.mis file is.

    Code:
    using System;
    using System.Collections.Generic;
    using System.Text;
    
    using maddox.game;
    using maddox.game.world;
    
    //$reference parts/core/gamePlay.dll
    
    public class Mission : AMission
    {
        public override void OnBattleInit()
        {
            base.OnBattleInit();
    
            if (GamePlay is GameDef)
            {
                (GamePlay as GameDef).EventChat += new GameDef.Chat(Mission_EventChat);
            }
        }
    
        void Mission_EventChat(IPlayer from, string msg)
        {
            if (msg.StartsWith("!help"))
            {
                Chat("Commands: !aircraft, !select#", from);
            }
            if (msg.StartsWith("!aircraft") || msg.StartsWith("!select"))
            {
                List<Tuple<AiAircraft, int>> aircraftPlaces = new List<Tuple<AiAircraft, int>>();
                if (GamePlay.gpArmies() != null && GamePlay.gpArmies().Length > 0)
                {
                    foreach (int army in GamePlay.gpArmies())
                    {
                        if (GamePlay.gpAirGroups(army) != null && GamePlay.gpAirGroups(army).Length > 0)
                        {
                            foreach (AiAirGroup airGroup in GamePlay.gpAirGroups(army))
                            {
                                if (airGroup.GetItems() != null && airGroup.GetItems().Length > 0)
                                {
                                    foreach (AiActor actor in airGroup.GetItems())
                                    {
                                        if (actor is AiAircraft)
                                        {
                                            AiAircraft Aircraft = actor as AiAircraft;
                                            for (int place = 0; place < Aircraft.Places(); place++)
                                            {
                                                aircraftPlaces.Add(new Tuple<AiAircraft, int>(Aircraft, place));
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
    
                if (msg.StartsWith("!aircraft"))
                {
                    int i = 0;
                    foreach (Tuple<AiAircraft, int> aircraftPlace in aircraftPlaces)
                    {
                        string playerName = "";
                        Player player = aircraftPlace.Item1.Player(aircraftPlace.Item2);
                        if (player != null)
                        {
                            playerName = " " + player.Name();
                        }
                        Chat("#" + i + ": " + aircraftPlace.Item1.Name() + " " + aircraftPlace.Item1.TypedName() + " " + aircraftPlace.Item1.CrewFunctionPlace(aircraftPlace.Item2) + " " + playerName, from);
                        i++;
                    }
                }
                else if (msg.StartsWith("!select"))
                {
                    msg = msg.Replace("!select", "");
    
                    int i = -1;
                    if (int.TryParse(msg, out i) && i < aircraftPlaces.Count)
                    {
                        Tuple<AiAircraft, int> aircraftPlace = aircraftPlaces[i];
                        if (aircraftPlace.Item1.Player(aircraftPlace.Item2) == null)
                        {
                            from.PlaceEnter(aircraftPlace.Item1, aircraftPlace.Item2);
                        }
                        else
                        {
                            Chat("Place occupied.", from);
                        }
                    }
                    else
                    {
                        Chat("Please enter a valid aircraft number, e.g. !select0, !select1, !select2, ...", from);
                    }
                }
            }
        }
    
        public void Chat(string line, IPlayer to)
        {
            if (GamePlay is GameDef)
            {
                (GamePlay as GameDef).gameInterface.CmdExec("chat " + line + " TO " + to.Name());
            }
        }
     public override void OnTrigger(int missionNumber, string shortName, bool active)
        {
            base.OnTrigger(missionNumber, shortName, active);
    
            AiAction action = GamePlay.gpGetAction(ActorName.Full(missionNumber, shortName));
            if (action != null)
            {
                action.Do();
            }
            
        }
    }

  5. Likes danperin liked this post
  6. #5
    Student Pilot
    Join Date
    Jun 2013
    Posts
    1
    Post Thanks / Like
    Total Downloaded
    1.25 GB

    Re: COOP mission tutorial - How to get your friends to join you on any mission you wa

    I tried it ,but it seems like it doesn't work anymore, when my friend type !aircraft in , nothing happened

  7. #6
    ATAG Member ATAG_Lolsav's Avatar
    Join Date
    Jun 2012
    Posts
    4,705
    Post Thanks / Like
    Blog Entries
    1
    Total Downloaded
    16.32 MB

    Re: COOP mission tutorial - How to get your friends to join you on any mission you wa

    *bump*

    Snapper this one needs a sticky in this section

  8. Likes danperin liked this post
  9. #7
    Veteran Combat pilot Uwe's Avatar
    Join Date
    Nov 2011
    Posts
    256
    Post Thanks / Like
    Total Downloaded
    119.23 MB

    Re: COOP mission tutorial - How to get your friends to join you on any mission you wa

    Same here.
    Tried doing this with a single player mission with no effect.
    typing !aircraft gives no aircraft list

    I made sure that both my conf and confs have the needed line added
    And I made sure that the .cs script is named after the mission and in the coop folder with the .mis and briefing.

    My group can join and see the server briefing, select the appropriate flag, but when the type !aircraft nothing comes up.
    Last edited by Uwe; Jul-07-2016 at 00:07.

  10. #8
    Student Pilot
    Join Date
    Feb 2016
    Posts
    2
    Post Thanks / Like
    Total Downloaded
    973.39 MB

    Re: COOP mission tutorial - How to get your friends to join you on any mission you wa

    Has anyone fixed this yet?

  11. #9
    Novice Pilot
    Join Date
    May 2015
    Posts
    40
    Post Thanks / Like
    Total Downloaded
    42.04 MB

    Re: COOP mission tutorial - How to get your friends to join you on any mission you wa

    This works! It does not need fixing. If you are trying this and it isn't working, re-read the instructions (the paths to your missions are not what you think they should be). Also, you should open your ports that are used in the game, which is 27015.

  12. #10
    Team Fusion danperin's Avatar
    Join Date
    Dec 2012
    Location
    Sao Paulo, Brazil
    Posts
    1,675
    Post Thanks / Like
    Total Downloaded
    571.79 MB

    Re: COOP mission tutorial - How to get your friends to join you on any mission you wa

    Quote Originally Posted by Uwe View Post
    Same here.
    Tried doing this with a single player mission with no effect.
    typing !aircraft gives no aircraft list

    I made sure that both my conf and confs have the needed line added
    And I made sure that the .cs script is named after the mission and in the coop folder with the .mis and briefing.

    My group can join and see the server briefing, select the appropriate flag, but when the type !aircraft nothing comes up.
    The mission needs spawn points on airfields to work online. A singleplayer mission will never work correctly online.
    Last edited by danperin; Jun-16-2020 at 12:21.

  13. Likes Erpr.Gr.210_Belial, varrattu liked this post

Bookmarks

Posting Permissions

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