Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   FMB, Mission & Campaign builder Discussions (http://forum.fulqrumpublishing.com/forumdisplay.php?f=203)
-   -   Online War - FMB scripting (http://forum.fulqrumpublishing.com/showthread.php?t=21518)

robtek 04-26-2011 10:06 AM

Thanks for the answer ZaltysZ,

the first part of my post was just wishful thinking, pointed at players which abandon a working plane so they dont have to fly home and land.

And for your second point, i think i saw part of the problems in form of fata-morgana-bomber-raids, which disappear as you come closer to them, on the syn-server.

Ataros 04-26-2011 10:02 PM

Quote:

Originally Posted by ZaltysZ (Post 273545)
Yes, you can disable the controls, but trimmed plane can happily fly even without working controls. What I want to say: disabling the controls does not guarantee a quick crash.

Can a script apply say full aileron before disabling controls or set engine on fire?

Ataros 04-27-2011 07:50 AM

In my opinion this is what we need:

Quote:

Originally Posted by Ataros (Post 274214)

There are 2 issues with online currently:

1) when a player exits a plane AI takes control resulting in too many AI flying around at a server. There is a script to destroy AI after player exit http://forum.1cpublishing.eu/showpos...5&postcount=16
the problem with this script is that if a player exits while under attack his plane would disappear making the attacker very disappointed. Discussion is here http://forum.1cpublishing.eu/showthr...t=21518&page=3

Possible solution: damage an aircraft upon player exit to make it fall down and destroy it later in 10 minutes after it hits the ground.

2) When AI bombers are scripted to reappear on a server as time goes by the server can become very crowded with AI bombers making it unplayable. Mission example http://forum.1cpublishing.eu/showpos...8&postcount=24

The solution would be to damage AI bombers one by one (with 1-2 min intervals) in 15-25 minutes after their last waypoint. OnTaskCompleted()? Then when they fall down destroy them in 10 minutes.

Ideally damage applied to aircraft should be different (say 10 different types of damage in rotation) but deadly enough to make aircraft fall down in 1-3 minutes.

CoD possible Damage Types http://forum.1cpublishing.eu/showthread.php?t=22184 Thanks to FG28_Kodiak.

ZaltysZ 04-27-2011 08:02 AM

About bombers. Doesn't the problem dissappear if their last waypoint is "landing"?

mcler002 04-27-2011 08:22 AM

yes, but...
 
I would think so... But landing takes time ...

I just want them to disappear once they get back over 'friendly' areas

ZaltysZ 04-27-2011 08:32 AM

Quote:

Originally Posted by mcler002 (Post 274248)
I just want them to disappear once they get back over 'friendly' areas

Destroy() method of AiAircraft inside OnTaskCompleted().

Ataros 04-27-2011 09:08 AM

Quote:

Originally Posted by ZaltysZ (Post 274254)
Destroy() method of AiAircraft inside OnTaskCompleted().

Yes, we need someone to make this script to allow just copy-and-paste for those who does not know C# or any other language at all but makes missions in FMB like myself. Please... :grin:

This is an example of my mission that runs on Repka server atm. http://forum.1cpublishing.eu/showpos...8&postcount=24
I have no idea what I should put in the .cs file to make "Destroy() method of AiAircraft inside OnTaskCompleted(). " work. Another thing is that aircraft should fall to ground before it is destroyed with some timeout ideally as described here http://forum.1cpublishing.eu/showpos...1&postcount=33.

FG28_Kodiak 04-27-2011 01:26 PM

So have modified ZaltysZ script, with some damage ;), fastes way to ground is to disable all controlls and the engines.

Code:

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

public class  Mission : AMission
{
        public void _DespawnEmptyPlane(AiActor actor)
        {
                                        if (actor == null)
                                                { return;}

                                        Player[] Players = GamePlay.gpRemotePlayers();
                                       
                                        bool PlaneIsEmpty = true;
                                       
                                        foreach (Player i in Players)
                                        {       
                                                if ((i.Place() as AiAircraft) == (actor as AiAircraft))
                                                        {
                                                                PlaneIsEmpty = false;
                                                                break;
                                                        }
                                        }
                                       
                                        if (PlaneIsEmpty)
                                                {
                                                         
                                                          (actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsElevatorDisabled);
                                                          (actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsAileronsDisabled);
                                                          (actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsRudderDisabled);
                                                          (actor as AiAircraft).hitNamed(part.NamedDamageTypes.Eng0TotalFailure);
                //for 2mots
                (actor as AiAircraft).hitNamed(part.NamedDamageTypes.Eng1TotalFailure);
               
                                                    //wait 10min
                Timeout(600.0, () => {       
                                                        (actor as AiAircraft).Destroy();
                                                    });       
                                                       
                                          }
        }

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


Ataros 04-27-2011 01:35 PM

FG28_Kodiak, thank you so much! i will try it tonight.

ZaltysZ 04-27-2011 02:05 PM

Guys, don't bother with engines, kill fuel pump instead (all engines should stop). :-P

By the way, what will happen if player presses "Create" multiple time? There will probably be lots of planes on ground without working controls and engines. There is handy method IsAirborne(). If it returns false, plane should be destroyed immediately; if it returns true, only then disabling of controls should commence.


All times are GMT. The time now is 04:31 AM.

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