Results 1 to 7 of 7

Thread: XLua

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Jun 2006
    Location
    United States
    Posts
    501

    XLua

    XLua Version 1.5

    XLua has already been available as a beta extension for well over a year, but is now considered mature. It is a stable and feature-rich replacement for the previous Lua Object and Lua+ Object.

    In addition to features present in the other Lua objects, XLua includes:
    - Current Lua version 5.1.4 plus patches
    - JIT-based VM for faster exececution
    - Improved error reporting
    - Support for both Lua and Lua+ calling conventions
    - Support for multiple independent Lua states
    - Support for global Lua states
    - Support for 3rd party libraries*
    - Support for multiple embedded scripts
    - Syntax-highlighted script editor
    - Support for manipulating selection lists
    - Well documented

    * Any existing Lua C Module can be recompiled for use with XLua. In addition, several 1st party C Modules were written specifically for XLua and are included with its distribution:

    - MMF Interface (mmfi.dll): Directly access and manipulate other objects on the frame. Also provides access to some other MMF state.
    - XLuaGL (opengl.dll): Derived from LuaGL, provides API for most of OpenGL 2.0, used in conjunction with any of the OpenGL objects.
    - Array (array.dll): Provides multi-dimensional, fixed-size, non-garbage-collected storage for numerical data.

    Download: Version 1.5 (Always points to latest version)
    Online Documentation: Available here

    Support for XLua, as well as access to beta releases, can be obtained Here

  2. #2
    Clicker Multimedia Fusion 2

    Join Date
    Jun 2006
    Location
    United States
    Posts
    501

    Re: XLua

    XLua Version 1.5.1

    This update fixes a bug in coroutine support, which would cause MMF functions returning values to a coroutine to return nil instead. This bug was a partial regression from earlier builds.

    Download: Version 1.5.1

  3. #3
    Clicker Multimedia Fusion 2

    Join Date
    Jun 2006
    Location
    United States
    Posts
    501

    Re: XLua

    XLua Version 1.5.2

    This update fixes a minor bug where the internal editor would not appear correctly under certain circumstances.

    Download: Version 1.5.2

  4. #4
    This is a cool object. Does it work with exporters like iOS, Android, and HTML5?

  5. #5
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Darkhog's Avatar
    Join Date
    Jan 2009
    Location
    /dev/null
    Posts
    328
    Very nice object and easy to understand too. Three things though:

    1. Example ext_mmfi doesn't work (nil error on line 86 in Demon AI that despite my best tries I couldn't fix)
    2. Help button in the extenson's properties doesn't launch the help file (xlua.chm)
    3. I feel like calling functions could be simplified. Instead of pushing parameters, why not just treat function call as "lua line"?

    The latter needs a bit of explanation as I feel I wasn't clear enough. So instead of thing like this:

    - Push integer parameter Global Value A
    - Push string parameter Global String A
    - Begin table
    - Push integer parameter Global Value B
    - Push integer parameter Global Value C
    - Push integer parameter Global Value D
    - Push string parameter Global String B
    - End table
    - call function "somefun"

    you'd just do it like that:

    - Call function "somefun("+Str$(Global Value A)+","""+Global String A+""",{"+Str$(Global Value B)+","+Str$(Global Value C)+","+Str$(Global Value D)+","""+Global String B+"""})"
    Last edited by Darkhog; 13th August 2017 at 08:43 PM.

  6. #6
    Quote Originally Posted by Darkhog View Post
    Very nice object and easy to understand too. Three things though:

    1. Example ext_mmfi doesn't work (nil error on line 86 in Demon AI that despite my best tries I couldn't fix)
    2. Help button in the extenson's properties doesn't launch the help file (xlua.chm)
    3. I feel like calling functions could be simplified. Instead of pushing parameters, why not just treat function call as "lua line"?

    The latter needs a bit of explanation as I feel I wasn't clear enough. So instead of thing like this:

    - Push integer parameter Global Value A
    - Push string parameter Global String A
    - Begin table
    - Push integer parameter Global Value B
    - Push integer parameter Global Value C
    - Push integer parameter Global Value D
    - Push string parameter Global String B
    - End table
    - call function "somefun"

    you'd just do it like that:

    - Call function "somefun("+Str$(Global Value A)+","+Global String A+",{"+Str$(Global Value B)+","+Str$(Global Value C)+","+Str$(Global Value D)+","+Global String B+"})"
    1. This is due to the "mmf.newObjectClass()" function being broken in F2.5. I'm working on an updated version of the extension to correct this and a few other F2.5 specific issues, but it may be a while before I have time to finish and release it.
    You can still use the mmf.newObject() function to manually a build a table containing the objects you need, however the collision detection functions will still be broken (class.testBackdrop and similar)

    3. You can use the "Call with X parameters" action to achieve this; I'm unsure if you can pass a table though. If it doesn't work you might try implementing some sort of serializer in mmf and then de-serializing the table in the Lua script.

  7. #7
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Darkhog's Avatar
    Join Date
    Jan 2009
    Location
    /dev/null
    Posts
    328
    Call with X parameters, according to XLua docs is using Lua+ syntax, which is pipe (|) separated list of parameters. I want something that only has one action parameter which specifies function name and parameters in the same way you'd call the function directly from Lua code.

Similar Threads

  1. XLua convert to iOS?
    By Pharanygitis in forum iOS Export Module Version 2.0
    Replies: 4
    Last Post: 23rd January 2012, 11:31 AM
  2. pblua for xlua? Could it be done?
    By cel in forum Lua Scripting
    Replies: 5
    Last Post: 12th December 2010, 08:03 PM
  3. Lua+ or xLua?
    By Shawn in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 17th October 2009, 11:55 PM
  4. xLua Crash
    By Corentin in forum File Archive
    Replies: 0
    Last Post: 5th March 2009, 06:44 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
  •