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 > FMB, Mission & Campaign builder Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 09-09-2011, 08:05 AM
SNAFU SNAFU is offline
Approved Member
 
Join Date: Feb 2011
Posts: 324
Default Request for scripters: Death/ESC-Ban

May I ask any talented c# expert to give me a hint how to install a kind of "death ban" script of online-players for

-leaving their plane via ESC without beeing on safely on the ground
-after X number of deaths

to have a ban for Y minutes.

To draft our server-concept:
We run an dedicated online server and our approach is orientated on historically circumstances and based on daily reports of missions during July 1940. Every ingame hour one mission is launched to simulate certain events of these days as far as possible with the given tools. The nature of these missions demand teamplay and organization, the player will have little chance flying alone or in small numbers and should stick to the tasks given. 95% of the online players just jump into a plane and go straight the shortest way to where they expect to find the fast action, that`s utterly ok (I myself do this also, when I am in the mood), but to have some diversity in servers, we choosed to keep this kind of gameplay out of our server as far as possible. (There are other and better servers for the fast fun&action).
That`s why I am looking for a tool to "punish" players, who just press ESC to choose another and give killed pilots a few minutes to think about what they did wrong.

Any help would be greatly appreciated.
Brgds
SNAFU
__________________
http://cornedebrouwer.nl/cf48e

Last edited by SNAFU; 09-09-2011 at 08:14 AM.
Reply With Quote
  #2  
Old 09-09-2011, 09:01 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

I can not script it but as you ask for a hint it is possible to remember player's name as adonys describes here http://forum.1cpublishing.eu/showthread.php?t=25817 then check if he left (not bailed out) the plane on the ground or in the air and if the latest break engine of his next aircraft onPlaceEnter and write a message on screen for him like "Sorry, it is prohibited to exit your plane while you are still in the air... etc. Try selecting a new plane in 1 minute."

I would be also interested to have this script running on Repka servers if someone can write it properly.
Reply With Quote
  #3  
Old 09-09-2011, 09:30 AM
ZaltysZ's Avatar
ZaltysZ ZaltysZ is offline
Approved Member
 
Join Date: Sep 2008
Location: Lithuania
Posts: 426
Default

Quote:
Originally Posted by SNAFU View Post
-leaving their plane via ESC without beeing on safely on the ground
It was impossible to do nicely some time ago, because means to check if plane was on ground did not work. I don't know if it is fixed now.
Reply With Quote
  #4  
Old 09-09-2011, 09:38 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by ZaltysZ View Post
It was impossible to do nicely some time ago, because means to check if plane was on ground did not work. I don't know if it is fixed now.
I believe it is fixed. The problem was in too early take-off by humans.

Quote:
Originally Posted by luthier View Post
* Airborne status is now checked correctly even if the aircraft in question departed prematurely;
Reply With Quote
  #5  
Old 09-09-2011, 09:43 AM
SNAFU SNAFU is offline
Approved Member
 
Join Date: Feb 2011
Posts: 324
Default

Quote:
Originally Posted by Ataros View Post
...the plane on the ground or in the air and if the latest break engine of his next aircraft onPlaceEnter and write a message on screen for him like "Sorry, it is prohibited to exit your plane while you are still in the air... etc. Try selecting a new plane in 1 minute."
Thx for the hint, Ataros.
Also possible, but I assume the casual player will spawn, curse, ESC, Spawn, curse, repaeat... and get loud, which would lead to a lot of planes spawing and therefore lags, but if it`s only feasible this route, would be ok also.

I like designing missions, but I don´t have time and the nerves to get myself into C# beyond just taking what I find and copy it together...

Quote:
Originally Posted by ZaltysZ View Post
It was impossible to do nicely some time ago, because means to check if plane was on ground did not work. I don't know if it is fixed now.
If the "airborne" status is fixed, their should be an easy way to implement a penalty for abandoming planes airborne, without using the parachute. I will try an "message when airborne" trigger, which didn´t work last patch, when I ve got time.

But anyhow, if someone of the scripters would get his hands on a such lines, I`ll buy him a beer.
__________________
http://cornedebrouwer.nl/cf48e
Reply With Quote
  #6  
Old 09-09-2011, 10:41 AM
SNAFU SNAFU is offline
Approved Member
 
Join Date: Feb 2011
Posts: 324
Default

Thinking about it, I would even consider Ataros suggestion with blocking the players fuel pump as penalty as the best solution.
__________________
http://cornedebrouwer.nl/cf48e
Reply With Quote
  #7  
Old 09-09-2011, 11:49 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

My quick and dirty solution (for Beta Patch)

Code:
using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;


public class Mission : AMission
{

    const int TotalArrestTime = 30;  // Time in seconds

    public class prisonCell
    {
        public Player Prisoner { get; set; }
        public DateTime JailTime { get; set; }
        public bool Removable { get; set; }
    }

    public List<prisonCell> PrisonCamp = new List<prisonCell>();


    public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);

        if (PrisonCamp.Count != 0)
        {
            foreach (prisonCell pri in PrisonCamp)
            {
                if (pri.Prisoner == player)
                {
                    TimeSpan ArrestTime = DateTime.Now.Subtract(pri.JailTime);

                    if (ArrestTime.TotalSeconds < TotalArrestTime)
                    {
                        GamePlay.gpLogServer(null, "Player: {0} is under Arrest\n", new object[] { player.Name() });
                        GamePlay.gpHUDLogCenter(new Player[] { player }, "{0} you are under Arrest!", new object[] { player.Name() });
                        (actor as AiAircraft).hitNamed(part.NamedDamageTypes.FuelPumpFailure);
                    
                    }
                    else
                    {
                        pri.Removable = true;
                    }
                    
                }
            }

            PrisonCamp.RemoveAll(item => item.Removable == true);
        }
    }



    public override void OnPlaceLeave(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceLeave(player, actor, placeIndex);

        if ((actor as AiAircraft).IsAirborne())
        {

            GamePlay.gpLogServer(null, "Player: {0} get a {1} sec. penalty for leaving Airplane in flight\n", new object[] { player.Name(), TotalArrestTime });

            prisonCell NewPrisoner = new prisonCell();
            NewPrisoner.Prisoner = player;
            NewPrisoner.JailTime = DateTime.Now;

            PrisonCamp.Add(NewPrisoner);
        }
    }

}

Last edited by FG28_Kodiak; 09-09-2011 at 11:56 AM.
Reply With Quote
  #8  
Old 09-09-2011, 12:21 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

PrisonCamp! LOL
Great idea! Thank you! Programming can be very creative
Will do my best to enforce it on Repka servers.

Since the script builds a list of prisoners anyway may I ask to add a message "player ... is killed by ..." instead of "AI was killed by..." as described by adonys here when you have some time? http://forum.1cpublishing.eu/showthread.php?t=25817

ps. Does the script excludes pilots who bailed-out from list of prisoners?

Last edited by Ataros; 09-09-2011 at 12:35 PM.
Reply With Quote
  #9  
Old 09-09-2011, 01:17 PM
Ze-Jamz Ze-Jamz is offline
Approved Member
 
Join Date: Jan 2011
Location: On your six!!
Posts: 2,302
Default

Yes please someone try and work with this..

Nothing more annoying than everyone you shoot creating another plane and you've shot down 'AI' again.....really!?

I've done this myself and its just annoying so I at least try an bail..

Any aircraft destroyed should be a kill and any aircraft your in that is destroyed or you bail from should be a death counted against you..

The stats have no meaning at all...As you know that everyone on the list has been shot down numerous times but has just created another plane when they've got themselves in trouble..

Everyone likes to know who they have shot down..come on

Its also adds to the enjoyment of the game as your finishing them off or trying to evade to stay alive...instead of taking lote of hit, giving up and respawning

Last edited by Ze-Jamz; 09-09-2011 at 01:21 PM.
Reply With Quote
  #10  
Old 09-09-2011, 01:17 PM
Ze-Jamz Ze-Jamz is offline
Approved Member
 
Join Date: Jan 2011
Location: On your six!!
Posts: 2,302
Default

Quote:
Originally Posted by FG28_Kodiak View Post
My quick and dirty solution (for Beta Patch)

Code:
using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;


public class Mission : AMission
{

    const int TotalArrestTime = 30;  // Time in seconds

    public class prisonCell
    {
        public Player Prisoner { get; set; }
        public DateTime JailTime { get; set; }
        public bool Removable { get; set; }
    }

    public List<prisonCell> PrisonCamp = new List<prisonCell>();


    public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);

        if (PrisonCamp.Count != 0)
        {
            foreach (prisonCell pri in PrisonCamp)
            {
                if (pri.Prisoner == player)
                {
                    TimeSpan ArrestTime = DateTime.Now.Subtract(pri.JailTime);

                    if (ArrestTime.TotalSeconds < TotalArrestTime)
                    {
                        GamePlay.gpLogServer(null, "Player: {0} is under Arrest\n", new object[] { player.Name() });
                        GamePlay.gpHUDLogCenter(new Player[] { player }, "{0} you are under Arrest!", new object[] { player.Name() });
                        (actor as AiAircraft).hitNamed(part.NamedDamageTypes.FuelPumpFailure);
                    
                    }
                    else
                    {
                        pri.Removable = true;
                    }
                    
                }
            }

            PrisonCamp.RemoveAll(item => item.Removable == true);
        }
    }



    public override void OnPlaceLeave(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceLeave(player, actor, placeIndex);

        if ((actor as AiAircraft).IsAirborne())
        {

            GamePlay.gpLogServer(null, "Player: {0} get a {1} sec. penalty for leaving Airplane in flight\n", new object[] { player.Name(), TotalArrestTime });

            prisonCell NewPrisoner = new prisonCell();
            NewPrisoner.Prisoner = player;
            NewPrisoner.JailTime = DateTime.Now;

            PrisonCamp.Add(NewPrisoner);
        }
    }

}
Thanks mate..that will do for now
Reply With Quote
Reply


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 09:01 AM.


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