![]() |
What class are Players flying anyway?
Scripters,
I'm writing a solution that's simulating Fighter Command to some extent (Chain Home, Observer Corps, Filter Rooms and Command). In doing so I'm also trying to implement the concept of Flight Leaders but I'm currently stuck. I mistakingly believed all Players fly AiAicrafts and that all aicrafts are in AiGroups. This it seems is only true for non-player aicrafts (hence the "Ai" part I guess :rolleyes:) and for players running in single player mode. My implementation fell apart when I tried it out on a dedicated server last night but Osprey hinted that I should probably look at the "Regiment" property instead as a basis for grouping online players together. If so, can someone help me get my head around what a "Regiment" is and how it's handled by the sim in the online (and offline) context? My initial experiment got stuck on the fact that "Regiment" is a property of AiAicraft and when I safe cast the player's AiActor to an AiAircraft i get a null result, which means whatever a Player is riding is not a AiAicraft type. I tried to find out what type is implementing AiActor for a online Players by simply fetching its type name but the resulting string is just a sequence of seemingly random letters. This is likely a remoting marshaling thingy but I still have no idea what I'm dealing with. Example: Code:
public override void OnPlaceEnter(AMission mission, Player player, AiActor actor, int placeIndex)
Thanks, Mog |
Online Player also use AiAircrafts.
You get the Aircraft (actor) via Player.Place(). The problem is if you use spawnplaces and a player creates a Aircraft, he also creates a new Airgroup. So he is always the leader of his own Airgroup. Btw. getType comes from object http://msdn.microsoft.com/en-us/libr...t.gettype.aspx |
Quote:
Is so, is the concept of a group supported for online play at all? Does the sim recognize I'm in a squad for example? That's what I assumed "Regiment" is for but I have no clue as to how it's supposed to be used. |
A Player can create also a group of planes (if Number of planes is larger than 1 in the spawnplace options) and if an other player select a plane of this created group he is part of this group, but at the moment its more a GUI problem (WPF Not available for example) so an other player cannot select the plane easily. If Icons on you can zoom maximum in and select the Icon, if Icons out you don't see the icon but if you move the cursor you get a focus on a plane you can select it. (Maddox should do some rework on the Multiplayer GUI.)
The regiment is usefull if you like to have more Information from the Airgroup you flying for. Example: You select II./StG 3 as Group (actor as AiAircraft).Regiment().gruppeNumber() gives you 2 as Gruppenummer (II.) (actor as AiAircraft).Regiment().id() gives you S7 the id of II./StG 3 was "S7" (actor as AiAircraft).Regiment().name() gives BoB_LW_StG3_II The only usefull Informations are gruppeNumber() and id() all others you can get from Airgroup also or by parsing the Airgroup name. The only way to get such a thing like a Airgroup from single created planes is over the AirgroupName i think. The first created Plane has the lowest missionNumber, all others have highers, |
Just as an option there is also the 'Callsign' property (don't know what Maddox call it in code though) and in the RAF this is the codename on the radio for the Squadron (Regiment). ie. It may be possible/easier to group squadrons by the selected callsign instead.
|
You can store the planes in a List and create your own Airgroup
|
Quote:
Thanks Kodiak, you're a champ! |
Surely the Regiment.Name() is unique? If so is it not possible to group by this? Internally it does not matter what the string is, only that groups are not confused?
What about the callsign which the pilot has selected? |
Quote:
|
Well whatever is easiest, I was just curious that's all. :)
|
All times are GMT. The time now is 02:51 PM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.