Hello world!
I'm currently working on quite a large callout pack, and figured I would extend the reach of realism by adding smaller less exciting events. Anyways, I've been working on this one for the last few hours because I truly do not understand where I am going wrong. This callout is simply a fight, with random 2-4 people. However, when accepting the callout it ends immediately.
My error message
[4/14/2020 11:07:07 PM.423] LSPD First Response: Creating FightInProgressSimple from _970Callouts.Callouts.FightInProgressSimple, 970Callouts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
[4/14/2020 11:07:07 PM.425] LSPD First Response: [TRACE] Callout created: #1
[4/14/2020 11:07:07 PM.427] LSPD First Response: 970Callouts-FightInProgressSimple is starting
[4/14/2020 11:07:07 PM.430] LSPD First Response: 970Callouts-FightInProgressSimple has created peds and tested them, creating map info and notification
[4/14/2020 11:07:09 PM.985] LSPD First Response: Fighters exists and blip created, route enabled.
[4/14/2020 11:07:09 PM.986] LSPD First Response: [TRACE] Cleaning UI
[4/14/2020 11:07:09 PM.988] LSPD First Response: [TRACE] User accepted callout
[4/14/2020 11:07:10 PM.011] LSPD First Response: Relations are made and hateful!
[4/14/2020 11:07:10 PM.021] LSPD First Response: Error while processing callout: FightInProgressSimple: Object reference not set to an instance of an object. at _970Callouts.Callouts.FightInProgressSimple.Process()
[4/14/2020 11:07:10 PM.021] at }qtN\]S"~D86<\*myV\\n$aS>(D#./}lr8sR\8K&Zf!wztK{:+U<1"() in E:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager.cs:line 184
[4/14/2020 11:07:10 PM.022] LSPD First Response: EndCurrentCallout: Finishing...
[4/14/2020 11:07:10 PM.022] LSPD First Response: FightInProgressSimple is starting cleanup!
[4/14/2020 11:07:10 PM.023] LSPD First Response: FightInProgressSimple is cleaned up!
[4/14/2020 11:07:10 PM.023] LSPD First Response: [TRACE] Cleaning UI
[4/14/2020 11:07:10 PM.025] LSPD First Response: [TRACE] Released 0 entities from #1 Content Manager
[4/14/2020 11:07:10 PM.025] LSPD First Response: [TRACE] Instance cleaned ( #1)
My code pertaining to Process()
public override void Process() //ON CALLOUT ACCEPTED AND WORKING//
{
base.Process();
new RelationshipGroup("Group1");
new RelationshipGroup("Group2"); //fighting groups are made
Fighter1.RelationshipGroup = "Group1";
Fighter2.RelationshipGroup = "Group2";
if (Fighter3.Exists()) Fighter3.RelationshipGroup = "Group1"; // groups are assigned
if (Fighter4.Exists()) Fighter4.RelationshipGroup = "Group2";
Game.SetRelationshipBetweenRelationshipGroups("Group1", "Group2", Relationship.Hate);
Game.SetRelationshipBetweenRelationshipGroups("Group2", "Group1", Relationship.Hate); //hate relationships made
Game.LogTrivial("Relations are made and hateful!");
if (Game.LocalPlayer.Character.Position.DistanceTo(SpawnPoint) <= 75f && !IsPursuit) //player gets close, pursuit starts, peds are added.
{
Fighter1.Tasks.FightAgainstClosestHatedTarget(50F);
Fighter2.Tasks.FightAgainstClosestHatedTarget(50F);
if (Fighter3.Exists()) Fighter3.Tasks.FightAgainstClosestHatedTarget(50F); //fighters begin fighting enemy, hopefully
if (Fighter4.Exists()) Fighter4.Tasks.FightAgainstClosestHatedTarget(50F);
pursuit = Functions.CreatePursuit();
Functions.AddPedToPursuit(pursuit, Fighter1);
Functions.AddPedToPursuit(pursuit, Fighter2);
if (Ro == 3)
{
Functions.AddPedToPursuit(pursuit, Fighter3); // adding fighters, if applicable, to the pursuit
}
if (Ro == 4)
{
Functions.AddPedToPursuit(pursuit, Fighter3);
Functions.AddPedToPursuit(pursuit, Fighter4);
}
Functions.SetPursuitIsActiveForPlayer(pursuit, true);
IsPursuit = true;
Game.LogTrivial("Pursuit has started with any existing fighters");
}