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 > CoD Multiplayer

CoD Multiplayer Everything about multiplayer in IL-2 CoD

Reply
 
Thread Tools Display Modes
  #1  
Old 06-07-2011, 11:06 AM
SYN_Flashman SYN_Flashman is offline
Approved Member
 
Join Date: Feb 2011
Posts: 48
Default

Quote:
Originally Posted by TheEnlightenedFlorist View Post
I added code to the script to deal with aircraft with more than two engines. Courtesy of ZaltysZ.



I swear I remember this bug, but I just went through every German aircraft with more than one position and couldn't reproduce it. The engine stuttered a little (could just be a sound bug), but the temperatures remained the same.
AFAIK this only happens on dedicated servers when online hence the difficulty in tracking it down! It certainly happens on the Syndicate Server. I will have a look at some of the extra bits of code and do some testing on our server when I get the opportunity.
Reply With Quote
  #2  
Old 06-08-2011, 02:11 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

Quote:
Originally Posted by SYN_Flashman View Post
AFAIK this only happens on dedicated servers when online hence the difficulty in tracking it down! It certainly happens on the Syndicate Server. I will have a look at some of the extra bits of code and do some testing on our server when I get the opportunity.
Yep. Only happens on dedicated servers.
Reply With Quote
  #3  
Old 06-11-2011, 06:23 PM
pirke pirke is offline
Approved Member
 
Join Date: Aug 2010
Posts: 30
Default

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

public override void OnAircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft)
{
base.OnAircraftCrashLanded(missionNumber, shortName, aircraft);
Timeout(300, () =>
{ destroyPlane(aircraft); }
);
}
public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft)
{
base.OnAircraftLanded(missionNumber, shortName, aircraft);
Timeout(300, () =>
{ destroyPlane(aircraft); }
);
}

private bool isAiControlledPlane(AiAircraft aircraft)
{
if (aircraft == null)
return false;

//check if a player is in any of the "places"
for (int i = 0; i < aircraft.Places(); i++)
if (aircraft.Player(i) != null)
return false;

return true;
}

private void destroyPlane(AiAircraft aircraft)
{
if (aircraft != null)
aircraft.Destroy();
}

private void damageAiControlledPlane(AiActor actorMain)
{
foreach (AiActor actor in actorMain.Group().GetItems())
{
if (actor == null || !(actor is AiAircraft))
return;

AiAircraft aircraft = (actor as AiAircraft);

if (!isAiControlledPlane(aircraft))
return;

if (aircraft == null)
return;

aircraft.hitNamed(part.NamedDamageTypes.ControlsEl evatorDisabled);
aircraft.hitNamed(part.NamedDamageTypes.ControlsAi leronsDisabled);
aircraft.hitNamed(part.NamedDamageTypes.ControlsRu dderDisabled);
aircraft.hitNamed(part.NamedDamageTypes.FuelPumpFa ilure);
int iNumOfEngines = (aircraft.Group() as AiAirGroup).aircraftEnginesNum();
for (int i = 0; i < iNumOfEngines; i++)
{
aircraft.hitNamed((part.NamedDamageTypes)Enum.Pars e(typeof(part.NamedDamageTypes), "Eng" + i.ToString() + "TotalFailure"));
}


Timeout(300, () =>
{ destroyPlane(aircraft); }
);
}
}





all is good but ......

When a player abandons a plane, script will disable controls and engines and remove the plane after 300 seconds.

this not working

AI continue to fly with no restriction

pls some help with this part only

THNKS
Reply With Quote
  #4  
Old 06-11-2011, 11:24 PM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

Hi pirke, there are spaces in these lines that shouldn't be there.

Code:
aircraft.hitNamed(part.NamedDamageTypes.ControlsEl evatorDisabled);
aircraft.hitNamed(part.NamedDamageTypes.ControlsAi leronsDisabled);
aircraft.hitNamed(part.NamedDamageTypes.ControlsRu dderDisabled);
aircraft.hitNamed(part.NamedDamageTypes.FuelPumpFa ilure);
If that doesn't work, can you post the script file that you are using? Copying and pasting things back and forth makes errors more likely. It would be easier to see the .cs file.
Reply With Quote
  #5  
Old 06-12-2011, 09:47 AM
pirke pirke is offline
Approved Member
 
Join Date: Aug 2010
Posts: 30
Default

here look how i do it and you have mission i made for 1vs1 duel.
when aircraft land or crash land script do right.
but when in air when a player abandons a plane script didnt work right
look and repair scrip to make it right
PLS
Attached Files
File Type: zip test.zip (1.4 KB, 4 views)
Reply With Quote
  #6  
Old 06-12-2011, 10:00 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

Quote:
Originally Posted by pirke View Post
here look how i do it and you have mission i made for 1vs1 duel.
when aircraft land or crash land script do right.
but when in air when a player abandons a plane script didnt work right
look and repair scrip to make it right
PLS
OK. I see the problem. I fixed your code and re-uploaded it. Tomorrow, I will edit the first post to be more clear.
Attached Files
File Type: zip test.zip (1.5 KB, 19 views)
Reply With Quote
  #7  
Old 06-12-2011, 10:18 AM
pirke pirke is offline
Approved Member
 
Join Date: Aug 2010
Posts: 30
Default

thnks
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:23 PM.


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