Repetitive calls of UserSetControl

hutten

Member
Hello,

Only recently have I upgraded to SP3 (build 111951). Immediately I experienced problems with scripts (my own) that work well under SP2. For my railcars, I have scripts for both the railcar itself and for the cabin (controls).

As for the cabin script: it seems that the routine "UserSetControl" is called repeatedly and continuously, without even touching a control. Touching a control works as it should, but the repetition goes on and on. I can see it since the script outputs lines to the display. It seems that there is a continuous polling of the controls of type button and type switch, which I conclude from the print output of the GetName() routine of the control class. In SP2, the routine is only called once or a few times, depending on the specific control that is touched.

In some of my railcars, distorted sounds start when I enter the cab (cab camera). When I get out of the cab, the howling stops. This also seems to be related to the repetitive running of the aforementioned routine: an endless (i.e. the maximum) number of sound threads is apparently started when the routine starts running in cab view. The routine contains lines that start a sound; removing those lines removed the sound. These sounds should only start when a specific "start" button is pushed. It works like a charm in SP2.

Anyone else having this phenomenon or a suggestion about the cause?

Regards,
Paul
 
Hoi Paul,
did a test here, brought a loco and cab from 100240 to sp3 111951
and it seemed to work fine, could drive, till I touched the horn button
I have it in the sound container use a switch sound.
I got a rattling sound that would not stop until I left the cab
on return it still was there, Something is seriously broken
maybe the update time(sleep) was forgotten somewhere in a base script
and it gets in a loop


another user Rbrooks reported, switches being placed wrong at start position
I did not have that here, cause I export them in the start position.


glad I have 2 versions side by side here.
hope SP4 brings us the long awaited fix
greetings GM
 
Hoi G.M.,

At least I am not the only one experiencing this problem. Thanks very much for your reply, there do not seem to be many people that have these results or maybe they do not participate here.
I have put my post, in part, in the scripting thread of this forum this morning.
The looping is a nuisance, a heavier load on the system, and it is some work to prevent the continuous printing to the screen which makes relevant single line output disappear immediately.

In SP2, I had just managed to conserve all my settings of custom cab controls across a save and resume of a session, by means of the GetProperties() and SetProperties() routine. These routines apparently only work for the loco, and not for the cabin object, which is recreated from zero. I therefore had to introduce some extensions of the locomotive class, and call those routines from the cab. Worked well, in SP2.
I was disappointed to find that it did not work in SP3!
By using some output to the log file for debugging, I found out that it is a timing problem.
Since loco and cab are apparently being created simultaneously in threads, my function calls were made just a little too early. Making the calls from a thread that starts with a short pause has solved the problem.
Maybe this is a hint for user Rbrooks?

Regards,
Paul
 
Yeah many script were broken that start threads, that need an Asset
since at startup too much scripts have to be read, you basicly ask for something that has not been loaded yet.


I had the log on a separate window open, and the spam is just staggering even when you don't do anything in game
Seems:
-The trainz DRM system spams every minute for no reason
-Everyone that logs in or out of trainz gets in ichat and you see spam
-a station makes timer tick calls
-I see constant uncouple messages while trains are coupled
-many simple passenger/freight cars, have unneeded scripts even with pfx
-some items have threads that constant spam


its a miracle my PC can handle it and Trainz works lol
for everything that works ok before SP3 and now doesn't, you need to bug report
have fun
 
I've noticed the chatty scripts as well even as a non-script writer. I was troubleshooting bad performance and started digging deeper and saw this. TANE and TRS19 are much better than TS12 ever was. With TS12, the disc would flash with everything including a script read. This caused truly terrible performance for absolutely no reason whatsoever.
 
Back
Top