xbx wrote:Hello!
Just a quick note to hint at ways to make some kind of custom solo campaign in TM and SM.
When you create a title, instead of providing a folder with maps, and get the standard campaign menu and unlock pattern, you can provide a playlist and a script.
When the user goes into the solo campaign, the menu will be skipped and the script started with the maps provided in the playlist.
And the script can then decide which map to lead next, or display a manialink and interact with the user - before even loading the first map.
This allows for doing stuff like story mode or displaying a world map, or whatever.
Here is a very simple script with no actual gameplay that displays a list and asks which map to lead next.
Code: Select all
// *********************** ** ** * * // * Test solo campagain with map list // ******************* ** ** * * // (works for TM and SM) #RequireContext CSmMode //#RequireContext CTmMode /* in the title pack, set the solo maps as a playlist (instead of a campaign folder) <solo> <medals>12</medals> <mode name="Modes\ShootMania\TestSolo.Script.txt"/> <campaign folder=""/> <playlist name="SoloTest.txt"/> </solo> */ #Include "TextLib" as TextLib #Include "Libs/Nadeo/Mode.Script.txt" #Const Version "2014-04-07" // === Main === main() { UIManager.ResetAll(); declare LayerMapList = UIManager.UILayerCreate(); UIManager.UIAll.UILayers.add(LayerMapList); declare CurUpdateNum = 0; wait(Users.count > 0); // wait for the game to be ready declare LocalPlayerUI <=> UIManager.GetUI(Users[0]); assert(LocalPlayerUI != Null); while( !ServerShutdownRequested ) { // Manialink displayed when no map is loaded // for example: simple pick the map from list CurUpdateNum += 1; LayerMapList.ManialinkPage = """ <frame> <quad sizen="160 100" halign="center" valign="center" style="Bgs1InRace" substyle="BgWindow3"/> <label posn="-75 45 1" scale="1" halign="left" valign="center" text="Now playing: {{{MapName}}}" /> <label posn="-75 32 1" scale="2" halign="left" valign="center" text="Choose next map:" /> """; declare MapIndex = 0; foreach (CandidateMap in MapList) { declare PostFix = ""; if (MapIndex == NextMapIndex) PostFix = "$z <--- next"; LayerMapList.ManialinkPage ^= """ <label posn="-75 {{{25-5*MapIndex}}} 1" scale="1" halign="left" valign="center" text="{{{CandidateMap.Name^PostFix}}}" id="map_{{{MapIndex}}}" scriptevents="1" /> """; MapIndex += 1; } LayerMapList.ManialinkPage ^= """ </frame> <script><!-- #Include "TextLib" as TextLib main() { declare netwrite SelectedMapIndex for UI = -1; declare netwrite UpdateNum for UI = 0; SelectedMapIndex = -1; UpdateNum = {{{CurUpdateNum}}}; while (True) { yield; foreach (Event in PendingEvents) { if (Event.Type == CMlEvent::Type::MouseClick) { declare Parts = TextLib::Split("_", Event.ControlId); if (Parts.count == 2 && Parts[0] =="map") { SelectedMapIndex = TextLib::ToInteger(Parts[1]); } } } } } --></script>"""; Synchro_DoBarrier(); declare netread UpdateNum for LocalPlayerUI = 0 ; declare netread SelectedMapIndex for LocalPlayerUI = -1; wait(UpdateNum == CurUpdateNum && SelectedMapIndex != -1); NextMapIndex = SelectedMapIndex; // note: it's a good idea to set this as early as possible (in network games), // as it allows the game to pre-download the maps & stuff on the clients. LoadMap(); // === play the map UIManager.UIAll.UISequence = CUIConfig::EUISequence::RollingBackgroundIntro; sleep(10000); UIManager.UIAll.UISequence = CUIConfig::EUISequence::None; // ==== UnloadMap(); } UIManager.UILayerDestroy(LayerMapList); }
Custom campaigns in your title pack
Moderator: NADEO
Custom campaigns in your title pack
Ubisoft Support
Your Player Page
More information about maniaplanet, support, contents, community activities: useful links
ManiaPlanet technical documentation portal (Dedicated server, Mediatracker, ManiaLink, ManiaScript, Titles...)
Your Player Page
More information about maniaplanet, support, contents, community activities: useful links
ManiaPlanet technical documentation portal (Dedicated server, Mediatracker, ManiaLink, ManiaScript, Titles...)
Re: custom campaigns
I can create SkillPoints ranking for my title? Or it's only for offical games?
Re: custom campaigns
it's only working for the official base games and not in title packsmvv0105 wrote:I can create SkillPoints ranking for my title? Or it's only for offical games?
an example for a custom point system can be found on http://obstacle-records.com which is tracking records and points for the obstacle title pack
Re: custom campaigns
cool, but how i can create it?steeffeen wrote:an example for a custom point system
Re: custom campaigns
it's all custom code and nothing of it is offered by nadeomvv0105 wrote:how i can create it?
the game mode script sends the times to the central server which is calculating the points for each record to build the global ranking
it certainly needs some work and some own creativity, but you can do whatever you want
Re: Custom campaigns in your title pack
I am creating custom campaign for tm and i have question related to this topic.
Is there any way to display manialink while loading screen is shown(when map is loaded)?
For me black screen is shown, even if i have CUILayer with my manialink added to UIManager.UIAll.UILayers.
I would like to put some gameplay tips and jokes in there if possible.
Is there any way to display manialink while loading screen is shown(when map is loaded)?
For me black screen is shown, even if i have CUILayer with my manialink added to UIManager.UIAll.UILayers.
I would like to put some gameplay tips and jokes in there if possible.
My specs:
MOBO: MB AM3+ 970 Gigabyte GA-970A-DS3P
CPU: AM3+ AMD FX-8320E
GPU: Nvidia GeForce GTX750-Ti ASUS 2GB DDR5
RAM: DDR3 8GB 1866MHz Kingston HyperX
SSD: SATA3 120gb SanDisk
OS: Ubuntu 19.04
TY MICMO
MOBO: MB AM3+ 970 Gigabyte GA-970A-DS3P
CPU: AM3+ AMD FX-8320E
GPU: Nvidia GeForce GTX750-Ti ASUS 2GB DDR5
RAM: DDR3 8GB 1866MHz Kingston HyperX
SSD: SATA3 120gb SanDisk
OS: Ubuntu 19.04
TY MICMO
Re: Custom campaigns in your title pack
It would be useful, we will be able to do custom loadscreens.maxi031 wrote:I am creating custom campaign for tm and i have question related to this topic.
Is there any way to display manialink while loading screen is shown(when map is loaded)?
For me black screen is shown, even if i have CUILayer with my manialink added to UIManager.UIAll.UILayers.
I would like to put some gameplay tips and jokes in there if possible.
Last edited by adamkooo2 on 06 Jul 2017, 08:31, edited 3 times in total.
- Blueplayer
- Posts: 170
- Joined: 05 Apr 2011, 17:34
Re: Custom campaigns in your title pack
Hi, I´d like to create a custom campaign, but I already fail with the given example. The relevant part:
Edit: I´ve found someone else with the same issue:
viewtopic.php?f=515&t=27120&p=216370&hi ... UI#p216197
Does it just not work in TM? (I don´t have SM. I can´t check it.)
Users[0] is successfully declared, but LocalPlayerUI is always Null. Is this an outdated example?xbx wrote:Code: Select all
wait(Users.count > 0); // wait for the game to be ready declare LocalPlayerUI <=> UIManager.GetUI(Users[0]); assert(LocalPlayerUI != Null);
Edit: I´ve found someone else with the same issue:
viewtopic.php?f=515&t=27120&p=216370&hi ... UI#p216197
Does it just not work in TM? (I don´t have SM. I can´t check it.)
Who is online
Users browsing this forum: No registered users and 2 guests