Re: [Pipmak-Users] Schedule doesn't stop
Status: Alpha
Brought to you by:
cwalther
From: Fabrizio P. <fpi...@li...> - 2007-01-08 21:02:26
|
> Fabrizio Pistonesi wrote: > > pipmak.schedule( > > 0.25, > > function() > > --mouth =3D math.mod(mouth + 1, 3) > > mouth =3D math.floor(math.random() * 3) > > --pipmak.dissolve() > > Jassy2:setimage("speech_" .. mouth .. ".png") > > i =3D i +1 > > if i =3D=3D 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 th= e > 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 =3D=3D 25 then pipmak.gotonode(4) > else return 0.25 end > > I'll try to come up with a proper solution. I somehow suspect that ther= e > might be other problems of this nature hiding in there... > > > Thanks for the report! > > -Christian Maybe this bug could be useful for some purpose however I've fixed it wit= h if i =3D=3D 25 then pipmak.gotonode(4)else return 0.25 end but removing "return 0.25" in the last line. with 'return 0.25' the patch on node 4 appears ok but after this delay th= e schedule restart. I guess, I didn't understood it very well but it seems works! Thanks, Fabrizio.=0A=0A=0A-----------------------------------------------= -------=0APassa a Infostrada. ADSL e Telefono senza limiti e senza canone= Telecom=0Ahttp://click.libero.it/infostrada08gen07=0A |