timer_stop problems AM 3.3 build 12 beta

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: russ, Ralph

Post Reply
Message
Author
User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

timer_stop problems AM 3.3 build 12 beta

#1 Post by Sling »

The build 12 update notes said something about fixing a bug with timer_stop and nil values I think and now I'm getting timer_stop issues. It surely can't be a coincidence.

I'm using a timer to flash a graphic (500ms) when a condition is met the code stops the timer and hence the flashing. I've done this so many times before but today my attempts give un-reliable results. sometimes it works sometimes it doesn't.

I have a print(timer_running(timer_id)) statement directly after the timer_stop(timer_id) command so I know it's being called but the state is sometimes true which can't be.

I'm not sure if its related but if I try to print the timer_id I get a blank even when it works. I thought I remembered printing id codes to the console before when I was debugging some other code a while back but this might not have been timer_id's. Should all id's show something in the console?

Sorry for the bad news.

Tony

EDIT : I ran it some more and this time I'm seeing it initially stop everytime but somehow randomly having a state of true before I check if it's running again before restarting the timer when I want the graphic to flash again. Weird. Nothing else is using the same timer_id.

User avatar
Corjan
Posts: 2939
Joined: Thu Nov 19, 2015 9:04 am

Re: timer_stop problems AM 3.3 build 12 beta

#2 Post by Corjan »

Hi,


Recently, I changed up the way ID's are handed out.
They used to be string values, that is why they where printable.

Right now they are lightuserdata, a feature in lua that reduces CPU cycles and makes it impossible to change the ID value.


Having said this, there where still two issues when it comes to timers. I think I have fixed them now, it will be included in the next BETA.

Corjan

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: timer_stop problems AM 3.3 build 12 beta

#3 Post by Sling »

Thanks Corjan great work as always.

Post Reply