Page 1 of 1

Maniascript ingame debugger?

Posted: 23 Nov 2017, 22:04
by reaby
Ok, there's some interesting new script thingies, like:

Code: Select all

Dbg_WarnOnDroppedEvents = True;
Void 	Dbg_SetProcessed (CMlScriptEvent Event);
Text 	Dbg_DumpDeclareForVariables (CNod Nod, Boolean StatsOnly);
also I remember there was at some point possiblity to enable profiler for script timings and memory usage...
So in case i would like to debug if certaint serverside manialink slows down, how to do this most effecient way ?

Also would be very nice to send event-based data across manialinks for server sided widgets...

Currently I found a way by passing 2 variables declared for localplayer, one with changing id and one with the actual data needing the update.
Then I compare on each loop if the id has changed from last value, if it is, update data to all widgets listening for that variable.
But I'm not sure if it drops performance... and if it does, I would like to know how much?

How about persistence variables on maniaplanet 4, I see alot of that not working anymore.
Which types still supports for saving data ?

Re: Maniascript ingame debugger?

Posted: 23 Nov 2017, 22:24
by Miss
For profiling I believe you have to use the "tuningstart", "tuningend", "tuningmark" keywords.

Re: Maniascript ingame debugger?

Posted: 23 Nov 2017, 22:33
by reaby
so it is keywords, not method calls ?
I have no idea how this works. If someone knows how this all works, please write a tutorial, so it would help others as well!!

Re: Maniascript ingame debugger?

Posted: 23 Nov 2017, 22:36
by Miss
Maybe this thread helps explain it?

Re: Maniascript ingame debugger?

Posted: 23 Nov 2017, 22:43
by reaby
Many thanks :thumbsup: ^^ explains nicely how it supposed to work.

Re: Maniascript ingame debugger?

Posted: 23 Nov 2017, 22:48
by Dommy
reaby wrote: 23 Nov 2017, 22:04Also would be very nice to send event-based data across manialinks for server sided widgets...

Currently I found a way by passing 2 variables declared for localplayer, one with changing id and one with the actual data needing the update.
Then I compare on each loop if the id has changed from last value, if it is, update data to all widgets listening for that variable.
But I'm not sure if it drops performance... and if it does, I would like to know how much?
I would suggest declaring things for This. It allows you to share variables across instances of the same context, CMlScriptIngame in this case.

Code: Select all

declare Integer[Text] CurrentMapRecords for This;
Doing something like above in several layers should allow you to transport data easily. If this doesn't work, you may go for persistent for LocalUser.
reaby wrote: 23 Nov 2017, 22:04 How about persistence variables on maniaplanet 4, I see alot of that not working anymore.
Which types still supports for saving data ?
They still work, however storage may exceed the limit at some point. It works for primitive types only, like Text, Integer, Real, Boolean, Vec2, Vec3 (and arrays of these).

Re: Maniascript ingame debugger?

Posted: 23 Nov 2017, 23:04
by reaby
Many many many thanks dommy and miss for this fast replies and help :thx: