User Tag List

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

Thread: Problem with Lua

  1. #1
    No Products Registered

    Join Date
    Oct 2006
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with Lua

    I have a problem with the lua object:

    for example:

    I write DoCall("MakeEnemyJump",3) which tells the enemy to jump 3 pixels high.

    But here's the problem: I want it to jump by letting MMF2 read the code script.

    I mean something like this.

    If EnemyCollidesWithBackground
    DoCall("MakeEnemyJump",3)

    Can anyone help me out ?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

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

    Re: Problem with Lua

    If Enemy collides with a background object:
    ..... Set y position of enemy to (y position of enemy)+3

    You don't need Lua, you do it with MMF actions.

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2006
    Posts
    271
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with Lua

    I think the "OnFunction" event can help with this.

  4. #4
    No Products Registered

    Join Date
    Oct 2006
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with Lua

    Thanks but actually I want to write the code outside MMF, so that it can be executed in MMF's runtime.

    Basicly I want to write a condition using Lua, so that it can be executed as a MMF condition in the runtime.

    robbie* Yeah I tried many combinations using that event but none worked.

  5. #5
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

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

    Re: Problem with Lua

    If I understand what your post correctly, you definitely need to use the "On function" condition- are you sure you are trying to use it correctly?

    Code:
    On function "jump"
      - set Y position of enemy to (Y position of enemy)+LuaValParam( "Lua object",0)
    and then in lua

    Code:
    DoCall("jump",3)

  6. #6
    No Products Registered

    Join Date
    Oct 2006
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with Lua

    I know that part, what you're showing me is the event that is triggered when MMF find DoCall("jump",3), what I'm looking for is how to trigger that event, using Lua.

    Thanks anyway !

  7. #7
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

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

    Re: Problem with Lua

    You are being very unclear- in that example, Lua triggers the MMF event.

  8. #8
    No Products Registered

    Join Date
    Oct 2006
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with Lua

    Sorry
    I'll try again:

    That event is executed when MMF finds DoCall("jump",3) , right ?

    So I want that event to be activated by lua, so that MMF knows when to trigger the event/function.

  9. #9
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

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

    Re: Problem with Lua

    But it is activated by Lua. Whenever you do DoCall("jump",3) in Lua, it triggers the condition in MMF.

  10. #10
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2006
    Posts
    271
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with Lua

    Is this anything like what you want?

    Lua script:
    Code:
    function SpacePressed()
    result=DoCall("test")
    if result == "true" then
      return true
    else
      return false
    end
    end
    
    if SpacePressed() then
    DoCall("add",1)
    end
    Events
    * On function "add"
    - Return "true"

    *On function "add"
    - Add LuaValParam( "Lua object", 0) to counter

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Pulling Problem and Shooting Problem
    By Duggabboo in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 21st March 2010, 05:24 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
  •