Debug MP Script

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Debug MP Script

Post 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:
“Take care, my friend; watch your six, and do one more roll… just for me.”
pipfromslitherine
Site Admin
Site Admin
Posts: 9929
Joined: Wed Mar 23, 2005 10:35 pm

Re: Debug MP Script

Post 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
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Debug MP Script

Post 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:
“Take care, my friend; watch your six, and do one more roll… just for me.”
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Debug MP Script

Post 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.
“Take care, my friend; watch your six, and do one more roll… just for me.”
pipfromslitherine
Site Admin
Site Admin
Posts: 9929
Joined: Wed Mar 23, 2005 10:35 pm

Re: Debug MP Script

Post by pipfromslitherine »

LOL

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

Cheers

Pip
Post Reply

Return to “Battle Academy : Modders Corner ”