Re: [Pipmak-Users] Schedule doesn't stop
Status: Alpha
Brought to you by:
cwalther
From: Christian W. <cwa...@gm...> - 2007-01-08 20:19:26
|
Fabrizio Pistonesi wrote: > pipmak.schedule( > 0.25, > function() > --mouth = math.mod(mouth + 1, 3) > mouth = math.floor(math.random() * 3) > --pipmak.dissolve() > Jassy2:setimage("speech_" .. mouth .. ".png") > i = i +1 > if i == 25 then pipmak.gotonode(4)end > return 0.25 > end > ) > > the problem is when i come back to node 4 pipmak is still looking for > speech_x.png files and doesn't find it so the exclamation point > picture is shown instead the "Jassy" patch therefore I need that the > schedule stops. In the reference PDF is written that leaving a node > removes all of its timers but seems it isn't true... (Using Pipmak v > 0.2.6) Good catch. That's a bug. I didn't anticipate that a timer could change nodes when I wrote the timer code. (This stuff is written in Lua, by the way, if you'd like to have a go at fixing it yourself: pipmak_internal.runtimers() in Pipmak Resources/resources/defaults.lua (line 234 in rev. 133).) What happens (I assume, at least - I haven't actually tried it yet) is that by the time the timer is re-scheduled because it returned something, you're already on node 4, and the deleting-timers-on-node-change is already past. You should be able to work around it by conditionalizing the return too: if i == 25 then pipmak.gotonode(4) else return 0.25 end I'll try to come up with a proper solution. I somehow suspect that there might be other problems of this nature hiding in there... Thanks for the report! -Christian |