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-21-2012, 06:04 AM
theOden theOden is offline
Approved Member
 
Join Date: May 2011
Location: Sweden
Posts: 221
Default Engine parameters

We're all able to read parameters such as fuel and engine values but has anyone found a way to set the values?

What I'm at is to set engine oil and radiator temps to "running" levels when a plane is spawned on a runway (reading birthplace data or the missionfile if more of a "coop") - beats me how they gets there with a cold engine .
__________________
Reply With Quote
  #2  
Old 04-21-2012, 11:32 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

There is no way to set them.
Reply With Quote
  #3  
Old 04-21-2012, 01:37 PM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default

Yeah can't set them unless a ground unit. this is about as close as you can get
I gave up lol maybe to drunk.
Code:
        /*       //  AiAirGroup airGroup = aircraft.AirGroup();
               // if(aircraft == airGroup.GetItems()[0])		        

               {

                   double speed = aircraft.getParameter(part.ParameterTypes.Z_VelocityTAS, -1);
                   double sFuel = aircraft.getParameter(part.ParameterTypes.S_FuelReserve, -1); // kgs
                   double iFuel = aircraft.getParameter(part.ParameterTypes.I_FuelReserve, -1); // kgs
                   int ammo = 0;
                   for (int i = 0; i < 9; i++)
                   {
                       ammo += (int)(aircraft.getParameter(part.ParameterTypes.S_GunReserve, i)); // qty
                       sFuel += (int)(aircraft.getParameter(part.ParameterTypes.S_FuelReserve, i)); // qty
                       iFuel += (int)(aircraft.getParameter(part.ParameterTypes.I_FuelReserve, i)); // qty					


                   };
                   if (ammo == 0 || sFuel < 20)

                       sFuel += 40;
                   iFuel += 40;
                   ammo += 1;

               }

       */
__________________
__________________
Win7, 64bit Ultra
Asus P8P67Pro MB
Intel i7-2600K
Coursair 16GB (4x 4GB), DDR3-1600MHz
Gainward Nvidia 580GTX 3GB DDR5
850-Watt Modular Power Supply
WIN7 and COD on Gskill SSD 240GB
40" Panasonic LCD
TrackIR5 +
Thrustmaster Warthog stick, throttle & pedals
Reply With Quote
  #4  
Old 04-21-2012, 01:41 PM
theOden theOden is offline
Approved Member
 
Join Date: May 2011
Location: Sweden
Posts: 221
Default

Thats what I suspected.
Thanks for looking into it Kodiak, I do appreciate all other efforts in scripting from you aswell.

For anyone else that might look for the same effect and ending up in this thread, I've also tried to manipulate the game settings (GamePlay.gpDifficultyGet().Engine_Temperature_Eff ects that is) in different events, still no success but here you go for future reference (all commented out at this stage):

Code:
//$debug
using System;
using System.Collections;
using maddox.game;
using maddox.game.world;
using maddox.GP;
using System.Collections.Generic;
using System.Globalization;

public class Mission : AMission
{
    //private string OdenMissionPath = "missions/Multi/Co-Op/ItalianVisit.mis";
	//private bool odenDebug = false;
    
	// Public Overrides
    public override void Init(ABattle battle, int missionNumber)
    {
        base.Init(battle, missionNumber);
        /*
	    DifficultySetting ds = GamePlay.gpDifficultyGet();
    	ds.Engine_Temperature_Effects = false;
    	GamePlay.gpDifficultyGet().set(ds);
    	Player localPlayer = GamePlay.gpPlayer();
    	GamePlay.gpLogServer(new Player[] { localPlayer }
			, "Init: {0} {1}"
			, new object[] { GamePlay.gpDifficultyGet().Engine_Temperature_Effects,ds.Engine_Temperature_Effects }
		);
		*/
	}
    public override void OnBattleStarted()
    {
	    base.OnBattleStarted();        
	    /*
	    DifficultySetting ds = GamePlay.gpDifficultyGet();
    	ds.Engine_Temperature_Effects = false;
    	GamePlay.gpDifficultyGet().set(ds);
    	Player localPlayer = GamePlay.gpPlayer();
    	GamePlay.gpLogServer(new Player[] { localPlayer }
			, "OnBattleStarted: {0} {1}"
			, new object[] { GamePlay.gpDifficultyGet().Engine_Temperature_Effects,ds.Engine_Temperature_Effects }
		);
		*/
	}

    public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
		base.OnPlaceEnter(player, actor, placeIndex);
		/*
		string bpName = "Bollocks";
		bool spawnParked = false;
		string strSpawn = "unknown";
		*/
	    /*
		DifficultySetting ds = GamePlay.gpDifficultyGet();
    	ds.Engine_Temperature_Effects = false;
    	GamePlay.gpDifficultyGet().set(ds);
    	Player localPlayer = GamePlay.gpPlayer();
    	GamePlay.gpLogServer(new Player[] { localPlayer }
			, "OnPlaceEnter {0} {1}"
			, new object[] { GamePlay.gpDifficultyGet().Engine_Temperature_Effects,ds.Engine_Temperature_Effects }
		);
		*/
		/*
		Point3d pt3d = actor.Pos();
		AiAirport homeBase = FindClosestAirfield(0,pt3d,1000);
        foreach (AiBirthPlace bp in GamePlay.gpBirthPlaces())
        {
            if (bp != null)
                if(bp.Pos().distance(ref pt3d) < 5000)
                {
                	bpName = bp.Name(); // requires proper names under [BirthPlace] in mis-file
                	spawnParked = bp.IsSetOnPark();
                	if(spawnParked) strSpawn = "parking area"; else strSpawn = "on runway";
            	};
        };	
        if(GamePlay.gpDifficultyGet().Engine_Temperature_Effects) strSpawn = "God I hate this game";
        
		AiAircraft aircraft = actor as AiAircraft;
		if(aircraft != null)
		{
			//double fuelLitres = (float)(aircraft.getParameter(part.ParameterTypes.I_FuelReserve, -1));
			GamePlay.gpLogServer(new Player[] { player }
				, "onPlaceEnter {0} is '{1}' at {2} {3}"
				, new object[]
					{	aircraft.InternalTypeName()
						, aircraft.Type() // Fighter/Bomber etc
						, bpName //homeBase.Name()
						, strSpawn
					}
			);
		};
		*/
		if(actor != null)
		{
			// debug damagedAircrafts.Add(actor as AiAircraft);
			Timeout(5, () => { GamePlay.gpHUDLogCenter(new Player[] { player }, "Find yourself home to Abbeville, Good Luck and be gentle on the engine"); });
		}
    }
		
    public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        base.OnTrigger(missionNumber, shortName, active);
        
        //if(active) GamePlay.gpHUDLogCenter("Trigger active: " +shortName);
        //else GamePlay.gpHUDLogCenter("Trigger idle: " +shortName);
        Player localPlayer = GamePlay.gpPlayer();
        if(active && localPlayer != null)
        {
	        if(shortName == "Abbeville") Timeout(5, () => { GamePlay.gpHUDLogCenter(new Player[] { localPlayer }, "Welcome back to Abbeville"); });
        }
    }
    
    //
    internal AiAirport FindClosestAirfield(int army, Point3d pt3d, int runwaylength)
    {
        AiAirport result = null;
        AiAirport[] airports = GamePlay.gpAirports();
		string sectorName;
		
        if (airports != null)
        {
            foreach (AiAirport airport in airports) 
            {
	            sectorName = GamePlay.gpSectorName(airport.Pos().x, airport.Pos().y).ToString();
				//if (GamePlay.gpFrontArmy(airport.Pos().x, airport.Pos().y) == army && airport.FieldR() > runwaylength && (sectorName.IndexOf(">") == -1 && sectorName.IndexOf("<") == -1))
				if((sectorName.IndexOf(">") == -1 && sectorName.IndexOf("<") == -1))
                {
                    if (result != null)
                    {
                        if (airport != null)
                            if (result.Pos().distance(ref pt3d) > airport.Pos().distance(ref pt3d))
                                result = airport;
                    }
                    else result = airport;                    
                }
            }
        }
        return result;
    }
    
}

Edit: ah! thanks a tonne hc_wolf, still no go though
__________________
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:14 PM.


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