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 11-18-2012, 11:51 AM
Aussie Pilot Aussie Pilot is offline
Approved Member
 
Join Date: Nov 2011
Location: Brisbane, Australia
Posts: 27
Default Changing/renewing your aircraft online.

I made a dogfight mission with a spawn area at hawkinge. It comprises of Spitfire's and hurricanes for test flight purposes as a few of us learn to fly this sim and sort out all the idiosyncracies of a new mision builder and online server. Nothing else in the mission, just that.

I start the server, join and fly around in a spit, when i land I then want to try the Hurri out but can't swap out of the spit. Same goes if i prang my prop before takeoff, doh !!!, i can't get a new plane either. It just keeps reloading me into the same plane, broken prop and all. I was able to change after dieing of course.

In the realism settings i have left all the plane swapping options etc unchecked.

How then do i go about swapping planes after landing or pranging?
Reply With Quote
  #2  
Old 11-18-2012, 04:12 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Click on your side flag
Reply With Quote
  #3  
Old 11-19-2012, 10:29 AM
Aussie Pilot Aussie Pilot is offline
Approved Member
 
Join Date: Nov 2011
Location: Brisbane, Australia
Posts: 27
Default

Quote:
Originally Posted by FG28_Kodiak View Post
Click on your side flag
Thanks kodiak, that worked, however, when I respawned in a new aircraft my old one was still sitting there on it's nose. So then i left my second plane there without flying it and swapped to the hurricane. When I spawned it looked like ai had somehow taken over my second plane and was taxiing for takeoff, weird seen i have no ai in the mission.

After flying and building missions in IL-2 1946 for years, some things in this sim just don't add up.
Reply With Quote
  #4  
Old 11-19-2012, 03:30 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Add this script to your mission:
Code:
using System;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;


public class Mission : AMission
{


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

        MissionNumberListener = -1;
    }



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

        Destroy(actor);
    }



    private bool IsDestroyable(AiActor actor)
    {
        AiCart cart = actor as AiCart;

        if (cart != null)
        {
            //check if a player is present in actor
            for (int i = 0; i < cart.Places(); i++)
                if (cart.Player(i) != null)
                    return false;
        }
        return true;
    }


    private void Destroy(AiActor actor)
    {
        AiCart cart = actor as AiCart;

        if (cart != null && IsDestroyable(actor))
            cart.Destroy();
    }

}
Then the used plane will removed after leaving
Reply With Quote
  #5  
Old 11-19-2012, 11:03 PM
Aussie Pilot Aussie Pilot is offline
Approved Member
 
Join Date: Nov 2011
Location: Brisbane, Australia
Posts: 27
Default

Thanks Kodiak. Being new to this FMB I haven't done any scripting before, so I have a few questions.

1) Is this script a fix someone made for the game or is it some of the scripting I'll need to learn as i get further into mission building?

2) Where do I need to copy and paste it to? I'm guessing my mission file somewhere, which i'll find, but where about's in the mission file? or should I do it in FMB ?

Thanks for your help.
Reply With Quote
  #6  
Old 11-20-2012, 05:45 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Quote:
Originally Posted by Aussie Pilot View Post
1) Is this script a fix someone made for the game or is it some of the scripting I'll need to learn as i get further into mission building?
This script is from me, i use it to remove player used planes from multiplayer missions. It's only nessesary for multiplayer missions, if a player leaves his plane the AI getting active and fly the plane for the player, but this is not always practible, for example if the plane is damaged.

Quote:
2) Where do I need to copy and paste it to? I'm guessing my mission file somewhere, which i'll find, but where about's in the mission file? or should I do it in FMB ?
Open the script window (edit menu) and paste the code above into it, then save it.
Reply With Quote
  #7  
Old 11-20-2012, 07:14 AM
superbee15 superbee15 is offline
Registered Member
 
Join Date: Apr 2011
Location: Qld Australia
Posts: 13
Default

Kodiak

Is it just ok to add the script or is it necessary to add some flag or something to you config file for scripts to work?

I am working with AP in trying to understand mission building.

Thanks
Reply With Quote
  #8  
Old 11-20-2012, 07:34 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

No it's not nessesary to add a flag. If there is a .cs file with the same name as the missionfile it will be loaded and executed (if there are no errors in the script). You can check errors by open the console window in game.
The .cs file with the correct name is automatically created if you press save in the script window.
Reply With Quote
  #9  
Old 11-20-2012, 07:50 AM
Aussie Pilot Aussie Pilot is offline
Approved Member
 
Join Date: Nov 2011
Location: Brisbane, Australia
Posts: 27
Default

Cheers mate, i'll add that to my mission.
Reply With Quote
  #10  
Old 11-24-2012, 01:57 AM
Aussie Pilot Aussie Pilot is offline
Approved Member
 
Join Date: Nov 2011
Location: Brisbane, Australia
Posts: 27
Default

Hi kodiak.
I put your script in as suggested and it worked, thanks. But the problem is it seems to affect other things.
I have a mission that spawns He 111's when a truck is destoyed. (I believe you know it, Salmo has been helping with it also). Anyway, even though i can't get my mission to work, i put your script in the mission i copied from Salmo (which does work) and it stopped the bombers from spawning. So i deleted the cs. file and they worked again.

I don't get it !!! When I open the script in FMB and put in the trigger info etc, it doesnt create a cs file, all triggering info is stored in the mis.file as you know. But anything in the script tab of the script box seems to create a cs.file ( i think i'm correct so far ?). So why then would your script file interfere with the bombers spawning?

There seems to be way to much unneccessary crap in this FMB.
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 02:39 PM.


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