Page 6 of 10

Re: Script callbacks

Posted: 16 May 2013, 21:11
by MuNgLo
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. :/

Re: Script callbacks

Posted: 17 May 2013, 07:03
by reaby
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 :)

Re: Script callbacks

Posted: 17 May 2013, 13:44
by Eole
@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.

Re: Script callbacks

Posted: 17 May 2013, 16:54
by MuNgLo
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.

Re: Script callbacks

Posted: 17 May 2013, 18:02
by Eole
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.

Re: Script callbacks

Posted: 17 May 2013, 18:04
by MuNgLo
Well it works just fine for me now. Thx for the help.

Re: Script callbacks

Posted: 17 May 2013, 18:28
by kremsy
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:

Re: Script callbacks

Posted: 31 May 2013, 22:42
by kremsy
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 :(.

Re: Script callbacks

Posted: 03 Jun 2013, 14:42
by Eole
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?

Re: Script callbacks

Posted: 03 Jun 2013, 17:28
by kremsy
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.