![]() |
ActorByName stupid question
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.0 00"); 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 |
It looks to me as though your assigning aircraft "0:BoB_RAF_F_111Sqn_Early.0 00" as actor1 but the aircraft in the mission is "BoB_RAF_F_111Sqn_Early.01". A line like this might help overcome the actor numbering issue:
AiActor actor1 = GamePlay.gpActorByName("0:BoB_RAF_F_111Sqn_Early.1 00"); |
Hello Salmo,
This is strange but I saw somewhere on internet that the name found in the mission file is not exactly the name you have to put in the script : http://forum.sturmovik.de/index.php?topic=938.0 000 means the first group and 001 is the second in this group, 002 the third and so on. 010 means the second group and 011 is the second in this group and 0012 the third and so on So, according to the fact that there is only one aircraft in the BoB_RAF_F_111Sqn_Early group, I thnik the Actorname should be "0:BoB_RAF_F_111Sqn_Early.000" But is doen't work :!: |
You mistake is not the actorname, its correct, but you used
Code:
(part.ParameterTypes.I_VelocityIAS, -1); Code:
(part.ParameterTypes.Z_VelocityIAS, -1); |
Quote:
http://www.sukhoi.ru/forum/showthrea...=1#post1896460 Code:
/// [Misc.: Machine Spatial Coordinates] |
hello guys,
Thank you very much for your help. You are right Kodiak (one more time :)). This is not my instrument that I want to see but the AI instrument. So, I changed the I to Z and it works. Thanks again, |
All times are GMT. The time now is 04:24 PM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.