User Tag List

Results 1 to 9 of 9

Thread: Does Fusion 2.5 have functions?

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)

    Join Date
    Jun 2014
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Does Fusion 2.5 have functions?

    I'm still getting to grips with Fusion 2.5. I come from a programming background and I was wondering if it's possible to have something to similar to functions or sub-routines?

    I know it's possible to activate event groups, so I suppose this is similar. But I notice that event groups are run at runtime regardless. A workaround would be on frame start disable the event group and then activate it when needed and then when all of the events in the group have been run to disable it again until it is next activated. Is doing this logical or are there better methods?

    Or I suppose another method would be set a variable/flag, and only run the event group when the condition is true and also when the variable/flag is set.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA Export ModuleInstall 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)
    piscesdreams's Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    921
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You can right click on an event group and and disable it at start.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    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)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,344
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Fusion doesn't have functions. This is something that hopefully will come around in Fusion 3.
    What you can do is to use fastloops. Run a loop 1 time, and On Loop, do the events that should be triggered by the function. You can also combine this with event groups.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleMac Export Module

    Join Date
    Sep 2006
    Location
    UK
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also coming from a programming background this is something I really miss too.

    So what I do to keep things tidy is use event groups, I create a group and disable at start, then use the "on group activation" to do all what i need and any other events in there then once complete I disable the group.

    But +1 but functions to be added with params!

    Andy

  5. #5
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)

    Join Date
    Jun 2014
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the info. I'm getting there, but Fusion does take some getting used to. The basics are easy, but for more complicated things I have to forget how I would do a task using code and then find how it's done in Fusion. But I think Fusion 2.5 is great, I'm pleased that I bought it recently in the Steam sale and I am determined to fully understand it.

  6. #6
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Immediates conditions, with an emphasis on fastloops, are a bit like functions from other programming languages such as C++. When they are found, MMF2 and Fusion immediately look for other similar immediate functions. Once they are found all of them are executed as many times as they are needed. Afterwards, the program will resume where it left off.

    I think this page might be able to provide you more information on Immediate conditions.

    http://www.xable.us/fastloops.php

    One major difference between fastloops and function is that you do not pass arguments to fastloops. If you wanted to pass arguments, you would need to set aside extra variables and set those variables whenever the fastloop is called.

  7. #7
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're really have your heart set on coding functions in the traditional method, the xLua extension will let you integrate Lua scripts into your Fusion application, allowing you to write nifty reusable functions. It's windows runtime compatible only though.

  8. #8
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)

    Join Date
    Jun 2014
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the replies. Also thanks to ProdigyX for the link to your website - excellent source of info!

  9. #9
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Sphax's Avatar
    Join Date
    Jun 2006
    Location
    Paris, France
    Posts
    4,454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should also try the "Immediate If" (iif) which is very (VERY) convenient to make a lot less events via direct tests in expressions.

Similar Threads

  1. LUA MF functions
    By MattEsch in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 3rd December 2008, 02:55 PM
  2. DISABLE KEY FUNCTIONS?
    By Kintalo in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 14th September 2008, 09:17 PM
  3. Using DLL Functions
    By Jaffob in forum Extension Development
    Replies: 18
    Last Post: 27th August 2008, 10:44 PM
  4. LUA return-functions
    By Looki in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 18th March 2007, 09:03 AM
  5. Trig functions
    By GamesterX23 in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 21st January 2007, 03:12 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
  •