Forum Mod Bakery Docs

How can I make it so before a mission my character has to go to a certain area on the map, talk to lenny, then start the mission?

Posted in Support
Please login to contribute to the conversation.
so i know the difference between the i and l files and sdi and sdl files. i just dont know where to start in doing this and so i was turned off modding these past few weeks i was turned off the making of my mod, and i now wish i asked earlier. (also you can answer on discord if you want just @NTRG in the server)
I'd use level 1-3 has start as it already has the part where you would drive to Lenny and talk to him before the start of the mission.

If you wanted to use the area and position that Lenny is in 1-3, I'd just copy both the sdi and sdl script files over to your mod. From there, you can remove the first few stages which you do not need like talking to marge, getting in your vehicle, and just leave it with driving to an area on the map and talking to Lenny. If you do not want the stage locked to a certain vehicle you would need to edit the stage where you talk to Lenny as well. This is because as you know, 1-3 forces you to drive the Plow King (well tries it best to). Here's some example code which does what I've just talked about.

Spoiler
SelectMission("m3sd");

SetMissionStartCameraName( "mission1camShape" );
SetMissionStartMulticontName( "mission1cam" );
SetAnimatedCameraName( "mission1camShape" );
SetAnimCamMulticontName( "mission1cam" );

UsePedGroup( 0 ); 

//SetInitialWalk("level1_homer_start");

SetMissionResetPlayerOutCar("level1_homer_start", "level1_carstart");
SetDynaLoadData("l1z1.p3d;l1r1.p3d;l1r7.p3d;");

AddStage(0);
	SetStageMessageIndex(253);
	SetHUDIcon("kburger");
	AddObjective("goto");
		AddNPC("lenny", "m3_lenny");
		SetDestination("m3_lardlads", "carsphere");
		SetCollectibleEffect("wrench_collect");
	CloseObjective();
CloseStage();

AddStage(0);
	SetStageMessageIndex(6);
	SetHUDIcon("lenny");
	AddObjective("talkto","both");
		AddNPC("lenny", "m3_lenny");
		AddObjectiveNPCWaypoint( "lenny", "lenny_walk_1" );
		AddObjectiveNPCWaypoint( "lenny", "lenny_walk_2" );
		SetTalkToTarget("lenny", 0, 0);
	CloseObjective();
CloseStage();

AddStage(0);
	SetStageMessageIndex(0);
	AddObjective("dialogue");
		SetConversationCam( 0, "npc_far" );
		SetConversationCam( 1, "pc_near" );
		SetConversationCam( 2, "npc_far" );
		SetConversationCam( 3, "pc_near" );
		AmbientAnimationRandomize( 1, 0 );      // ( pc=0, npc=1) (nonrandom=0, random=1)
		AmbientAnimationRandomize( 0, 0 );
		AddAmbientNpcAnimation( "dialogue_cross_arms" );
		AddAmbientNpcAnimation( "none" );
		AddAmbientNpcAnimation( "dialogue_yes" );
		AddAmbientNpcAnimation( "none" );
		AddAmbientPcAnimation( "none" );
		AddAmbientPcAnimation( "dialogue_no" );
		AddAmbientPcAnimation( "none" );
		AddAmbientPcAnimation( "dialogue_thinking" );
		SetCamBestSide( "m3_bestside");
		SetDialogueInfo("homer","lenny","churro",0);
		SetDialoguePositions("m3_homer_lenny","lenny_walk_2","barney_car");
	CloseObjective();
CloseStage();

CloseMission();
This will spawn you at the simpsons house, make you drive the the Krusty Burger, make you talk to Lenny then start the mission.

-----

If you wanted to drive to somewhere else other than the krusty burger and talk to Lenny, you'd need to edit some of the locators inside of the level.p3d file

In the scripts you can find out what locators are being used. For example in the m3sdi.mfk file, Lenny is placed at the locator m3_lenny where he also has 2 waypoints which are lenny_walk_1 and lenny_walk_2. You don't have to do waypoints. You can just have the character standing in the same spot but that's up to you. To make this easier the P3D editor has a "from game" button, which allows you to set the position of that locator to the place where you are in game.
You could also can use preexisting locators that are already in the level.p3d.

Setting a HUD icon is pretty easy. You'll be looking for something like SetHUDIcon("kburger");
You can change this to any HUD icon you wanted. They'll all be located in art\frontend\dynaload\images\msnicons. You just use the name of the p3d file without the file extension. So if i wanted to use the school.p3d HUD icon I'd type SetHUDIcon("school");

Make sure you load the icon(s) inside of the sdl file else they will not work.
The same goes with the mission scripts. Make sure you load them in the l file.

Important note: With things like a place where you have to drive to or an item you have to pick up, make sure you set the position of the trigger inside of the locator as well. There's a "from locator" button which will come in handy. If you don't do this, you'll see the locator in game (either an item or a circle on the floor) but, you wouldn't be able to trigger it/collect it.

If I've missed something or you need anymore help just ask.
Sorry if this post is a bit scrappy. Pretty sure it's my first one or at least one of my first ones.
Thanks, I'll be sure to give it a go when I'm on my computer again! :)