Custom loading screen, plugin help

Discover FAST, a records keeping server control script with a public records system called Dedimania, which will show records from the server on tm-exchange.com

Moderators: Slig, TM-Patrol

User avatar
NBAA
smooth traffic navigator
smooth traffic navigator
Posts: 239
Joined: 16 Oct 2005 16:58
Owned TM-games: TMO, TMS, TMU, TM²C
Manialink(s): nbaa / 2d2d

Custom loading screen, plugin help

Post by NBAA » 21 Dec 2008 13:13

I found a thread about custom loading screen for dedicated server, but this is for Aseco, it seems;
viewtopic.php?p=132930#p132930

Tried it with Fast 3.2.1u, client/server version 2.11.19.
I don't know any php or plugin work, but i tired to read about it, but i didn't manage to make it work. So if you would please help me out, and re-write this as a Fast plugin, I would appreciate it. Thx!
2D2DNBAA -> Too Drive to Drunk -> Join my server
My tracks@TmExchange: TMU / TMS / TMO / TMN / TM2

User avatar
Slig
Pit Crew
Pit Crew
Posts: 2124
Joined: 05 Sep 2005 17:51
Owned TM-games: ALL
Location: TraxicoLand (Fr)
Contact:

Re: Custom loading screen, plugin help

Post by Slig » 21 Dec 2008 18:30

Here is an adaptation of it for Fast, you can name the file plugin.99.forcemod.php for example :

Code: Select all

<?php
////////////////////////////////////////////////////////////////
// File:      plugin.99.forcemod.php , adapted for Fast from a aseco Yorkshire plugin
// Date:      23.12.2008
// Author:    adapted by Slig for Fast, from an aseco Yorkshire plugin
//            (http://www.tm-forum.com/viewtopic.php?p=132930#p132930)
////////////////////////////////////////////////////////////////
//
// This plugin will force random mods.
// 
// It can also be used to just customize load screens, simply by setting fake mods
// which just contain the load screen.
// NBA's note for simple loadscreen: the mod zip you have to name yourself,
//       and it will be the name of the mod, like yourmod.zip. Inside you have
//       to put a catalog called 'image', and within that catalog you put the file
//       'LoadScreen.dds', which you made yourself.

registerPlugin('forcemod',99);
global $_forcemod_list;

// Note: for each environment indicate a list of valid mods urls in $_forcemod_list array !
//       the default values are not valid : you have to set other ones !!!
$_forcemod_list = array(
	'Stadium' => array(
		'http://your.mod.url/StadiumLoadMod.zip'
	),
	'Island' => array(
		'http://your.mod.url/IslandLoadMod.zip'
	),
	'Speed' => array(
		'http://your.mod.url/SpeedLoadMod.zip'
	),
	'Rally' => array(
		'http://your.mod.url/RallyLoadMod.zip'
	),
	'Bay' => array(
		'http://your.mod.url/BayLoadMod.zip'
	),
	'Coast' => array(
		'http://your.mod.url/CoastLoadMod.zip'
	),
	'Alpine' => array(
		'http://your.mod.url/AlpineLoadMod.zip'
	)
);


function forcemodInit($event){
	forcemodEndRace($event);
}


function forcemodEndRace($event){
	global $_forcemod_list;
	console("forcemod.Event[$event]:: set forced mods");

	$modCalls = array();
	foreach(array_keys($_forcemod_list) as $envir){
		$num = count($_forcemod_list[$envir]);
		if($num > 0){
			$idx = rand(0, $num-1); // random index in envir mods list
			$modCalls[] = array('Env'=>$envir, 'Url'=>$_forcemod_list[$envir][$idx]);
		}
	}
	//debugPrint("forcemodEndRace:: modCalls",$modCalls);
	addCall(true,'SetForcedMods', true, $modCalls);
}

?>

User avatar
NBAA
smooth traffic navigator
smooth traffic navigator
Posts: 239
Joined: 16 Oct 2005 16:58
Owned TM-games: TMO, TMS, TMU, TM²C
Manialink(s): nbaa / 2d2d

Re: Custom loading screen, plugin help

Post by NBAA » 22 Dec 2008 20:52

Thank you very much :)

Note that the url's are just copied from the mentioned thread, and i don't know if they work. But i have managed my own url's and zip now.

The zip you have to name yourself, and it will be the name of the mod, like yourmod.zip. Inside you have to put a catalog called 'image', and within that catalog you put the file 'LoadScreen.dds', which you made yourself.
2D2DNBAA -> Too Drive to Drunk -> Join my server
My tracks@TmExchange: TMU / TMS / TMO / TMN / TM2

User avatar
Slig
Pit Crew
Pit Crew
Posts: 2124
Joined: 05 Sep 2005 17:51
Owned TM-games: ALL
Location: TraxicoLand (Fr)
Contact:

Re: Custom loading screen, plugin help

Post by Slig » 23 Dec 2008 08:34

NBAA wrote:The zip you have to name yourself, and it will be the name of the mod, like yourmod.zip. Inside you have to put a catalog called 'image', and within that catalog you put the file 'LoadScreen.dds', which you made yourself.
thanks for infos, i updated previous post with some comments :)

MikoZ
smooth traffic navigator
smooth traffic navigator
Posts: 269
Joined: 19 Oct 2006 13:20
Owned TM-games: TMO,TMSX,TMNF,TMUF
Manialink(s): Mik
Location: Finland
Contact:

Re: Custom loading screen, plugin help

Post by MikoZ » 29 Dec 2008 13:54

Does this work with TMNF? :pil
Image

TMU IGN: =H18=MikoZ

User avatar
f*ckfish
Pit Crew
Pit Crew
Posts: 1302
Joined: 15 Jun 2007 07:59
Owned TM-games: TMNF, TMUF
Location: Dresden, Germany
Contact:

Re: Custom loading screen, plugin help

Post by f*ckfish » 29 Dec 2008 17:16

yes
inactive, sorry

MikoZ
smooth traffic navigator
smooth traffic navigator
Posts: 269
Joined: 19 Oct 2006 13:20
Owned TM-games: TMO,TMSX,TMNF,TMUF
Manialink(s): Mik
Location: Finland
Contact:

Re: Custom loading screen, plugin help

Post by MikoZ » 29 Dec 2008 19:41

Goodie, then ima dl this :3
Image

TMU IGN: =H18=MikoZ

User avatar
sergent burn
cyclist
cyclist
Posts: 36
Joined: 02 Dec 2006 10:19
Owned TM-games: TMU,TMN,TMO
Manialink(s): sergentburn
Location: bordeaux (france)

Re: Custom loading screen, plugin help

Post by sergent burn » 31 Dec 2008 09:24

hi, i wondering myself :

does this plugin force mod for the maps that got yet a mod ?

i mean if i got a map with a mod does this plugin will force the loadscreen custom ( and by the way my mod will not be seen) ?

ps : sorry for my bad english :oops:
Manialink ==> SERGENT BURNcolor>
Image
Image

User avatar
Slig
Pit Crew
Pit Crew
Posts: 2124
Joined: 05 Sep 2005 17:51
Owned TM-games: ALL
Location: TraxicoLand (Fr)
Contact:

Re: Custom loading screen, plugin help

Post by Slig » 31 Dec 2008 10:15

sergent burn wrote:does this plugin force mod for the maps that got yet a mod ?
i mean if i got a map with a mod does this plugin will force the loadscreen custom ( and by the way my mod will not be seen) ?
I suppose that yes, the original map mod will not be seen as it is replaced by the one you forced. Btw i never tested myself ;)

User avatar
sergent burn
cyclist
cyclist
Posts: 36
Joined: 02 Dec 2006 10:19
Owned TM-games: TMU,TMN,TMO
Manialink(s): sergentburn
Location: bordeaux (france)

Re: Custom loading screen, plugin help

Post by sergent burn » 31 Dec 2008 12:25

Slig wrote: I suppose that yes, the original map mod will not be seen as it is replaced by the one you forced. Btw i never tested myself ;)
i just tried and it's exactly like this :(


but do you think it's possible to make exeption for the maps that have yet a mod, even manualy by the track's UID :?:
Manialink ==> SERGENT BURNcolor>
Image
Image

User avatar
Slig
Pit Crew
Pit Crew
Posts: 2124
Joined: 05 Sep 2005 17:51
Owned TM-games: ALL
Location: TraxicoLand (Fr)
Contact:

Re: Custom loading screen, plugin help

Post by Slig » 02 Jan 2009 01:44

sergent burn wrote:
Slig wrote: I suppose that yes, the original map mod will not be seen as it is replaced by the one you forced. Btw i never tested myself ;)
i just tried and it's exactly like this :(


but do you think it's possible to make exeption for the maps that have yet a mod, even manualy by the track's UID :?:
it would need to read the challenge info before the map change, then test in the xl part of the file f there is a mod, and if yes make a ForceMod empty...

Xymph
Pit Crew
Pit Crew
Posts: 5650
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: Custom loading screen, plugin help

Post by Xymph » 02 Jan 2009 09:35

Slig wrote:it would need to read the challenge info before the map change, then test in the xml part of the file if there is a mod, and if yes make a ForceMod empty...
You could use the GBXChallengeFetcher class in my GBX Data Fetcher module for that.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

cow
smooth traffic navigator
smooth traffic navigator
Posts: 216
Joined: 20 Mar 2007 02:53
Owned TM-games: TMU, TMS, TMO
Contact:

Re: Custom loading screen, plugin help

Post by cow » 13 Jan 2009 23:28

can this work with xaseco xymph?
join me at the music tower
Tet19's MusicTower

User avatar
f*ckfish
Pit Crew
Pit Crew
Posts: 1302
Joined: 15 Jun 2007 07:59
Owned TM-games: TMNF, TMUF
Location: Dresden, Germany
Contact:

Re: Custom loading screen, plugin help

Post by f*ckfish » 14 Jan 2009 00:08

If you rewrite it for xaseco, sure ;-)
inactive, sorry

Xymph
Pit Crew
Pit Crew
Posts: 5650
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: Custom loading screen, plugin help

Post by Xymph » 14 Jan 2009 09:14

cow wrote:can this work with xaseco xymph?
This is the Fast variant of a (X)Aseco plugin (see the comments by Slig in the above code :wink: ), the original by Yorkshire should do the trick with no extra work (certainly less than a rewrite from Fast back to XAseco :) ).
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

Post Reply