theOden |
04-21-2012 01:41 PM |
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 :)
|