User Tag List

Results 1 to 10 of 10

Thread: Setting a value to 0

  1. #1
    No Products Registered

    Join Date
    Oct 2011
    Location
    Canada
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Setting a value to 0

    hello, I figured I'd repost this more to the point, because I wasn't able to solve an earlier issue.

    I need a calculated value within an expression in the calculator to go to 0 if it is below 0, is there a syntax for this. I can't let the calculated value be 0 because it will add to somehting I want to to subtract from...

    suedo code would be if value <= 0 set value to 0.

    thanks

  2. #2
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    max(0, value)

  4. #4
    No Products Registered

    Join Date
    Oct 2011
    Location
    Canada
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm could you do something like

    max(0, random(10)+1)

  5. #5
    No Products Registered

    Join Date
    Oct 2011
    Location
    Canada
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know that wouldn't produce a negative number, I'm just wondering, lol...

    how about...

    max(0, playerstr+random(10)+1-enemydef)

    ?

  6. #6
    No Products Registered

    Join Date
    Oct 2011
    Location
    Canada
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where do you learn all these syntaxes from...is there a big list of them somewhere?

  7. #7
    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)
    All of the syntaxes can be found in the expression editor. For instance, to find the max syntax, click on the Retrieve data from an object button, and from the Special icon, select Calculations and then click on Maximum of two values.

  8. #8
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't forget the Help file (F1 from pretty much anywhere), as well.

  9. #9
    No Products Registered

    Join Date
    Oct 2011
    Location
    Canada
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, I'm trying to fit this to a potion that doesn't add to health exceeding players max health. instead it's adding max health to players health. Any ideas?

    Max(Player_MaxHealth, Random(20)+10)

  10. #10
    Clicker Fusion 2.5

    Join Date
    Mar 2007
    Posts
    495
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Value A = current health
    Value B = max health

    If Value A > Value B then Set Value A to Value B.

Similar Threads

  1. Setting scale
    By KLiK-iT in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 8th February 2012, 12:41 PM
  2. Setting the focus
    By Game_Master in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 11th June 2010, 06:24 AM
  3. Problem setting Name (Bug??)
    By TreeHugger in forum Lacewing
    Replies: 6
    Last Post: 18th September 2008, 06:44 AM
  4. Setting controls
    By grayhuskie53 in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 14th August 2007, 01:39 AM
  5. Setting a negative value to 0
    By MechatheSlag in forum Multimedia Fusion 2 - Technical Support
    Replies: 20
    Last Post: 5th September 2006, 02:40 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
  •