E69_pupo
May-20-2013, 06:11
Hello gents!
i've pretty much finished a mission that i will launch the 30 of may. the only thing that is not working that would be nice to have working for this mission is giving kills to pilots. the mission can easely keep track of kills for the entire team, but everyone likes to check out how many did they got at the end of the mission.
this is what i have for that particular scenario
public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> damages)
{
base.OnActorDead(missionNumber, shortName, actor, damages);
if (actor is AiAircraft)
{
foreach (DamagerScore ds in damages)
if (ds.initiator != null)
{
if (ds.initiator.Actor != null)
{
foreach (pilotstat pd in pilotlist) // pilotstat is a list, snafu created and i stole it :P,
{
string message = "ds: " + ds.initiator.Actor + "\t" + pd.Pilot + "";
writelog(message); // this is just a log creator, wich writes down each ds.initator.actor followed by the pilot who its comparing to.
if (pd.Pilot == ds.initiator.Actor)
{
pd.Kills++; // this part of the code is not reached :(
GamePlay.gpHUDLogCenter("ola!");
}
}
}
}
}
the log result of the following is
[2013_05_19_20_29_50] ds: bHrtSeS5ue7OJcbn.QNZcpr86RVM 2E76W4XSdm.CuIiei6YyY9lagOd3Tq
[2013_05_19_20_29_50] ds: bHrtSeS5ue7OJcbn.QNZcpr86RVM 2E76W4XSdm.CuIiei6YyY9lagOd3Tq
meaning there are 2 Ds.initators, both "bHrtSeS5ue7OJcbn.QNZcpr86RVM", none is actually me, who is given the name "2E76W4XSdm.CuIiei6YyY9lagOd3Tq"
Ive noticed that every time i run this test, even when the kill is AI, the DS initiator is always "bHrtSeS5ue7OJcbn.QNZcpr86RVM". I suspect this DS.initiator is the ground, since all planes eventually crash.
so, any tips how to get this working?
cheers
i've pretty much finished a mission that i will launch the 30 of may. the only thing that is not working that would be nice to have working for this mission is giving kills to pilots. the mission can easely keep track of kills for the entire team, but everyone likes to check out how many did they got at the end of the mission.
this is what i have for that particular scenario
public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> damages)
{
base.OnActorDead(missionNumber, shortName, actor, damages);
if (actor is AiAircraft)
{
foreach (DamagerScore ds in damages)
if (ds.initiator != null)
{
if (ds.initiator.Actor != null)
{
foreach (pilotstat pd in pilotlist) // pilotstat is a list, snafu created and i stole it :P,
{
string message = "ds: " + ds.initiator.Actor + "\t" + pd.Pilot + "";
writelog(message); // this is just a log creator, wich writes down each ds.initator.actor followed by the pilot who its comparing to.
if (pd.Pilot == ds.initiator.Actor)
{
pd.Kills++; // this part of the code is not reached :(
GamePlay.gpHUDLogCenter("ola!");
}
}
}
}
}
the log result of the following is
[2013_05_19_20_29_50] ds: bHrtSeS5ue7OJcbn.QNZcpr86RVM 2E76W4XSdm.CuIiei6YyY9lagOd3Tq
[2013_05_19_20_29_50] ds: bHrtSeS5ue7OJcbn.QNZcpr86RVM 2E76W4XSdm.CuIiei6YyY9lagOd3Tq
meaning there are 2 Ds.initators, both "bHrtSeS5ue7OJcbn.QNZcpr86RVM", none is actually me, who is given the name "2E76W4XSdm.CuIiei6YyY9lagOd3Tq"
Ive noticed that every time i run this test, even when the kill is AI, the DS initiator is always "bHrtSeS5ue7OJcbn.QNZcpr86RVM". I suspect this DS.initiator is the ground, since all planes eventually crash.
so, any tips how to get this working?
cheers