Force loadscreen

This Aseco flavor by Mistral contains a comprehensive rank system that orders stats by environment, track and author name. It also contains a built-in lottery system.

Moderators: Mistral, TM-Patrol

breach
cyclist
cyclist
Posts: 48
Joined: 17 Oct 2007 07:05
Owned TM-games: TMU, TMN, TMUF/TMNF

Force loadscreen

Post by breach » 16 Nov 2008 12:11

Is there an easy way to implement a function for forcing custom loadscreens? I don´t belong in PHP at all so i am shooting in the dark whenever i try to make modifications on my own :oops:

I have tried to use this snippet :

Code: Select all

Aseco::registerEvent('onEndRace', 'forceModEndRace');
function forceModEndRace($aseco, $command){
    $modsStadium = array(
   'http://www.fileden.com/45645645645/StadiumLoadENG.zip'
   );
    $modsIsland = array(
   'http://www.fileden.com/45645645645/IslandLoadENG.zip'
   );
    $modsSpeed = array(
   'http://www.fileden.com/45645645645/SpeedLoadENG.zip'
   );
    $modsRally = array(
   'http://www.fileden.com/45645645645/RallyLoadENG.zip'
   );
    $modsBay = array(
   'http://www.fileden.com/45645645645/BayLoadENG.zip'
   );
    $modsCoast = array(
   'http://www.fileden.com/45645645645/CoastLoadENG.zip'
   );
    $modsAlpine = array(
   'http://www.fileden.com/45645645645/AlpineLoadENG.zip'
   );
    $idxStadium = rand(0, count($modsStadium)-1);
    $idxIsland = rand(0, count($modsIsland)-1);
    $idxSpeed = rand(0, count($modsSpeed)-1);
    $idxRally = rand(0, count($modsRally)-1);
    $idxBay = rand(0, count($modsBay)-1);
    $idxCoast = rand(0, count($modsCoast)-1);
    $idxAlpine = rand(0, count($modsAlpine)-1);
   $modCalls = array(
   array('Env'=>'Stadium', 'Url'=>$modsStadium[$idxStadium]),
   array('Env'=>'Island', 'Url'=>$modsIsland[$idxIsland]),
   array('Env'=>'Speed', 'Url'=>$modsSpeed[$idxSpeed]),
   array('Env'=>'Rally', 'Url'=>$modsRally[$idxRally]),
   array('Env'=>'Bay', 'Url'=>$modsBay[$idxBay]),
   array('Env'=>'Coast', 'Url'=>$modsCoast[$idxCoast]),
   array('Env'=>'Alpine', 'Url'=>$modsAlpine[$idxAlpine])
   );
    $aseco->addCall('SetForcedMods', array(True, $modCalls));
}
... from this thread viewtopic.php?f=28&t=17422&p=136869&hil ... en#p132930

I put the code in the idlekick plugin, i guessed it is used in the EndRace... I thought i got this to work for a while, but after some rounds i decided to put it in it´s own pluignfile to be more scalable and be used in several servers. It didnt work... so i put it back into idlekick.plugin but it wont work...

Any suggestions...?!

User avatar
Mistral
Pit Crew
Pit Crew
Posts: 1304
Joined: 02 May 2006 15:13
Owned TM-games: tmuf
Contact:

Re: Force loadscreen

Post by Mistral » 16 Nov 2008 13:11

No clue about the function, but the documentation says

Mods, an array of structures [{EnvName, Url}, ...].

$aseco->addCall('SetForcedMods', array(True, $modCalls));

$modCalls seems to be an array of arrays, not an array of structs.

User avatar
itsjustme
sunday driver
sunday driver
Posts: 63
Joined: 29 May 2006 13:31
Owned TM-games: TMU,TMN,TMS
Location: /etc/init.d

Re: Force loadscreen

Post by itsjustme » 23 Nov 2008 18:44

Hi ...
I already added this function in an earlierer version of my modded mistral script. (release soon, if mistral give's me the O.K)
But i used a very quick, simple & nasty way to handle this.

Code: Select all

chat.admin.php -> Sample:

// Enable LoadScreen ..
$aseco->addCall('SetForcedMods', array(false, array(array('Env'=>'Stadium', 'Url'=>'http://www.SERVER.de/MODFILE.zip'))));

//Disable LoadScreen
$aseco->addCall('SetForcedMods', array(false, array()));
All other envir's (bay, coast etc.) are removed from the whole script, so i made just one function for stadium.

DOWNLOAD MIRROR FOR EVERTHING AROUND TRACKMANIA
------------- Get files, updates & tools faster! ------------

breach
cyclist
cyclist
Posts: 48
Joined: 17 Oct 2007 07:05
Owned TM-games: TMU, TMN, TMUF/TMNF

Re: Force loadscreen

Post by breach » 04 Jan 2009 07:34

Hm? Chatadmin? Does this have to be activated ingame with a /admin command? I dont see how to implement this in chat.admin.php

User avatar
Mistral
Pit Crew
Pit Crew
Posts: 1304
Joined: 02 May 2006 15:13
Owned TM-games: tmuf
Contact:

Re: Force loadscreen

Post by Mistral » 04 Jan 2009 11:32

breach wrote:Hm? Chatadmin? Does this have to be activated ingame with a /admin command? I dont see how to implement this in chat.admin.php
As you probably want to enable, disable, change it ingame you will have to add your own admin command for this.

f.e. /admin forceload <params>:

/admin forceload on
/admin forceload off
/admin forceload Stadium http://www.SERVER.de/MODFILE.zip

breach
cyclist
cyclist
Posts: 48
Joined: 17 Oct 2007 07:05
Owned TM-games: TMU, TMN, TMUF/TMNF

Re: Force loadscreen

Post by breach » 05 Jan 2009 09:42

i Just cant get this to work. No clue... :?

User avatar
itsjustme
sunday driver
sunday driver
Posts: 63
Joined: 29 May 2006 13:31
Owned TM-games: TMU,TMN,TMS
Location: /etc/init.d

Re: Force loadscreen

Post by itsjustme » 05 Jan 2009 10:48

try it like this...:

Code: Select all

}elseif (($command['params'][0] == 'fmodon') {
$aseco->addCall('SetForcedMods', array(false, array(array('Env'=>'VARIABLE1', 'Url'=>'VARIABLE2'))));

DOWNLOAD MIRROR FOR EVERTHING AROUND TRACKMANIA
------------- Get files, updates & tools faster! ------------

breach
cyclist
cyclist
Posts: 48
Joined: 17 Oct 2007 07:05
Owned TM-games: TMU, TMN, TMUF/TMNF

Re: Force loadscreen

Post by breach » 06 Jan 2009 15:36

Yup, tried your example and a few on my own... Something really is fishy around all this...

I have two things to exclude imo.

1) Wrong settings or whatever when saving and compressing the imagefile... Not very likely since thay are working on local machine.

2) Test if the script really connects and downloads the file from remote...

breach
cyclist
cyclist
Posts: 48
Joined: 17 Oct 2007 07:05
Owned TM-games: TMU, TMN, TMUF/TMNF

Re: Force loadscreen

Post by breach » 07 Jan 2009 12:32

Nope, the script can connect to the remote server and can download the file...

User avatar
Mistral
Pit Crew
Pit Crew
Posts: 1304
Joined: 02 May 2006 15:13
Owned TM-games: tmuf
Contact:

Re: Force loadscreen

Post by Mistral » 07 Jan 2009 12:55

Is it really 'Env'? The documentation says its 'EnvName'.

breach
cyclist
cyclist
Posts: 48
Joined: 17 Oct 2007 07:05
Owned TM-games: TMU, TMN, TMUF/TMNF

Re: Force loadscreen

Post by breach » 07 Jan 2009 14:45

It sure does:
SetForcedMods
boolean SetForcedMods(boolean, array)
Set the mods to apply on the clients. Parameters: Override, if true even the challenges with a mod will be overridden by the server setting; and Mods, an array of structures [{EnvName, Url}, ...]. Requires a challenge restart to be taken into account. Only available to Admin.

But, the strange thing is that i cant get it to work on other AsecoMods either. Xaseco has a plguin for this and i set it up on a developementserver but that wont work either...

So, am i missing any config.setting in the dedicated.cfg perhaps...? Does any setting there has to be set to true or whatever to corespond to the frocemod stuff perhaps...?

This is all really strange to me.

Why is it set to FALSE in itsjustme example?

Code: Select all

elseif (($command['params'][0] == 'fmodon') {
$aseco->addCall('SetForcedMods', array([b]false[/b], array(array('Env'=>'VARIABLE1', 'Url'=>'VARIABLE2'))));

User avatar
itsjustme
sunday driver
sunday driver
Posts: 63
Joined: 29 May 2006 13:31
Owned TM-games: TMU,TMN,TMS
Location: /etc/init.d

Re: Force loadscreen

Post by itsjustme » 08 Jan 2009 20:25

The 'false' is the "mod override" variable....
I set it to false cause tracks with included mods won't load anymore when the settings is "true"
(i'm only using this for showing a custom loadscreen .. so, best way keep all the other trackmods)

The code, i posted above, works very fine on my servers.
Check it out -> Germany/Hesse/Gießen -> INSOMNIA*
(but wait till map change while mod loads)

So, where's exactly the problem ? Code works, just drop it in chat.admin and add a specific chat command infront ;)

DOWNLOAD MIRROR FOR EVERTHING AROUND TRACKMANIA
------------- Get files, updates & tools faster! ------------

breach
cyclist
cyclist
Posts: 48
Joined: 17 Oct 2007 07:05
Owned TM-games: TMU, TMN, TMUF/TMNF

Re: Force loadscreen

Post by breach » 09 Jan 2009 06:56

Yup, it works fine. On your servers :D Not on mine... :(

This is all to strange to me. The screens simply are not loading when supposed to, or at all. The code should be working and i turned this problem inside out over and over again... but the problem must be somewhere else.

If i´m not completley missundersdtanding the ingame command for it?

in your example it should be activated like this:

/admin fmodon

Or?

User avatar
itsjustme
sunday driver
sunday driver
Posts: 63
Joined: 29 May 2006 13:31
Owned TM-games: TMU,TMN,TMS
Location: /etc/init.d

Re: Force loadscreen

Post by itsjustme » 09 Jan 2009 13:15

Ok, again .. here's my complete code (as i told, very simple way to handle it)

Code: Select all


 :wink:
Last edited by itsjustme on 03 Apr 2009 14:06, edited 1 time in total.

DOWNLOAD MIRROR FOR EVERTHING AROUND TRACKMANIA
------------- Get files, updates & tools faster! ------------

breach
cyclist
cyclist
Posts: 48
Joined: 17 Oct 2007 07:05
Owned TM-games: TMU, TMN, TMUF/TMNF

Re: Force loadscreen

Post by breach » 09 Jan 2009 15:16

Thanks, i managed to set up the chat.admin.php like you explained. It does not help :?

I relly believe your code is working... but i dont think it is the code that is the problem... but i have no clue on what it is...

Anything i could have missed in the serverconfig...? anyways... i´ll mind this later on... thanks for your help :thumbsup:

Post Reply