User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: LUA lag

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA lag

    With a load of LUA script and stuff, my application started lagging. This is obviously because I made it run the whole script constantly in one function. Is there any way to do this otherwise so it doesn't lag?

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: LUA lag

    I think you'd have to split it into multiple functions.
    .:::.Joshtek.:::.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: LUA lag

    Try running the script once, and the script just containing function declarations. The functions will then be in Lua's memory as "compiled" bytecode, and if you call the functions when you need them it will be faster running them than running the file every loop.

  4. #4
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: LUA lag

    Err, could you make a small example of that?

  5. #5
    Clicker Fusion 2.5SWF Export Module
    jpcr's Avatar
    Join Date
    Jul 2006
    Location
    Paris, France
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: LUA lag

    hey, i take this opportunity to ask you guys:

    what kind of things do you do with Lua, I never quite understood what it was adding in terms of functionnality?

    thanks

  6. #6
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: LUA lag

    You can run LUA codes ok

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: LUA lag

    jpcr : LUA is an advanced scripting language. Instead of using the event editor, you could program complex functions in LUA, that would otherwise require tons of events.

    Also, you can enable those who play your game to create custom creatures and enemies by writing their own LUA scripts, rather than having to give them the MMF2 source. It's great in combination with a level editor.

  8. #8
    Clicker Fusion 2.5SWF Export Module
    jpcr's Avatar
    Join Date
    Jul 2006
    Location
    Paris, France
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: LUA lag

    ok great but any nice examples out there?

  9. #9
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: LUA lag

    Quote Originally Posted by jpcr
    ok great but any nice examples out there?
    http://lua-users.org/wiki/ JESUS

    Now back to my question

  10. #10
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: LUA lag

    Here's my code:
    http://www.sendspace.com/file/jjvqet

    The part with the "function always()" is the part that's important.

Page 1 of 2 1 2 LastLast

Posting Permissions

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