![]() |
|
|
|
#1
|
|||
|
|||
|
Click on your side flag
|
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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();
}
}
|
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
Quote:
![]() Quote:
|
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
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. |
![]() |
|
|