RMMV Damage Formula - ideas and help

● ARCHIVED · READ-ONLY
Started by Shaz 1539 posts Page 58 of 77 View original ↗
  1. Waterguy said:
    @BaronVampson I'd really think it would be better if you had just edited the post and added the solution instead. After all, like you had a problem but found the solution, others could have the same problem and see in your post and seen your solution faster.

    I guess i may be too late, but... well, just an idea for next time.

    Hey sorry, the problem was with my input of data (I put the wrong piece of gamedata in by mistake) not with the code itself so I didn't see much point in keeping it up since the problem wasn't even with the code in question, but if the issue is that people want me to share my damage formula, which I suppose I would have had to do if it *was* indeed broken, I would be more comfortable to do so when my project is out the gate so to speak.. But because the problem was specifically on my end, I panicked and hit the escape button lol but if people are that curious I can share.
  2. It still works the same way, but the method and class names are different. So grabbing a formula that worked in Ace doesn't mean it's just going to work in MV.
  3. I'm looking to make some simple skills that have set damage ranges like in dragon quest. For example: a fire spell that does 10-20 damage or a heal spell that heals 30-50 Hp. Can someone help me with the formula? Thanks.
  4. if the damage is set, it is simple. in your example of 30 to 50, "30 + Math.randomInt(21)" (er, I think it is randomInt, been a while since I used it... not many places with js can use it by default, but I remember mv could).
    30 is the base, minimum value, and randomInt will give a random result between 0 and 20 (think about it as the 21 is because 0 counts, thus the max of 20 plus 1 for the 0. it is not the real explanation, but it is simple enough to get the idea how it works)
  5. Waterguy said:
    if the damage is set, it is simple. in your example of 30 to 50, "30 + Math.randomInt(21)" (er, I think it is randomInt, been a while since I used it... not many places with js can use it by default, but I remember mv could).
    30 is the base, minimum value, and randomInt will give a random result between 0 and 20 (think about it as the 21 is because 0 counts, thus the max of 20 plus 1 for the 0. it is not the real explanation, but it is simple enough to get the idea how it works)
    Thanks! That is exactly what I needed.
  6. Hello. I'm having an issue implementing a variable inside the damage formula. In other words, what I'm asking is how can you save the actor ID after an actor uses a particular skill to a variable? I need this information to tell the system which actor to deplete (meaning their special gauge that I created).

    How I tried to do this was with this formula :

    { v[25]=a.actorId(); } { a.atk*4 - b.def*2 }

    Javascript honestly is my least competent language. I'm more used to C++, Python, or anything else really.
  7. try
    v[25]=a.actorId(); a.atk*4 - b.def*2
  8. Waterguy said:
    try
    v[25]=a.actorId(); a.atk*4 - b.def*2
    Okay thanks. I believe this was actually one of the first things I tried, but let me try again to make sure.


    Yeah. It does work, but the problem is that when the enemy attacks my characters never take any damage. I am trying to make a system that, in order to attack, you need a gauge to be filled. This includes the default attack, and is actually the skill I am talking about. Do you think I will need to change what default attack my actors use, or is there another way to get this to work?
  9. If an enemy is using that same skill to attack with, it's going to mess up because enemies don't have an actor id. Try this revised version:

    Code:
    if (a.isActor()) v[25] = a.actorid(); a.atk * 4 - b.def * 2
  10. As aesica said, enemies don't have an actorId. I was thinking since you wanted it this skill was going to be actors only. sorry.
  11. Hey gang, I'm trying to create an item that will heal HP and MP and subtract TP when used on an actor. So far I've written it like this in the formula box:

    a.luk + 10; a.gainMp(a.luk + 10); a.gainTp(-10)

    But this doesn't seem to have an effect.
  12. the final damage needs to be the last thing on the damage formula.
    so, you need to change the order there.
    a.gainMp(a.luk + 10); a.gainTp(-10); a.luk + 10
  13. Waterguy said:
    the final damage needs to be the last thing on the damage formula.
    so, you need to change the order there.
    a.gainMp(a.luk + 10); a.gainTp(-10); a.luk + 10

    Lol of course. I set it up and that seems to have worked, but now it's giving MP and subtracting TP to only the party leader when using it from the menu.
  14. Why not just have it cost the required amount of TP? If you just subtract it, they can use the skill at will whether or not they have any TP. This also informs the player of the cost in a more visually-appealing way.
  15. @Aesica TP isn't used directly for skills in my game, it acts as an anxiety meter. The item takes away TP when used.
  16. Uzuki said:
    @Aesica TP isn't used directly for skills in my game, it acts as an anxiety meter. The item takes away TP when used. Also the item menu doesn't allow you to subtract TP by default.
  17. @Uzuki that is because it is an item, not a skill.
    Items are used by the person with the highest pha, I think? and if more than one have the same pha it is the one closest to the leader?
    well, you may want to change those a to b in the formula to affect the person the item is used on then. a is the user, b is the one it is used on.
  18. @Waterguy Of course that makes perfect sense. Thank you so much for the help friend!
  19. Oh, so -tp is actually a benefit? Interesting!
  20. @Aesica Yeah the way it works is that when the Anxiety (TP) Meter becomes full, that character enters a Panic state and the player will lose control of them until it's cured. This will also add a count to a permadeath count and if that count gets too high the character will die. Enemies, certain skills and interactive events can increase that stress with attacks or just getting unlucky. There are some upsides to a high anxiety meter tho, with unlocking certain powerful skills, special equipment that gives buffs with high stress and allowing characters to become immune to certain status effects.