frantic69
09-20-2012, 06:31 PM
Hello,
This question, I am sure, is going to be stupid but I can't my error so I would like yout help.
I just want to do something very simple. I have a basic mission. Two aircraft. One spitfire is the player aicraft. the second one is an AI aircraft.
I just want to show on the screen the IAS of the AI aircraft. I tryed this code but it doesn't work :
AiActor actor1 = GamePlay.gpActorByName("0:BoB_RAF_F_111Sqn_Early.000");
actor1AC = (AiAircraft)actor1;
I_VelocityIAS = actor1AC.getParameter(part.ParameterTypes.I_Veloci tyIAS, -1);
GamePlay.gpHUDLogCenter(I_VelocityIAS.ToString("0.00"));
Here is the information of the mission file :
[PARTS]
core.100
bob.100
[MAIN]
MAP Land$English_Channel_1940
BattleArea 150000 100000 100000 150000 1000
TIME 12
WeatherIndex 0
CloudsHeight 1000
BreezeActivity 10
ThermalActivity 10
player BoB_RAF_F_FatCat_Early.010
[GlobalWind_0]
Power 3.000 0.000 0.000
BottomBound 0.00
TopBound 1500.00
GustPower 5
GustAngle 45
[splines]
[AirGroups]
BoB_RAF_F_111Sqn_Early.01
BoB_RAF_F_FatCat_Early.02
[BoB_RAF_F_111Sqn_Early.01]
Flight0 1
Class Aircraft.SpitfireMkIIa
Formation VIC3
CallSign 30
Fuel 100
Weapons 1
Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[BoB_RAF_F_111Sqn_Early.01_Way]
NORMFLY 223611.44 219441.60 500.00 300.00
NORMFLY 224401.69 221617.65 600.00 300.00
NORMFLY 226420.38 223833.00 800.00 300.00
NORMFLY 227804.64 224893.02 900.00 300.00
NORMFLY 228776.17 226076.11 900.00 300.00
NORMFLY 228164.13 227020.51 900.00 300.00
NORMFLY 226536.33 228066.96 900.00 300.00
NORMFLY 223687.67 227233.68 1000.00 330.00
NORMFLY 222253.65 223435.46 1200.00 350.00
NORMFLY 220974.66 211982.69 500.00 300.00
[BoB_RAF_F_FatCat_Early.02]
Flight1 11
Class Aircraft.SpitfireMkIIa
Formation VIC3
CallSign 26
Fuel 100
Weapons 1
Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[BoB_RAF_F_FatCat_Early.02_Way]
NORMFLY 223596.35 219416.27 500.00 300.00
[CustomChiefs]
[Stationary]
[Buildings]
[BuildingsLinks]
As you can see, the AI aircraft is from the 111 suadron. It ID in the mission file is BoB_RAF_F_111Sqn_Early.01. If I am not wrong, the name to put in the script is a bit different : 0:BoB_RAF_F_111Sqn_Early.000
But, it doesn't work. Could you tell me if you have any idea. Either by modifiying my code or if you have any code that works.
Thank you
This question, I am sure, is going to be stupid but I can't my error so I would like yout help.
I just want to do something very simple. I have a basic mission. Two aircraft. One spitfire is the player aicraft. the second one is an AI aircraft.
I just want to show on the screen the IAS of the AI aircraft. I tryed this code but it doesn't work :
AiActor actor1 = GamePlay.gpActorByName("0:BoB_RAF_F_111Sqn_Early.000");
actor1AC = (AiAircraft)actor1;
I_VelocityIAS = actor1AC.getParameter(part.ParameterTypes.I_Veloci tyIAS, -1);
GamePlay.gpHUDLogCenter(I_VelocityIAS.ToString("0.00"));
Here is the information of the mission file :
[PARTS]
core.100
bob.100
[MAIN]
MAP Land$English_Channel_1940
BattleArea 150000 100000 100000 150000 1000
TIME 12
WeatherIndex 0
CloudsHeight 1000
BreezeActivity 10
ThermalActivity 10
player BoB_RAF_F_FatCat_Early.010
[GlobalWind_0]
Power 3.000 0.000 0.000
BottomBound 0.00
TopBound 1500.00
GustPower 5
GustAngle 45
[splines]
[AirGroups]
BoB_RAF_F_111Sqn_Early.01
BoB_RAF_F_FatCat_Early.02
[BoB_RAF_F_111Sqn_Early.01]
Flight0 1
Class Aircraft.SpitfireMkIIa
Formation VIC3
CallSign 30
Fuel 100
Weapons 1
Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[BoB_RAF_F_111Sqn_Early.01_Way]
NORMFLY 223611.44 219441.60 500.00 300.00
NORMFLY 224401.69 221617.65 600.00 300.00
NORMFLY 226420.38 223833.00 800.00 300.00
NORMFLY 227804.64 224893.02 900.00 300.00
NORMFLY 228776.17 226076.11 900.00 300.00
NORMFLY 228164.13 227020.51 900.00 300.00
NORMFLY 226536.33 228066.96 900.00 300.00
NORMFLY 223687.67 227233.68 1000.00 330.00
NORMFLY 222253.65 223435.46 1200.00 350.00
NORMFLY 220974.66 211982.69 500.00 300.00
[BoB_RAF_F_FatCat_Early.02]
Flight1 11
Class Aircraft.SpitfireMkIIa
Formation VIC3
CallSign 26
Fuel 100
Weapons 1
Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[BoB_RAF_F_FatCat_Early.02_Way]
NORMFLY 223596.35 219416.27 500.00 300.00
[CustomChiefs]
[Stationary]
[Buildings]
[BuildingsLinks]
As you can see, the AI aircraft is from the 111 suadron. It ID in the mission file is BoB_RAF_F_111Sqn_Early.01. If I am not wrong, the name to put in the script is a bit different : 0:BoB_RAF_F_111Sqn_Early.000
But, it doesn't work. Could you tell me if you have any idea. Either by modifiying my code or if you have any code that works.
Thank you