User Tag List

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

Thread: rpg subtraction

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Aug 2010
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    rpg subtraction

    So im making an rpg and i have an enemy with a defense of 1. But by using a special move i can lower his defense to 0.

    what i want to know is how do i set it so mmf2 knows how much to subtract minus the defense.

    So if i attack and that subtracts 2 but the defense is 1 and the enemy hp is 10 it would only do 9 how do i program that equation in?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleFirefly 3D Module

    Join Date
    Sep 2010
    Posts
    589
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hmm..can't you make a total damage counter where you include all the counters that are affected(Strength,defence etc)? So no matter how low or high your enemy defence is it will always subtract the correct value?...or something That is what I'm doing in my RPG and it seems to work well...at least so far! Or am I just too tired and don't understand you correctly?

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Aug 2010
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you explain that? would i use several counter objects to do that?

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Aug 2010
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And whats your rpg? heres mine so far http://www.youtube.com/watch?v=G5gNoFyS5yk

    , i just dont get how to do this subtraction thing

  5. #5
    Clicker Fusion 2.5Mac Export Module
    Zem's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do you have defence=1 stored? is it an alterable value?

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Aug 2010
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea its in the alterable value

  7. #7
    Clicker Fusion 2.5Mac Export Module
    Zem's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you could then do:

    hp=(hp-alterable value("active"))

    something like that?

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Aug 2010
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Let me explian like this.

    Player attacks - subtract 5 -----enemy defense is 1 so player deals 4 damage.

    How do i get mmf2 to do that? to reconize what the defense is and adjust the damage itself

  9. #9
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Easy peasy, bubba here's how:

    Sword collides with enemy ->
    Subtract (Sword Damage - Enemy Defense) from Enemy HP

    --

    The only thing is if the enemy defense is ever higher than your sword's damage, this formula will actually heal the enemy instead. So you could either make it so that the enemy defense is never higher than the sword damage or run a check using a temp variable first like so:

    Always set Temp TotalDamage to (Sword Damage - Enemy Defense)
    If Temp TotalDamage < 1 then Temp TotalDamage = 1

    Sword collides with enemy ->
    Subtract (Temp TotalDamage) from Enemy HP

    --

    This way you'll never be able to do any less than 1 point of damage to an enemy, and it will never heal them which would be dumb.

  10. #10
    Clicker Fusion 2.5Mac Export Module
    Zem's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    -Sword collides with enemy
    +Subtract abs(Sword Damage - Enemy Defense) from Enemy HP

    :P

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Overlay Subtraction and Addition operations
    By LazyCoder in forum Extension Development
    Replies: 2
    Last Post: 18th October 2007, 12:48 AM

Posting Permissions

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