Forum Mod Bakery Docs

A Problem in M7 of Race Battle Mod

Posted in Support
Please login to contribute to the conversation.
(Sorry I leaked a bit of Race Battle Mod, but I have to since there's a problem.)

So, while working on Race Battle Mod, I decided to try and make unique missions where the player teams up with a random character to save the next character, but when doing the first level, something happened, here's what I put in the m7i file:



SelectMission("m7");

SetMissionResetPlayerInCar("m7_flamix_carstart");
SetDynaLoadData("l1z1.p3d;l1r1.p3d;l1r7.p3d;");
InitLevelPlayerVehicle("wiggu_v2","m7_flamix_carstart","OTHER");

SetNumValidFailureHints( 5 );

UsePedGroup( 0 );

SetForcedCar();

AddStage(0);
SetStageMessageIndex(01);
NoTrafficForStage();
SetHUDIcon("tgxbus");
AddStageVehicle("tgxbus","m7_aicar_carstart","target","Missions\level01\M7bus.con", "joras");
AddStageVehicleCharacter("tgxbus", "bart2","pl",180);
AddStageWaypoint( "d1_path1" );
AddStageWaypoint( "d1_path4" );
AddStageWaypoint( "d1_path6" );
AddStageWaypoint( "d1_path8" );
AddStageWaypoint( "d1_path10" );
AddStageWaypoint( "d1_path11" );
AddStageWaypoint( "d1_path13" );
AddStageWaypoint( "d1_path14" );
DisableHitAndRun();
SetStageTime(299);
StartCountdown("count");
AddToCountdownSequence( "3", 1000 ); // duration time in milliseconds
AddToCountdownSequence( "2", 1000 ); // duration time in milliseconds
AddToCountdownSequence( "1", 900 ); // duration time in milliseconds
AddToCountdownSequence( "GO", 400 ); // duration time in milliseconds
AddObjective("destroy");
SetObjTargetVehicle("tgxbus");
CloseObjective();
AddCondition("timeout");
//SetHitNRun();
CloseCondition();
AddCondition("outofvehicle");
SetCondTime( 10000 );
CloseCondition();
AddCondition( "damage" );
SetCondMinHealth( 0.0 );
SetCondTargetVehicle( "wiggu_v2" );
CloseCondition();
ShowStageComplete();
SetIrisWipe(0.1);
CloseStage();

AddStage(0);
SetHUDIcon("simpsons");
SetStageMessageIndex(02);
AddObjective( "goto" );
AddStageVehicleCharacter("wiggu_v2", "bart2","pl_2",180);
RemoveStageVehicleCharacter("tgxbus", "bart2");
SetDestination( "m7_simpsonhouse_sd", "carsphere");
SetCollectibleEffect("wrench_collect");
CloseObjective();
SetStageTime(150);
AddCondition("timeout");
CloseCondition();
AddCondition("outofvehicle");
SetCondTime( 10000 );
CloseCondition();
AddCondition( "damage" );
SetCondMinHealth( 0.0 );
SetCondTargetVehicle( "wiggu_v2" );
CloseCondition();
ShowStageComplete();
SetIrisWipe(0.1);
CloseStage();

AddStage(0);
AddStageCharacter("flamix", "m7_flamix_end", "", "flamix_v", "m7_carend");
AddNPC("bart2", "m7_cody_sd");
RemoveStageVehicleCharacter("wiggu_v2", "bart2");
AddStageVehicle("wiggu_v","m7_somecop_carstart","NULL","Missions\level01\M7somecop.con", "somecop");
AddObjective("timer");
SetDurationTime(9);
CloseObjective();
CloseStage();

AddStage("final");
ActivateVehicle("wiggu_v","NULL","evade");
AddStageWaypoint( "d1_path1" );
AddStageWaypoint( "d1_path4" );
AddStageWaypoint( "d1_path6" );
AddStageWaypoint( "d1_path8" );
AddStageWaypoint( "d1_path10" );
AddStageWaypoint( "d1_path11" );
AddStageWaypoint( "d1_path13" );
AddStageWaypoint( "d1_path14" );
AddObjective("timer");
SetDurationTime(4);
CloseObjective();
CloseStage();

CloseMission();

And here's what's in the m7l file:

LoadP3DFile("art\missions\level01\m7.p3d");

LoadDisposableCar("art\cars\tgxbus.p3d","tgxbus","AI");
LoadDisposableCar("art\cars\wiggu_v.p3d","wiggu_v","AI");
LoadDisposableCar("art\cars\wiggu_v2.p3d","wiggu_v2","OTHER");

LoadP3DFile( "art\frontend\dynaload\images\msnicons\vehicle\tgxbus.p3d" );
LoadP3DFile( "art\frontend\dynaload\images\msnicons\location\simpsons.p3d" );



I have no idea if I'm doing something wrong, but if anyone can help me, that would be great, and I'll be able to continue working on the mod!

No copyright infringement intended.

Everything belongs to their respective owners like Somebot, ImmortalFlamixGod, Ect.
Out of curiosity, what exactly is the issue with this mission script? Does the game crash while it's on the Mission Briefing illustration screen? Or does another aspect of the mission not work correctly (such as crashing on a specific stage)? I am noticing that the copy of Wiggum's car that the player uses in the mission doesn't appear to be swapped out properly.

On another note, while I do understand that you and IFG are collaborating together, I'm not entirely certain if SomeBot is comfortable with a character model he created being used in this mod. Have you contacted him personally about this through his Discord account or elsewhere (such as his YouTube channel) about using the SomeCop model?
Shall I help You? P.S. I subscribed to you here
Out of curiosity, what exactly is the issue with this mission script? Does the game crash while it's on the Mission Briefing illustration screen? Or does another aspect of the mission not work correctly (such as crashing on a specific stage)? I am noticing that the copy of Wiggum's car that the player uses in the mission doesn't appear to be swapped out properly.

On another note, while I do understand that you and IFG are collaborating together, I'm not entirely certain if SomeBot is comfortable with a character model he created being used in this mod. Have you contacted him personally about this through his Discord account or elsewhere (such as his YouTube channel) about using the SomeCop model?

First off, it does crash on the Mission Briefing illustration screen. Secondly, I didn't realise that I didn't swap the vehicles out correctly. Third, I have contacted SomeBot on his YT channel, but I had to use one of the videos. I also asked him if I could use Glitch Model too just in case. Anyways, I would love some help on how to make this mission work. If you show me how it could work, then I'll be more than happy so I can continue working on the other levels!
Apologies for the late reply. Again, I imagine SomeBot might not be entirely comfortable with the idea of those models being used, so I would highly advise contacting him about it.

I'm actually not entirely certain that swapping out the forced vehicle matters in most situations, but it's worth doing to bring the player's default vehicle back in without having to go through the Phonebooth whenever possible!

I'm still looking through the script, but I'm not seeing any immediate issues with it that seem like they would cause crashing?

  • According to current documentation, AddStageVehicleCharacter will default to adding an NPC model to the vehicle's 'pl' joint at 180 degrees. This means that you don't need to specify where 'bart2' goes in the first instance use. AddStageVehicleCharacter("tgxbus", "bart2"); on it's own would be fine.
  • Does wiggu_v have a 'pl_2' joint? Bart likely will not appear in the vehicle properly if the car doesn't have one.
  • Do all the locators appear to be present in the modified m7.p3d you're loading? An invalid waypoint name or referring to a waypoint that doesn't exist should instantly crash the game.
  • Does the game appear to crash if you were to remove all of the stages except the first one? A quick and dirty way to easily debug missions is to just remove most of the stages and throw them into a temporary text bin and slowly add them back. The mission will end abruptly once the first (and only) stage is cleared, but it's a good way to easily test if there's something wrong with one of the later stages.

If all else fails, Lucas' Mod Launcher stores crash debug logs in [usernamehere]\Documents\My Games\Lucas' Simpsons Hit & Run Mod Launcher\Crashes. If you could, are you able to upload the very latest crash file and upload it to a file sharing service such as Dropbox, Google Drive, or MEGA? It's possible to analyze the crash file the Launcher generates to help pinpoint the exact issue. Thank you.
Apologies for the late reply. Again, I imagine SomeBot might not be entirely comfortable with the idea of those models being used, so I would highly advise contacting him about it.

I'm actually not entirely certain that swapping out the forced vehicle matters in most situations, but it's worth doing to bring the player's default vehicle back in without having to go through the Phonebooth whenever possible!

I'm still looking through the script, but I'm not seeing any immediate issues with it that seem like they would cause crashing?

  • According to current documentation, AddStageVehicleCharacter will default to adding an NPC model to the vehicle's 'pl' joint at 180 degrees. This means that you don't need to specify where 'bart2' goes in the first instance use. AddStageVehicleCharacter("tgxbus", "bart2"); on it's own would be fine.
  • Does wiggu_v have a 'pl_2' joint? Bart likely will not appear in the vehicle properly if the car doesn't have one.
  • Do all the locators appear to be present in the modified m7.p3d you're loading? An invalid waypoint name or referring to a waypoint that doesn't exist should instantly crash the game.
  • Does the game appear to crash if you were to remove all of the stages except the first one? A quick and dirty way to easily debug missions is to just remove most of the stages and throw them into a temporary text bin and slowly add them back. The mission will end abruptly once the first (and only) stage is cleared, but it's a good way to easily test if there's something wrong with one of the later stages.

If all else fails, Lucas' Mod Launcher stores crash debug logs in [usernamehere]\Documents\My Games\Lucas' Simpsons Hit & Run Mod Launcher\Crashes. If you could, are you able to upload the very latest crash file and upload it to a file sharing service such as Dropbox, Google Drive, or MEGA? It's possible to analyze the crash file the Launcher generates to help pinpoint the exact issue. Thank you.

I've got good news! After trying out the stage by stage, I found the problem! It appears that the Timer objective was in the wrong place for the last two stages! After tweaking them, this is what it now looks like.

SelectMission("m7");

SetMissionResetPlayerInCar("m7_flamix_carstart");
SetDynaLoadData("l1z1.p3d;l1r1.p3d;l1r7.p3d;");
InitLevelPlayerVehicle("wiggu_v2","m7_flamix_carstart","OTHER");

SetNumValidFailureHints( 5 );

UsePedGroup( 0 );

SetForcedCar();

AddStage(0);
SetStageMessageIndex(01);
NoTrafficForStage();
SetHUDIcon("tgxbus");
AddStageVehicle("tgxbus","m7_aicar_carstart","target","Missions\level01\M7bus.con", "joras");
AddStageVehicleCharacter("tgxbus", "bart2");
AddStageWaypoint( "d1_path1" );
AddStageWaypoint( "d1_path4" );
AddStageWaypoint( "d1_path6" );
AddStageWaypoint( "d1_path8" );
AddStageWaypoint( "d1_path10" );
AddStageWaypoint( "d1_path11" );
AddStageWaypoint( "d1_path13" );
AddStageWaypoint( "d1_path14" );
DisableHitAndRun();
SetStageTime(299);
StartCountdown("count");
AddToCountdownSequence( "3", 1000 ); // duration time in milliseconds
AddToCountdownSequence( "2", 1000 ); // duration time in milliseconds
AddToCountdownSequence( "1", 900 ); // duration time in milliseconds
AddToCountdownSequence( "GO", 400 ); // duration time in milliseconds
AddObjective("destroy");
SetObjTargetVehicle("tgxbus");
CloseObjective();
AddCondition("timeout");
//SetHitNRun();
CloseCondition();
AddCondition("outofvehicle");
SetCondTime( 10000 );
CloseCondition();
AddCondition( "damage" );
SetCondMinHealth( 0.0 );
SetCondTargetVehicle( "wiggu_v2" );
CloseCondition();
ShowStageComplete();
SetIrisWipe(0.1);
CloseStage();

AddStage(0);
SetHUDIcon("simpsons");
SetStageMessageIndex(02);
AddObjective( "goto" );
AddStageVehicleCharacter("wiggu_v2", "bart2","pl_2",180);
RemoveStageVehicleCharacter("tgxbus", "bart2");
SetDestination( "m7_simpsonhouse_sd", "carsphere");
SetCollectibleEffect("wrench_collect");
CloseObjective();
AddCondition("outofvehicle");
SetCondTime( 10000 );
CloseCondition();
AddCondition( "damage" );
SetCondMinHealth( 0.0 );
SetCondTargetVehicle( "wiggu_v2" );
CloseCondition();
SetFadeOut(1.0);
ShowStageComplete();
SwapInDefaultCar();
SetSwapDefaultCarLocator("m7_carend");
SetSwapForcedCarLocator("m7_copcar_sd");
SetSwapPlayerLocator("level1_homer_walkto");
CloseStage();

AddStage(0);
AddObjective("timer");
RemoveStageVehicleCharacter("wiggu_v2", "bart2");
AddNPC("bart2", "m7_cody_sd");
AddStageVehicle("wiggu_v","m7_somecop_carstart","NULL","Missions\level01\M7somecop.con", "somecop");
SetDurationTime(9);
CloseObjective();
CloseStage();

AddStage("final");
AddObjective("timer");
ActivateVehicle("wiggu_v","NULL","evade");
AddStageWaypoint( "d1_path1" );
AddStageWaypoint( "d1_path4" );
AddStageWaypoint( "d1_path6" );
AddStageWaypoint( "d1_path8" );
AddStageWaypoint( "d1_path10" );
AddStageWaypoint( "d1_path11" );
AddStageWaypoint( "d1_path13" );
AddStageWaypoint( "d1_path14" );
SetDurationTime(5);
CloseObjective();
CloseStage();

CloseMission();

After testing this script, it actually worked perfectly! So now, L1M7 has been fixed!

Also, about SomeBot not being sure about the idea of me using his models, don't worry, I contacted him and get this, he actually allowed me to use the models! However, I have to give him credit, which is what I like doing. Giving credit is the most important thing to do in anything. Anyways, thanks for helping me fix my issue. So folks, the Mod will go on soon! I hope you're looking forward to it!

(Post merged by moderator.)

Oh, and yes, the Car: "wiggu_v2" does indeed have a pl_2 seat, so bart2 (Which is Me) will appear properly, so that's something I'm glad I done.
This post has been removed.
1 yr ago (Statistics)