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)

Thee_oddball 04-17-2011 08:09 PM

Quote:

Originally Posted by Ataros (Post 265842)
I can not say if something is wrong as I do not know C# myself.
Why do you expect the AI aircraft not to take off? If basic40c.mis tells them to take off, they will.

you misunderstand me..the AI i am talking about are player abandoned air craft not scripted AI

Ataros 04-18-2011 08:12 AM

1 Attachment(s)
Sample use of triggers to load a new mission into current one.

Quote:

110s attack convoy of static objects. When it is killed trigger loads a new mission where 110s attack just one car. When it is killed OnActorDead does not work unfortunately...
http://www.sukhoi.ru/forum/showthrea...=1#post1599354

It does not work on static objects completely as intended but works for aircraft I think.

File attached

ZaltysZ 04-19-2011 05:22 AM

Spawn/despawn script is kinda "incomplete" and causes unwanted behavior: plane instantly disappearing on bail out or plane disappearing when single member of crew leaves the plane (i.e. one of bomber gunners leaves the plane) while other members are still inside.

Additionally checking if plane is manned before "killing" it should help with multicrew plane despawns. Bail out despawns probably will be a lot tricker.

Ataros 04-19-2011 02:19 PM

Attention mission makers! A person from dev team told we can put AA guns on oil tankers at other forums. This means we can have some sea battles going on in the channel )) or coastal airfields attacked from sea.

Can not try it myself yet.

Ataros 04-19-2011 02:20 PM

Quote:

Originally Posted by ZaltysZ (Post 267608)
Spawn/despawn script is kinda "incomplete" and causes unwanted behavior: plane instantly disappearing on bail out or plane disappearing when single member of crew leaves the plane (i.e. one of bomber gunners leaves the plane) while other members are still inside.

Additionally checking if plane is manned before "killing" it should help with multicrew plane despawns. Bail out despawns probably will be a lot tricker.

Someone who knows C# can change it hopefully. I do not see much interest from community to this topic unfortunately. Hopefully when bugs are fixed and we have a stable dedi server things change.

ZaltysZ 04-19-2011 06:35 PM

Script for despawning planes without humans inside. Multicrew friendly.

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

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


Ataros 04-19-2011 09:48 PM

WOW! Thanks a lot!!!

Thee_oddball 04-19-2011 09:48 PM

Quote:

Originally Posted by Ataros (Post 267990)
Attention mission makers! A person from dev team told we can put AA guns on oil tankers at other forums. This means we can have some sea battles going on in the channel )) or coastal airfields attacked from sea.

Can not try it myself yet.

oops I thought you guys knew that...my first map has 8 tankers and 3 with bofars :)

the selection will be under cargo :)

Thee_oddball 04-19-2011 09:49 PM

thank you Zalty does this replace the original script?

Ataros 04-19-2011 10:08 PM

Quote:

Originally Posted by Thee_oddball (Post 268370)
oops I thought you guys knew that...my first map has 8 tankers and 3 with bofars :)

the selection will be under cargo :)

Did you upload your mission somewhere? Could I have a look at it in FMB?


All times are GMT. The time now is 03:03 AM.

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