Forum Mod Bakery Docs

Creating a Mission: How to Make an Item-Collecting Mission

Posted in Support
Please login to contribute to the conversation.
What are Item-Collecting missions?
Item-collecting missions are missions where you must go around a certain area and collect items - such as the monkeys in Level 2 Mission 6, or the cola cans in Level 4 Mission 6.

Before Starting...
Before you create an item-collecting mission, you should probably read the Creating a Mission: The Basics thread.

Creating the Mission
In your level's mission file, create a new stage with the following objective:
AddObjective( "delivery" )

CloseObjective()
In this objective, you may add up to 30 items to collect. Use the following to add them:
AddCollectible( "F", "G")
...where F is the name of the item in the mission's .p3d file, and G is the actual item model (such as "monkey" or "i_cola" (cola can)).

NOTE: If you place more than 30 items in one stage, the game will crash! Be careful!


Adding Items to the mYl.mfk or mYload.lua File
The item that you use for G must also be in the mission load file, otherwise the game will crash. To add the item to the mission load file, type this inside the file:
LoadP3DFile("art\missions\level0X\___.p3d")
...where the X is the level number that the file is located in (in the /art/missions directory) and the ___ is the name of the .p3d file (such as monkey.p3d or i_cola.p3d).

NOTE: If you are using a .lua file, use a double backslash ( \\ ) instead of a single one ( \ ).


Other Uses for Item-Collecting Missions
The item-collecting missions can also be used to collect a single item, such as Lisa's science project (in L1) or the blender (in L2). However, if using the item-collecting mission for a SINGLE item, use the following instead:

AddObjective( "goto" )
   SetDestination( "F", "G" )
CloseObjective()
...where F and G remain the same as they did above.


Other Mission Tutorials
The Basics
Creating a Follow Mission
Coming Soon: Creating a Destroy Mission
Coming Soon: Creating a Follow-and-Collect Mission
Coming Soon: Creating a Simple Race Mission
Coming Soon: Creating a Checkpoint Race
Coming Soon: Creating a Race with Laps
Coming Soon: Creating a Hit-and-Collect Mission
Coming Soon: Creating a Wager Race
AddObjective( "delivery", "neither" )
the "neither" part of this function is only used when you are in a forced car mission. If you just put AddObjective("delivery"), it'll still work fine.
The same applies to
"AddObjective("goto","neither")"
Oh one more thing:
LoadP3DFile("art/missions/level0X/___.p3d")
This should be
LoadP3DFile("art\missions\level0X\___.p3d)
LoadP3DFile("art\\missions\\level0X\\___.p3d")
one or the other depending if you're using .mfk or .lua :)
Apart from that, this is another great tutorial.
This post has been removed.
9 yrs ago (Statistics)
This post has been removed.
9 yrs ago (Statistics)
This post has been removed.
9 yrs ago (Statistics)