Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > CoD Multiplayer

CoD Multiplayer Everything about multiplayer in IL-2 CoD

Reply
 
Thread Tools Display Modes
  #11  
Old 10-26-2012, 11:42 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Both answers are yes, however I need to enhance the script. I hope I have time to do this next week.
Reply With Quote
  #12  
Old 10-26-2012, 08:05 PM
bw_wolverine's Avatar
bw_wolverine bw_wolverine is offline
Approved Member
 
Join Date: Jun 2010
Location: Toronto, Canada
Posts: 622
Default

Quote:
Originally Posted by 41Sqn_Banks View Post
Both answers are yes, however I need to enhance the script. I hope I have time to do this next week.
Awesome!

This is really a great piece of work and has totally revitalized No.401 Squadron in a big way.

We hope to use this script to help bring a CO-OP campaign to fruition. We're testing with the current version and signs are really good.
__________________
Pilot #1 (9:40 hours flying time, 3/0/1 Fighters, 7/2/0 Bombers). RIP

No.401 Squadron Forum


Using ReconNZ's Pilot Log Book
Reply With Quote
  #13  
Old 10-27-2012, 01:33 PM
Punch_145 Punch_145 is offline
Approved Member
 
Join Date: May 2012
Posts: 24
Default

Very nice..Tried this and looks very promising only problem for me is if I use your script, Triggers and Actions seem to stop working? or am I doing something wrong?

Last edited by Punch_145; 10-27-2012 at 09:33 PM.
Reply With Quote
  #14  
Old 10-28-2012, 05:33 AM
dcheeze dcheeze is offline
Approved Member
 
Join Date: Dec 2008
Posts: 2
Default

I am unable to get the script to work, I've downloaded the example mission and loaded on my host machine (not dedicated server), started the mission as multiplayer (coop) and then have a client try and join the mission. The host is able to select an aircraft but the client, typing any of the three commands sees nothing. An following error is shown on the client machine: *WPF.Unavailable puppet place error. I'm not sure if I am doing this correctly so any help would be appreciated.
Reply With Quote
  #15  
Old 10-28-2012, 06:58 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Quote:
Originally Posted by dcheeze View Post
I am unable to get the script to work, I've downloaded the example mission and loaded on my host machine (not dedicated server), started the mission as multiplayer (coop) and then have a client try and join the mission. The host is able to select an aircraft but the client, typing any of the three commands sees nothing. An following error is shown on the client machine: *WPF.Unavailable puppet place error. I'm not sure if I am doing this correctly so any help would be appreciated.
Did you add:
Code:
[rts]
scriptAppDomain = 0
to your conf.ini and confs.ini?
Is there any entry in the log file?
Reply With Quote
  #16  
Old 10-28-2012, 08:02 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Quote:
Originally Posted by Punch_145 View Post
Very nice..Tried this and looks very promising only problem for me is if I use your script, Triggers and Actions seem to stop working? or am I doing something wrong?
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();
        }
        
    }
So the triggers and actions works like expected
Reply With Quote
  #17  
Old 10-28-2012, 10:02 AM
dcheeze dcheeze is offline
Approved Member
 
Join Date: Dec 2008
Posts: 2
Default

That was it, added the RTS scriptAppDomain and it worked like a charm. Thanks
Reply With Quote
  #18  
Old 10-28-2012, 10:32 AM
Punch_145 Punch_145 is offline
Approved Member
 
Join Date: May 2012
Posts: 24
Default

Thank you Kodiak, Much appreciated
Reply With Quote
  #19  
Old 10-28-2012, 11:06 AM
Punch_145 Punch_145 is offline
Approved Member
 
Join Date: May 2012
Posts: 24
Default

Sorry, when You say "before last bracket" do you mean like so?

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();
        }
        
    }}

Last edited by Punch_145; 10-28-2012 at 11:09 AM.
Reply With Quote
  #20  
Old 10-28-2012, 12:53 PM
Nephris Nephris is offline
Approved Member
 
Join Date: Jun 2008
Posts: 117
Default

Thx again for your work Banks.
Is there a way to limit the player spawn?
Means as soon as a player got shot, he is out.
Or better , can I seperate playable flights from non playable?

Would that only be possible by adding AI flights by loading submissions?

Last edited by Nephris; 10-28-2012 at 01:01 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:34 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.