Page 1 of 1

Debug MP Script

Posted: Tue Feb 19, 2013 11:12 am
by Amaris
:?: are there special things to write scripts for multiplayer? As use Rand() function rather than FXRand().

:?: How debug MP script ? On a MP game the debug windows (F6) is inaccessible...

I have a nasty bug on my Naval Academy Mod, and I need to inspect what happens. But the bug only occurs in multiplayer. :roll:

Re: Debug MP Script

Posted: Tue Feb 19, 2013 3:54 pm
by pipfromslitherine
For MP games, you need to make sure that you are calling Rand() the same number of time at the same points on each machine during the playback. FXRand is for use where you want randomness, but it is only going to be used for visual effects and nothing that affects the model (note - things like floating text etc can affect the model by delaying other text etc - it's nasty!).

Debug is disabled in MP, this is to prevent cheating. I have a task on my list to turn it off when you are playing yourself, but it's not implemented yet.

Cheers

Pip

Re: Debug MP Script

Posted: Thu Feb 21, 2013 12:37 pm
by Amaris
pipfromslitherine wrote:For MP games, you need to make sure that you are calling Rand() the same number of time at the same points on each machine during the playback.
This is a part of my problem. Thanks. :D
pipfromslitherine wrote:Debug is disabled in MP, this is to prevent cheating. I have a task on my list to turn it off when you are playing yourself, but it's not implemented yet.
That would be perfect. :wink:

Re: Debug MP Script

Posted: Fri Feb 22, 2013 10:57 am
by Amaris
Well, well I found a 'secret' way to access to the debug windows (F6) in MP. 8)

To this must be in debug mode and just add a GetAttrib(id, string) somewhere with string that corresponds to nothing. This generates a simple warning.
But it opens the debug window where are displayed the result of Log() functions. :P

As it seems useful I publish it here. Now if it interferes remove this post.

Re: Debug MP Script

Posted: Fri Feb 22, 2013 3:43 pm
by pipfromslitherine
LOL

Fair enough. I think that the restriction might be a little too strict anyway, so not a problem.

Cheers

Pip