Forum Mod Bakery Docs

Mission objectives and editing level progress

Posted in Support
Please login to contribute to the conversation.
Hello all,

I'm interested in making a mod of my own and there was certain objectives I was wondering if it were possible to do. basically, what I want to do is similar to the mission in the demonstration mod where you had to destroy 3 traffic cars in total but, I wanted the targets to be CPU Bots instead of traffic cars and set an amount of them I need to destroy. So, in order to do this, I need to know if the following is possible:

1. make the cpu bots spawn in like how it happens when you get hit & run and the cop cars spawn in-front of your path or something similar? And if so, make their behavior follow the road path instead of chasing you?

2. If i'm gonna make them follow the road path, can they just follow the road without me putting a checkpoint and telling where to go?

3. obviously, making them the destroy targets?

Also, I'm wondering if it's possible to change how we unlock cars, as you win cars from each street race rather then you needing to complete all 3 to get them or adding more bonus missions in a level and win a car for each of them? or even by doing unlocking cars by level progression? An example would be you have to complete all missions from each level to unlock a car.

And finally, how do you edit the level progression or what you need to do in the level to reach 100%? I dont want wasp cameras for this mod I am going to make and I'm gonna have a lot more cars in it.

This might be more of a developer question but, would appreciate your help and suggestions for me to achieve this.

Cheers

Adro
Hi Adro,

Check out the Mission's p3d file in the art/missions folder. You'll find the locators you're after. Create a Locator Type 3 for spawning and a Locator Type 0 for AI waypoints.

Yes, you'll have to give them a waypoint to follow, they won't follow the road by themselves. For tips on how to make these missions, decompile the Demonstration Mod and see how it all works.

You can edit how you unlock cars in rewards.mfk in the scripts/missions folder. Not sure about level progression.
Level progress stats will bug if under or over the max amount of rewards, This is a bug with the script functionality and stupid Radical.... but if you are meaning the rewards that you buy like cars, then you want to modify the P3D for that reward and edit the rewards.mfk IF you did make any changes.
Yeah, i know how to spawn ai normally, but i want them to spawn like police cars do when you get hit and run when they spawn in your area and continuously because, i might have a goal of destroying 10 cars to complete the mission and if i did it the normal way, it wouldn't work properly because, ill have to keep making a new task to go back to where the cars spawn and load the 4 cars again, which i dont want that. Otherwise, i can make it so you jave to destroy police cars instead but, i dont want the busted 50 coins trigger to be active, ot would be too hard that way.

I know how to edit rewards but, im wondering if you can make more ways to unlcok cars instead of what we got now (buying, winning all 3 races, and bonus missions). For example, you can unllock a car after doing a main mission or even adding more bonus missions to a level would be good.

If someone could tell if it's possible, would appreciate the help.
You can do that but the cars have to be police cars. Make sure you have the latest version of the Mod Launcher. Add a line in your meta.ini:
[Miscellaneous]
RequiredHack=AdditionalScriptFunctionality

Add this to your stage:
SetStageHitAndRun(100);
SetStageHitAndRunDecayHitAndRun(0); //lasts forever
SetStageHitAndRunFine(0); //no fine
SetStageCarChangeHitAndRunChange(0);
SetNoHitAndRunMusicForStage();
Add this objective:
AddObjective("destroycars");
AddObjTargetModel("cPolice"); //any car using this model can be destroyed
SetObjTotal(10);
CloseObjective();
The only issue is, I'm not sure how easy it is to destroy Hit & Run cars, I've seen them smoke, so it's possible. If you really want the cars you destroy to not be police cars go into the leveli.mfk file found in the scripts/missions folder and find these lines of code:
CreateChaseManager("cPolice","Pursuit\L1cop.con",1);
SetHitAndRunDecay(3.0);
SetNumChaseCars("2");
Here you can change the car model used for the Hit and Run cars and the number of cars chasing you. Keep in mind, you have to tell the level.mfk file, found in the same folder, to load that particular model of car. The catch is: this changes the cars chasing you in the whole level. So, up to you.
Oh awesome but, one question, if you set this command 'SetStageHitAndRunFine(0);' will that just make it so the fine is 0 or will it make it so if they do catxh you and make you stop, the hit and run won't be over and they continue to chase you, even if they stop you? If you understand what i am saying
No. A possible solution is adding this condition:
AddCondition("hitandruncaught");
CloseCondition();
That way, in the event of being caught, the mission will have to be restarted.
Damn, thats gonna make it too hard then, there will be a lot of times where you'll stop close to them and get caught, unless the developers make a (disablehitandruncaught) command, that would be good.
You can just have the player destroy traffic cars. See which car models are used in the level in the leveli.mfk:
//ADDING TRAFFIC GROUP FOR LEVEL 01//
//
CreateTrafficGroup( 0 );
AddTrafficModel( "minivanA",2 );
AddTrafficModel( "glastruc",1,1 );
AddTrafficModel( "schoolbu",1,1 );
AddTrafficModel( "pickupA",1 );
CloseTrafficGroup( );
In the objective, just keep adding "AddObjTargetVehicle" for each traffic car used. Unfortunately, the cars won't have any AI.
That is an option but, its not the way i want it unfortunately