Create new packs inside my title pack

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
BigBang1112
Posts: 389
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

Create new packs inside my title pack

Post by BigBang1112 »

As title maker can make title packs, I would also love to see my title pack making packs. CPackCreator is high hopes.

Code: Select all

Build_Begin (CPackCreatorPack Pack, CPackCreatorTitleInfo TitleInfo)
Start a new build for a pack, optionnaly a titlepack.
This proves that it's somehow possible, although I don't understand the way how the creation was done in MakerAPI.Script.txt.

I got also confused by this term:

Code: Select all

PackCreator - only available when the title author is the current logged user.
That means only the creator of the title pack (where the pack creation is done) can create new packs? How it works in the Title Maker when the creator of Title Maker is Nadeo?

Back to the Build_Begin(), when building plain packs, do I have to type something in the TitleInfo or keep it Null?
What does CPackCreatorPack even mean here in Build_Begin()?

This is a very important thing for our upcoming title pack that is meters away from first real showcase, so we will especially appreciate your help here. <3 Thanks a lot in advance.
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
User avatar
Qlex
Posts: 239
Joined: 03 Jun 2012, 13:17

Re: Create new packs inside my title pack

Post by Qlex »

Hi!

I'll try my best to help you with this :)

I think the main thing to keep in mind is : To have your title pack make packs, you need to launch it in Maker mode, and specify a title pack that you want to make.

To understand how to launch it in Maker mode, you need to look for file://Media/Station/MakerStation.Script.txt , which is the manialink of the front cover of your title pack :

Code: Select all

Maker_EditNewTitle("MyExampleTP");
If you are executing this line of code, then the title pack will launch and create MyExampleTP@mylogin at the same time : It is in Maker mode, and the target title pack is MyExampleTP@mylogin. It might look like you launched your title pack as if nothing happened, but you can now use CTitleEdition to publish MyExampleTP@mylogin.

This title pack that you made can then be seen and accessed next time using the following lines of code :

Code: Select all

log(""^Maker_EditedTitles);
Maker_EditTitle(""^Maker_EditedTitles[0].TitleId);
This launches your title pack in Maker mode, and the target will be a title pack previously made by your maker (In our example, MyExampleTP@mylogin.)

Some things to note :
  • It is best not to launch your title in maker mode without knowing if you're going to make a title. That is because if you save, load maps/replays/any asset it will get redirected to WorkTitles/MyExampleTP@mylogin/ and not in your UserDir.
  • Your title pack, when launched, cannot create multiple title packs. You have to exit and come back to make another one.
  • There are several cases of assets taking precedence. Generally, the assets of the edited title are first looked at, then it's the maker's assets. You can still look at your UserDir with some methods of CTitleEdition, namely File_ImportFromUser(Text FileName), File_Exists and so on.
BigBang1112 wrote: 26 Mar 2018, 18:32

Code: Select all

PackCreator - only available when the title author is the current logged user.
That means only the creator of the title pack (where the pack creation is done) can create new packs? How it works in the Title Maker when the creator of Title Maker is Nadeo?
In this instance, title author means the author of the edited title. That means you cannot make a title pack that belongs to somebody else (You can't make Nadeo's title packs with the makers, for example.)
Back to the Build_Begin(), when building plain packs, do I have to type something in the TitleInfo or keep it Null?
What does CPackCreatorPack even mean here in Build_Begin()?
It has to be the following :

Code: Select all

	declare PackCreator <=> TitleEdition.PackCreator;
	declare CurrentPack <=> PackCreator.CurrentPack;
	declare TitleInfo <=> TitleEdition.EditedTitleInfo;
PackCreator is the maker that you are using. TitleInfo will be the TitleInfo of the target title pack that you are making.

I hope that helps!
User avatar
BigBang1112
Posts: 389
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

Re: Create new packs inside my title pack

Post by BigBang1112 »

This is truly amazing answer man. I love you. :thx:
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
User avatar
BigBang1112
Posts: 389
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

Re: Create new packs inside my title pack

Post by BigBang1112 »

Although its all nice and I learned a lot of things from this answer, I find this information being for creating a title pack, not a plain data pack. Can I ask for a very last time, what are the differences between creating a title pack and creating a data pack? Using title packs in my case is pointless.

CPackCreator says it's possible:
CPackCreator wrote:Script API to create Packs (can be Titlepacks or plain ManiaCredited data), and generate new builds of these packs.
Thanks again in advance. :)
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
User avatar
Qlex
Posts: 239
Joined: 03 Jun 2012, 13:17

Re: Create new packs inside my title pack

Post by Qlex »

Personally, I do not have experience with this. But I believe you can try making an interface and have your pack contain more data using the methods from CPackCreatorPack :

Code: Select all

             Void Recipients_Add(Text Login,Integer UseCost,Integer GetCost);
             Void Recipients_Remove(Text Login);
I do not think those methods would help you create a plain data pack per se. Maybe try Build_Begin() with TitleInfo being Null?
User avatar
BigBang1112
Posts: 389
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

Re: Create new packs inside my title pack

Post by BigBang1112 »

Why does

Code: Select all

TitleEdition.PackCreator.Build_Begin(TitleEdition.PackCreator.CurrentPack, TitleEdition.EditedTitleInfo)
give me

Code: Select all

Invalid pack.
error even when my title is launched in Maker mode?
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
User avatar
BigBang1112
Posts: 389
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

Re: Create new packs inside my title pack

Post by BigBang1112 »

Ok I just forgot to call

Code: Select all

RegisterPackForEditedTitle()
Call this if CurrentPack is null
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
User avatar
BigBang1112
Posts: 389
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

Re: Create new packs inside my title pack

Post by BigBang1112 »

Code: Select all

Build_Begin (CPackCreatorPack Pack, CPackCreatorTitleInfo TitleInfo)
Setting TitleInfo to Null crashed ManiaPlanet.
What is the correct way of creating a simple package and NOT a title pack? Once again, documentation says it's possible.
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 3 guests