Script callbacks

Moderator: NADEO

MuNgLo
Posts: 316
Joined: 12 Jul 2012, 03:37

Re: Script callbacks

Post by MuNgLo » 16 May 2013, 21:11

About that Alt menu disable.

I wanted to test it so I added this under my onPlayerConnect()

Code: Select all

$this->connection->TriggerModeScriptEvent("LibXmlRpc_DisableAltMenu", $login);
It returns (bool) TRUE* but the scoreboard still pops up.

Would it matter which S_Mode or so you run?


* or atleast not FALSE. :/

reaby
Posts: 932
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

Re: Script callbacks

Post by reaby » 17 May 2013, 07:03

you have to enable the scriptCallbacks in matchsettings :)

Code: Select all

<mode_script_settings>
		 <setting name="S_UseScriptCallbacks" type="boolean" value="1"/> 
</mode_script_settings>
after that i got it working :)

User avatar
Eole
Nadeo
Nadeo
Posts: 1216
Joined: 26 Apr 2011, 21:08

Re: Script callbacks

Post by Eole » 17 May 2013, 13:44

@MuNgLo:
I can't control what the TriggerModeScriptEvent() function will return. So the true/false it returns doesn't match the result of the hide/show function on the server.

When you received the onPlayerConnect() event the player is not yet added in the Players array of the script. And because it's the script that manage the hide/show function of the scores table, it fails.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!

MuNgLo
Posts: 316
Joined: 12 Jul 2012, 03:37

Re: Script callbacks

Post by MuNgLo » 17 May 2013, 16:54

K. What is the limitation of this way. Will it just work for alive players? Will it stop working for players that go spec and so on?
Reason I ask is cause if it only works for alive players in active turns for example, then it's a pretty useless fix.

User avatar
Eole
Nadeo
Nadeo
Posts: 1216
Joined: 26 Apr 2011, 21:08

Re: Script callbacks

Post by Eole » 17 May 2013, 18:02

It works for players and spectators, alive or eliminated. Before, during and after the turn.
But as it's managed by the script there's indeed some limitations. The function that waits the callbacks in the script must be called at each frame to not miss any event. So as long as the script is executed and the function called it works. I checked the official modes but I might have miss some cases where the function is not called, do not hesitate to report them and I'll try to fix them.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!

MuNgLo
Posts: 316
Joined: 12 Jul 2012, 03:37

Re: Script callbacks

Post by MuNgLo » 17 May 2013, 18:04

Well it works just fine for me now. Thx for the help.

kremsy
Posts: 1720
Joined: 21 Jul 2011, 09:51

Re: Script callbacks

Post by kremsy » 17 May 2013, 18:28

Eole wrote:It works for players and spectators, alive or eliminated. Before, during and after the turn.
But as it's managed by the script there's indeed some limitations. The function that waits the callbacks in the script must be called at each frame to not miss any event. So as long as the script is executed and the function called it works. I checked the official modes but I might have miss some cases where the function is not called, do not hesitate to report them and I'll try to fix them.
:thumbsup:
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

kremsy
Posts: 1720
Joined: 21 Jul 2011, 09:51

Re: Script callbacks

Post by kremsy » 31 May 2013, 22:42

Is it possible that you put the BeginMap callback more earlier, just when the first player is in the Map?

Now it's still to late :(.
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

User avatar
Eole
Nadeo
Nadeo
Posts: 1216
Joined: 26 Apr 2011, 21:08

Re: Script callbacks

Post by Eole » 03 Jun 2013, 14:42

By default the "BeginMap" callback come just after the LoadMap() in the script. So, unless the mode specifically delays it, I can't put it earlier. Before the LoadMap(), the Players array is empty in the script, that's what you need?
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!

kremsy
Posts: 1720
Joined: 21 Jul 2011, 09:51

Re: Script callbacks

Post by kremsy » 03 Jun 2013, 17:28

I think that is what I need, I only need a BeginMap callback which comes directly when the first Player sees the screen in the new Map. At the moment it is up to 10secs later.
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

Post Reply

Return to “Dedicated Server”

Who is online

Users browsing this forum: No registered users and 0 guests