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 04-19-2011, 06:22 AM
ZaltysZ's Avatar
ZaltysZ ZaltysZ is offline
Approved Member
 
Join Date: Sep 2008
Location: Lithuania
Posts: 426
Default

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.
Reply With Quote
  #2  
Old 04-19-2011, 03:19 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

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.

Last edited by Ataros; 04-19-2011 at 03:22 PM.
Reply With Quote
  #3  
Old 04-19-2011, 10:48 PM
Thee_oddball Thee_oddball is offline
Approved Member
 
Join Date: Mar 2011
Posts: 812
Default

Quote:
Originally Posted by Ataros View Post
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
__________________
Gigabyte Z68
Intel 2500K (@4.3 ghz)212 CM Cooler
8GB Ram
EVGA 660SC (super clocked) 2GB Vram
CORSAIR CMPSU-750TX 750W
64 GB SSD SATA II HD
WIN7 UL 64BIT
Reply With Quote
  #4  
Old 04-19-2011, 10:49 PM
Thee_oddball Thee_oddball is offline
Approved Member
 
Join Date: Mar 2011
Posts: 812
Default

thank you Zalty does this replace the original script?
__________________
Gigabyte Z68
Intel 2500K (@4.3 ghz)212 CM Cooler
8GB Ram
EVGA 660SC (super clocked) 2GB Vram
CORSAIR CMPSU-750TX 750W
64 GB SSD SATA II HD
WIN7 UL 64BIT
Reply With Quote
  #5  
Old 04-20-2011, 06:02 AM
ZaltysZ's Avatar
ZaltysZ ZaltysZ is offline
Approved Member
 
Join Date: Sep 2008
Location: Lithuania
Posts: 426
Default

Quote:
Originally Posted by Thee_oddball View Post
thank you Zalty does this replace the original script?
Yes, if previous one handled only despawning.
Reply With Quote
  #6  
Old 04-20-2011, 07:27 PM
ZaltysZ's Avatar
ZaltysZ ZaltysZ is offline
Approved Member
 
Join Date: Sep 2008
Location: Lithuania
Posts: 426
Default

I have edited my despawn script post and added additional "null" check to prevent some possible error.
Reply With Quote
  #7  
Old 04-20-2011, 08:23 PM
Jwam Jwam is offline
Approved Member
 
Join Date: Apr 2011
Posts: 51
Default

Quote:
Originally Posted by ZaltysZ View Post
I have edited my despawn script post and added additional "null" check to prevent some possible error.
Cool thank you very much ! I'll use it

edit : It seems there is one more "}" than needed, but works flawlessly

Last edited by Jwam; 04-20-2011 at 09:12 PM.
Reply With Quote
  #8  
Old 04-19-2011, 11:08 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by Thee_oddball View Post
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?
Reply With Quote
  #9  
Old 04-19-2011, 03:20 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by ZaltysZ View Post
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.
Reply With Quote
  #10  
Old 04-19-2011, 07:35 PM
ZaltysZ's Avatar
ZaltysZ ZaltysZ is offline
Approved Member
 
Join Date: Sep 2008
Location: Lithuania
Posts: 426
Default

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);
        });
    }
}
}

Last edited by ZaltysZ; 04-20-2011 at 07:26 PM. Reason: Code change
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:11 AM.


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