User Tag List

Page 41 of 43 FirstFirst ... 31 39 40 41 42 43 LastLast
Results 401 to 410 of 426

Thread: XLua extention beta

  1. #401
    Clicker SWF Export Module

    Join Date
    Apr 2009
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: XLua extention beta

    Retriever2, is it possible to do this using your xlua extension?

  2. #402
    Clicker Multimedia Fusion 2
    Retriever2's Avatar
    Join Date
    Jun 2006
    Location
    United States
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: XLua extention beta

    In theory you should be able to since you have access to overlap detection. But designing the right algorithms to deal with multiple objects and other obstacles would be just as challenging as if you were writing a native C++ extension.

  3. #403
    No Products Registered

    Join Date
    Mar 2009
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: XLua extention beta

    That is a very nice article, thank you for the link. During my skim I already noted a few tricks I can use to speed things up.

  4. #404
    Clicker Multimedia Fusion 2
    Retriever2's Avatar
    Join Date
    Jun 2006
    Location
    United States
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: XLua extention beta

    Following up on the data elements bug report:

    It turns out that requiring from the data elements editor does work, but you must add the FULL path of the file to your cpath variable, AND you must use the Windows double-backslash notation when specifying that path (e.g.: package.cpath = "./?.dll;./ext/?.dll;E:\\Archive\\mfa\\test\\ext\\?.dll").

    The file handling function in MMF for dealing with embedded binary data are incredibly picky, and if the path is not specified EXACTLY as it appears in the data elements editor, then it will never find the file. I personally loathe the way the whole binary data/data elements system works, but it is what it is. Clearly, I'll need to update the documentation to reflect this peculiarity.

    Also a secondary caveat, if you find that your DLLs aren't loading correctly: make sure there is not a .lua file with the same name that can be found via the package.path variable, as .lua files take precedence over .dll files.

  5. #405
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,540
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: XLua extention beta

    Hey just a quick question about lua in general. I believe, but I am not 100% sure, that it would be safe to call a function with an arbitrary number of parameters- less than the amount used by it. I wrote something of a scripting language in a scripting language in lua, but my clunky implementation takes 10 parameters and calls the first parameter as a function dynamically on the remaining 9 parameters- would it be safe to just shortcut the writing of it by only using as many parameters as are needed per function (calling the 10 parameter function with say 3 parameters). IIRC, this just sets the remaining parameters to nil, right? But what if I did it the other way around and put in too many parameters?

    Also, what do you think about folders inside the xlua embedded script display :P Gets a little crowded with 30+

  6. #406
    Clicker Multimedia Fusion 2
    Retriever2's Avatar
    Join Date
    Jun 2006
    Location
    United States
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: XLua extention beta

    Oh wow, 30+ embedded scripts? I'll consider some upgrades to the script editor .. as it stands there's some elements like the library list that will never be used and need to be removed.

    EDIT: I screwed something up, I'll finish my reply in another post

  7. #407
    Clicker Multimedia Fusion 2
    Retriever2's Avatar
    Join Date
    Jun 2006
    Location
    United States
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: XLua extention beta

    I'm not sure I understand your question about parameters and functions. Are you talking about calling Lua functions from MMF, or calling MMF functions from Lua? I'll try and cover all my bases.

    Calling Lua functions from MMF: You can pass any number of parameters. Extra parameters will be discarded. If you don't specify all the parameters, the remaining will be set to nil. You can also define Lua functions with the vararg (...) and that will pick up all the remaining parameters.

    Calling MMF functions from Lua: If the MMF function uses a certain number of parameters, then you must call the function with all those parameters, or an empty value will be returned and an error will be reported. (In the past, it just crashed). It's safe to pass extra parameters. There are expressions available to read the number of parameters passed, if necessary.

    Return values work analogously.

  8. #408
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,540
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: XLua extention beta

    Oh I was talking about calling lua functions in lua, ie passing a function name as a parameter and invoking it from the global table. MMF interfacing being done just fine but that info is still quite helpful. I actually dug through the Lua manual and found out that yes, it will allow you to call functions with arbitrary parameters and will toss out extra ones and make the rest 'nil'. The same as calling lua from MMF.

  9. #409
    Clicker Multimedia Fusion 2
    Retriever2's Avatar
    Join Date
    Jun 2006
    Location
    United States
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: XLua extention beta

    Small bugfix

    Version 1.5.2: http://taloncrossing.com/xlua/xlua-dist.zip

    If you closed all XLua-containing projects after using XLua's internal editor, and then opened a new XLua-containing project, the editor would not appear. This should now be fixed.

    ---

    Things have been pretty quiet lately. I released my last XLua bugfix back in September (so either XLua has been very stable or no one's using it anymore ). I don't do much with MMF these days, but I've still been checking in every day or so in case issues have come up.

    With all the shuffling going on with new web- and mobile-friendly runtimes, it's hard for me to gauge current interest in old PC-only extensions like XLua. If there's still significant interest in evolving XLua, I have been keeping my eye on LuaJIT 2.0, which I'd like to experiment with. LuaJIT 2.0 runs much faster than the old interpreter, in some cases it runs as fast as native C code. It's impressive. But aside from that, the integration of an FFI extension struck me as very interesting.

    http://luajit.org/ext_ffi.html

    Essentially, this would let you use raw C data structures in your Lua code. And load and use raw C libraries. This would give you quite a bit of low-level power where previously you would need to write up a new C Module.

  10. #410
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: XLua extention beta

    Thanks for the update, i am always interested in developments with this object as it is one of the best in my opinion.

    Being able to use Lua with other runtimes than exe would be really cool, i know you said possibly java might happen which would be really great as that runtime needs some sort of scripting options.

    Since i only really use Lua in MMF2 i am not sure if these links are helpful but i had bookmarked these which might be of interest -

    http://sourceforge.net/projects/luabind/

    http://code.google.com/p/lua-alchemy/

    As for interest in exe i think it will always be there, the FFI extension would be great also as it seems it would allow a lot of cool things. Another thing that would be good is more Lua Extensions/Libraries like AI or XML parsing etc because that would also add much more power.

Page 41 of 43 FirstFirst ... 31 39 40 41 42 43 LastLast

Similar Threads

  1. XLua
    By Retriever2 in forum Released Extensions
    Replies: 6
    Last Post: 13th August 2017, 08:42 PM
  2. Extention error with exe
    By Jinxtengu in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 15th October 2012, 04:47 AM
  3. SPC extention question
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 20th November 2009, 04:25 PM
  4. Lua+ or xLua?
    By Shawn in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 17th October 2009, 11:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •