![]() |
|
|
|
#1
|
|||
|
|||
|
Will take a look at it.
Short answers: Code:
public static string SubMissionsPath = @"missions\Multi\Dogfight\r_steppe\subs\";
// is @ necessary here? did not use it in other missions.
Code:
// what does this block do?
public Mis(string Filename, string misType, int Lengh) // should I include all the above variables here?
{
this.Missionfilename = Filename; // You use mi.Missionfilename instead of mi.Filename in your example when load missions. Why?
this.MissionLengh = Lengh;
this.MissionType = misType;
this.TrgWasTriggered = wasTriggered;
}
So i can use Code:
public List<Mis> MissionPool = new List<Mis>()
{
new Mis ("Mission1.mis",SubMissionsPath ,1000.0),
new Mis ("Mission2.mis",SubMissionsPath ,1000.0),
};
// You use mi.Missionfilename instead of mi.Filename in your example when load missions. Why? I use the public method Missionfilename to get access to the variable in the object. Filename is only used in the constructor to give the value to the variable Missionfilename. More to come, must take a deeper look at it, but no time at the moment. But it seems you think a bit too complicated |
|
#2
|
|||
|
|||
|
Quote:
this.MissionLengh = 30; Ah, it looks like the only purpose of it is to allow data input like here: Code:
public List<Mis> MissionPool = new List<Mis>()
{
new Mis ("Mission1.mis",SubMissionsPath ,1000.0),
new Mis ("Mission2.mis",SubMissionsPath ,1000.0),
};
mi.Missionfilename = ...; mi.SubMissionsPath = ...; mi.MissionLengh = ...; Instead after parsing a file name I can: Code:
string[] MisParams;
MisParams = (mi.Missionfilename).Split('_');
Mis mi = new Mis (MisParams[1], MisParams[2],MisParams[3]);
Last edited by Ataros; 10-21-2011 at 06:30 PM. |
|
#3
|
|||
|
|||
|
first sorry for bumping an old thread.
im facing an issue implementing a "similar" (based) on this method script. my issue is, with multi-sit aircriaft. when you spawn in one of those and change seats with will result in decrease of 1 to the pool by each seat. much of the following CODE is not mine (around 90%) so no credit for it. Credit goes for Ataros, Kodiak, and some other guys, i cant recall everyone i steal from Quote:
|
|
#4
|
|||
|
|||
|
You can check if a player is already in a plane
Code:
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
{
base.OnPlaceEnter(player, actor, placeIndex);
int playercount = 0;
if (actor != null && actor is AiAircraft)
{
AiAircraft aircraft = actor as AiAircraft;
for (int i = 0; i < aircraft.Places(); i++)
{
if (aircraft.Player(i) != null)
{
if (aircraft.Player(i) == player) playercount++;
}
}
}
if (playercount == 1) ..
}
or you check PlaceSecondary, PlaceSecondary is -1 if a player is 'new' in a plane, if not new PlaceSecondary gets the value of the last secondary place. Code:
if (player.PlaceSecondary() != -1)
..
Last edited by FG28_Kodiak; 05-20-2012 at 07:42 PM. |
|
#5
|
|||
|
|||
|
A bit unrelated to the actual discussion, but what you say about primary and secondary places confirms my observations about AI gunners.
We all know that if you switch to a gunner position the AI no longer mans the turret. Flying a Blenheim on ATAG one night, i happened to find out completely by chance that if your aircraft has a bombardier position you can give back gun control to the AI: simply cycle between pilot and bombardier once and your gunners will revert to AI control. This was also reflected on the net stats overlay, where next to my nickname i could see "pilot, gunner" initially and "pilot, bombardier" after cycling positions. Thanks for confirming my suspicions |
|
#6
|
|||
|
|||
|
thank you!
Worked like a charm! |
|
#7
|
|||
|
|||
|
Hi, still on the same topic, yet a differente type of code, im tryign to get a submenu to have an option to refly.
code Quote:
sorry, but im really noob in C# |
|
#8
|
|||
|
|||
|
you get the Aircraft via player.Place()
Code:
if (player.Place() != null && player.Place() is AiAircraft)
{
AiAircraft aircraft = player.Place() as AiAircraft;
}
|
![]() |
|
|