"set_time_step" not working in html5 build

Good day fellow Defolders. I am having a bit of an issue and have exhausted the docs as well as the internet.

So here’s the rub…

When I call “set_time_step“ on my collection proxy from an input to pause the game/do a bullet time effect, it works only when “Build“ it, not when I “Build HTML5“.

Is there something that can be configured? or a specific way to impliment this to make it work for HTML5 Build?

Thanks!

-Loroko

It works in the timestep example on the web at least: Time-step | Defold

1 Like

yes, I did see that.

If you can reproduce the issue in a project, you can share it here and we can take a look.

i solved it, it was a if statement that created the mess.

for some reason the first one works with Build, but not HTML5

function on_input(self, action_id, action)
if action_id == hash("touch") then
	self.focus = self.focus + 1 

	if self.focus == 120 then
		focus()
		msg.post("loader:/loader#loader", "focus")
	end
end	

This one works with both.

function on_input(self, action_id, action)
if action_id == hash("touch") then
	self.focus = self.focus + 1 

	if self.focus > 120 then
		focus()
		msg.post("loader:/loader#loader", "focus")
	end
end	

Not sure why, but I’m happy to back to work! thank you for following up, much appreciated.

-Loroko.

That sounds like a bug with self.focus then? Either it’s a number (as opposed to an integer), or you increment it more/less than you expect.

self.focus is set to 0 in the init.

Perhaps the way the browser handles the Relational Operators or the + 1 per frame? I feel like there is something there when compiled for web.

I could speculate all day haha.

-Loroko

No, Lua (that we use on html5) works the same as LuaJIT (used on Desktop).

I could speculate all day haha.

That’s my point. You should try to find out new, before building more code depending on this variable.

Well, its a 0 that increments by one. not sure what else there is to look at in regards to this Variable. I suppose I can dedicate a little time to learning about LuaJIT & Interpreter.

-Loroko

Lua can do integer increment just fine.
If you’re not hitting that number right, something is going on
Did you try to print the value out?

Here’s an example:

1 Like

Yes, when i printed it out on “Build” it came up no problem.

On “HTML Build“, the condition was not met until i changed the “==“ to “>“.

-Loroko