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, 04:29 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by SNAFU View Post
My Mission-Skript looks following:

...Well, 169574 characters and only 50000 allowed....
LOL You can attach it as zip or maybe as txt as well
Reply With Quote
  #2  
Old 09-09-2011, 04:51 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

@SNAFU
The fuelpump doesn't block!
Haste mal wieder die Klammern durcheinandergebracht?

Quote:
Another suggestion is to print time left for player till he can create new plane on screen.
Is on my todo list

Quote:
Is it possible to add the last damager to the chat message for everyone to let everyone know who shot him down?
Without a problem
Reply With Quote
  #3  
Old 09-09-2011, 05:01 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Maybe something like this would work?
Code:
(actor as AiAircraft).hitNamed(part.NamedDamageTypes.Eng0TotalFailure);
I've seen it in another script working.
Reply With Quote
  #4  
Old 09-09-2011, 05:15 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

At my Testmission FuelPumpFailure works without a problem. So i dont know what's going wrong.
Reply With Quote
  #5  
Old 09-09-2011, 06:38 PM
SNAFU SNAFU is offline
Approved Member
 
Join Date: Feb 2011
Posts: 324
Default

@Kodiak, nö, dann hätte er ja Fehlermeldungen rausgespuckt. I just get the usual "Object not set to a reference" messages as before, nothing unusual...

Does the script recognize that the player just spawned and wants to change the airfield, so didn´t even takeoff? Will the player get a penalty then also?

I attached the script below. I have also the "plane-destroy-after-abandoming" script running, so I have troubles with calling up the "OnPlayerLeave" parts twice.
Attached Files
File Type: zip Mid-July1940_v1.zip (22.4 KB, 7 views)
__________________
http://cornedebrouwer.nl/cf48e

Last edited by SNAFU; 09-09-2011 at 06:43 PM.
Reply With Quote
  #6  
Old 09-09-2011, 06:49 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

No the script uses Aircraft.IsAirborne, if true the plane is in the Air, if false the plane is on ground. But this works only again in the Beta Patch and then i hope so forever after the next reqular patch.

I will take a look at your script.

At the moment i work on your Death penalty -> Brzzzzlll and on the Arrest Count Down.
Reply With Quote
  #7  
Old 09-10-2011, 07:33 AM
SNAFU SNAFU is offline
Approved Member
 
Join Date: Feb 2011
Posts: 324
Default

Nice!

If you need further infos let me know, I`ve got access to our server, but not the game installed on my notebook.
__________________
http://cornedebrouwer.nl/cf48e
Reply With Quote
  #8  
Old 09-10-2011, 01:03 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

New Version, added Player Countdown, changed Player in Prisoncell from object refence to Playername, so the penalty should be still active, even the player reconnected.

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 string PrisonerName { get; set; }
        public DateTime ArrestBeginTime { get; set; }
        public DateTime ArrestEndTime { 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 (actor == null) // if player bailed out the actor is null so remove the player from prison if he is in
        {
            if (PrisonCamp.Count != 0)
            {
                foreach (prisonCell pri in PrisonCamp)
                {
                    if (pri.PrisonerName.Equals(player.Name()))
                    {
                            pri.Removable = true;
                    }
                }
                PrisonCamp.RemoveAll(item => item.Removable == true);
            }
        }

        if (PrisonCamp.Count != 0)
        {
            foreach (prisonCell pri in PrisonCamp)
            {
                if (pri.PrisonerName.Equals(player.Name()))
                {
                    TimeSpan ArrestTime = DateTime.Now.Subtract(pri.ArrestBeginTime);

                    if (ArrestTime.TotalSeconds < TotalArrestTime)
                    {
                        TimeSpan RestTime = pri.ArrestEndTime.Subtract(DateTime.Now);
                        GamePlay.gpLogServer(null, "Player: {0} get a time penalty for leaving Airplane in flight\n", 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())
        {
            prisonCell NewPrisoner = new prisonCell();
            NewPrisoner.PrisonerName = player.Name();
            NewPrisoner.ArrestBeginTime = DateTime.Now;
            NewPrisoner.ArrestEndTime = DateTime.Now.AddSeconds(TotalArrestTime);

            PrisonCamp.Add(NewPrisoner);
        }
    }


    public override void OnTickGame()
    {
        base.OnTickGame();

        if (Time.tickCounter() % 34 == 0) // 34 Ticks should be a second
        {
            if (PrisonCamp.Count != 0)
            {
                foreach (prisonCell pri in PrisonCamp)
                {
                    foreach (Player aktplayer in GamePlay.gpRemotePlayers())
                    {
                        if (pri.PrisonerName.Equals(aktplayer.Name()))
                        {
                            TimeSpan RestTime = pri.ArrestEndTime.Subtract(DateTime.Now);
                            if (RestTime.TotalSeconds > 0.0)
                            {
                                GamePlay.gpHUDLogCenter(new Player[] { aktplayer }, "{0} Arrest ends in {1:00} min. {2:00} sec.", new object[] { aktplayer.Name(), RestTime.Minutes, RestTime.Seconds });
                            }
                            else
                            {
                                GamePlay.gpHUDLogCenter(new Player[] { aktplayer }, "{0} Arrest over - Have Fun!", new object[] { aktplayer.Name() });
                                pri.Removable = true;
                            }
                        }
                    }
                }
                PrisonCamp.RemoveAll(item => item.Removable == true);
            }
        }
    }
}
Reply With Quote
  #9  
Old 09-10-2011, 03:05 PM
SNAFU SNAFU is offline
Approved Member
 
Join Date: Feb 2011
Posts: 324
Default

Thanks, I try now to load that script via submission and currently running on our server.

If someone is able to test, please report back...
__________________
http://cornedebrouwer.nl/cf48e
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:00 PM.


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