User Tag List

Results 1 to 4 of 4

Thread: calculation help

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2012
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    calculation help

    hello guys-

    I'll just jot down what I have, and what I'm trying to do

    3 hypothetical variables:

    characterHP
    enemyATK
    characterarmor

    I have a method for the AI to attack, and when it deals damage with the following formula: CharacterHP=CharacterHP-(EnemyATK-CharacterArmor)

    Problem is, is if the CharacterArmor attribute is > EnemyATK, the enemy will heal the character whenever it attacks. How could I turn the right side of this statement (the action), to just be zero if CharacterArmor is > EnemyATK? Or would I have to right a second statement? I'd prefer to not right another statement if possible, to keep this as clean and smooth as possible. I realize that MMF has some extra keynames, some of which I"m not familiar with (like MAX or MIN), and was wondering if there was such a keyword to denote a value of 0 if the value turns out to be negative within the parenthesis.

    If a second statement is required for covering this, let me know.

  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    CharacterHP = CharacterHP - max(EnemyATK - CharacterArmor, 0)

    Max(), min(), etc are all explained in the documentation. They work just the same as they do in spreadsheet apps such as Microsoft Excel.

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2012
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you muddymole. where can i find the documentation for these, and others within mmf2? are they consolidated somewhere? when i tried searching the contents area with MIN or MAX, nothing really showed up of use that i could find.

    thanks again, it definitely works!

  4. #4
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Help -> Contents -> Objects -> Special Object -> Expressions...
    (or just search for "maximal" is quickest)

Similar Threads

  1. Angle calculation bug?
    By Fanotherpg in forum SWF/Flash Export Module Version 2.0
    Replies: 2
    Last Post: 23rd April 2012, 09:38 AM
  2. Speed calculation
    By Boba Fonts in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 9th May 2010, 05:29 PM
  3. Angle Calculation
    By lincore in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 17th October 2008, 12:53 PM
  4. What is the function/calculation for...
    By Ben in forum Multimedia Fusion 2 - Technical Support
    Replies: 15
    Last Post: 6th July 2006, 03:36 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
  •