chikitin wrote:
> I couldn't do pass by reference in pipmak:)
Lua always passes by reference. If you can explain what you're trying to
achieve we may be able to show you how to do it in Lua.
> Is there any
> other way to ask pipmak to do some action as soon as a sound is stopped
> playing?
No. As far as I am aware there is no such callback in OpenAL, so all
Pipmak could do is polling whether the sound is still playing, and you
can just as well do that yourself (as you're doing now).
> Hey Christian! now it works. You can try it yourself at:
>
>
http://faculty.uncfsu.edu/csarami/files/storage/Demo.pipmak - Random.zip
Well, it works as long as you keep the randomization turned off - if you
enable it, you get errors because you're mixing nil values into the
table. You're using a proper permutation function now and 30 is the
wrong argument for that, it needs the table length (and since it can
determine that on its own, there is no reason to pass it as an argument).
Some more tips:
- Defining a global function in one node (99) and using it in another
(15) is a bit fragile. What if the player enters node 15 without ever
having visited node 99, e.g. when starting from a saved game? (In your
case, the older version of the function from main.lua would be used, but
that looks like a leftover - and there is no guarantee that main.lua
will have been run either.) If you want to define this function in a
central place and use it from several nodes, you should put it into a
separate file and include that in the node.luas using pipmak.dofile().
(In the future, "require" will work too.)
- If you want a function to be called when a node is entered (like in
node 15), you shouldn't put it directly into node.lua. That currently
works, but in the future node.lua may also be run at other times. You
should put this code into an onenternode handler (there's one just a few
lines above in node 15).
-Christian
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial.
http://p.sf.net/sfu/www-adobe-com_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users