Forum Mod Bakery Docs

Can someone explain, how to work with scripts of missions?

Posted in Support
Please login to contribute to the conversation.
I searched forum but didn't find full information about that.
For example, i have wanted to create mission with "bombbarrel" on first level. How to do this without crashing of the game or at least with starting the mission?
Please help me, thank you in advance. (My english probably is very bad, sorry.)
[deleted user]
6 yrs ago (Statistics)
You need to load the bombbarell into the mission, using mXl.mfk
(In fact, you can load every object from any level by simply changing the folder name)
So, if you want to load bombbarell, you'll simply need to put this line in your mXl.mfk
LoadP3DFile("art\missions\level07\bombbarell.p3d");
The rest depends on what type of mission you want to create
Anyway i have crashed :(
For example, i want to make mission like the last mission of 7th level in first level first mission. I have already made UFO at playground(it is working).
[deleted user]
6 yrs ago (Statistics)
I have some doubts that you can re-create the same mission type in L1
But I'll still help you. You'll have to add the barrel, simply write down this line to the same stage where you need to collect the barrel:
	AddCollectibleStateProp("bombbarrel","*LOCATOR_NAME_HERE*", 2); 
(Note: I dunno what "2" means, so you probably want to keep this unchanged)
Next thing you want to do, is to add an objective
Bombbarell stages use a unique objective: pickupitem
This objective will look like this
	AddObjective( "pickupitem" );
		SetPickupTarget("bombbarrel");
	CloseObjective();

Then, in the next stage, you will need to add a keepbarell condition, so if you lose the barell, you need to head back to it's original position
	AddCondition( "keepbarrel", 1 );
	CloseCondition();
In the second stage after this one, you'll need to add the same condition, but increase the number (eg. It was 1 in the previous stage, will be 2 in current stage)
This should do it, but remember that you need to add this condition to every stage past "barell-collecting" one(i.e. from the stage where you collected the barell, to the end of the mission), increasing the number

I probably explained it like an idiot, but, hope I helped :p
ohh... Would be so nice if someone make the topic with guide how to make correct mission without bugs or crashes. (I have crashed again and i don't know where is the problem :'| )
[deleted user]
6 yrs ago (Statistics)
You can look it up here. There's plenty of tutorials regarding mission making
Also, don't be afraid joining DT's Discord server, people can help you really quick there c:
It is very helpful! Thank you very much!