[RMMV] D100 / TABLETOP STYLE GAME ENGINE MATHS

Posts

Pages: 1
Hello,

I am attempting to figure out how to replicate a RNG based on 100, similar to say, Call of Cthulhu... or any similar D100 based RNG for tabeltops.

I would like to have skills test against a variable and if the variable is lower than the skill's rng "roll" , then the ability is successful.

I watched Driftwood's video on "Variable Skills" from Feb 2017. Although it is helpful with directing one on how to create an increasing effect on items through repetitive use.... (to my understanding) for the most part it is based on a guaranteed success every time it is activated.


What the end product I am looking to achieve will appear similar to the following:

the player will have a variety of different skills which they can increase over the course of the game through quests, experience allocation points, etc.
These skills are examples like: spot, firearms, fighting, science, library, medicine, stealth, and engineering.
Through different aspects of the game these various subject skills are of use.

I am looking to have the weapons reflect the percentage of success in addition to their base damage (assuming success check passed).
An arbitrary way I suppose the percentage could be achieved is just to utilize the variance already built into the menus when creating the weapon stats.
Although I could continue on about events of stealthiness pasting npcs, using search when entering a room to locate important hidden items or a variety of other options...
to my understanding would all still pivot around the ability or inability of being able to cross reference variables to check for successes.

How would this be accomplished and/or where should I be referencing on the net to find the answers if this has previously been inquired? Are there any plugins to which I am ignorant of them solving my development dilemma?

A HUGE Thank You!

-CrownTarget
Marrend
Guardian of the Description Thread
21781
I don't know where in MV it determines the hit-rate, but, if it's anything like Ace, the variance of a skill isn't a factor until damage resolution. Saying that, it doesn't seem like you necessarily want to apply a skill's variance to it's hit rate in the first place.

However, more to the point, yeah, this idea definitely pivots around the concept of checking against variables. You're probably not going to be checking against a game-variable, though. You probably want an attribute, or a set thereof, attached to the actor class. I can't provide any MV examples, as I only have Ace, but, I can kinda envision an end result where you're using Conditional Branch, and selecting the script option, to determine whither or not a skill-check has been passed.

*Edit: For a small bit of reference...

class Scene_WarBattle < Scene_MenuBase
  def skill_check(skill, obj, obj2=nil)
    if obj2 != nil
      if obj.skill.include?(skill) && obj2.skill.include?(skill)
        num1 = rand(3)
        num2 = rand(3)
        if num1 == 0 && num2 == 0
          return true
        else
          return false
        end
      else
        return false
      end
    else
      if obj.skill.include?(skill)
        if skill == "Rest"
          return true
        else
          num = rand(3)
          if num == 0
            return true
          end
        end
      end
    end
  end

  def ability_triggers(a, b, index)
    # Shortcuts.
    ally = a[index]
    enemy = b[0]
    
    # Check for Evade.
    if skill_check("Evade", ally, enemy)
      # Evade success on both ends.
      # Nothing happens, order of operations irrelevant.
      @info.add_text(enemy.name + " evades the attack!")
      @info.add_text(ally.name + " evades the counterattack!")
      post_results(a, b, index)
      return
    elsif skill_check("Evade", ally)
      # Ally unit Evade success, enemy unit at risk.
      # In this situation, only Critical would matter. First Strike doesn't
      # grant any advantages to either side here.
      if skill_check("Critical", ally)
        result = damage(100, ally.str, enemy.def)
        @info.add_text(ally.name + " criticals, dealing " + result.to_s + " damage!")
        @info.add_text(ally.name + " evades the counterattack!")
        enemy.troops -= result
        post_results(a, b, index)
        return
      else
        result = damage(50, ally.str, enemy.def)
        @info.add_text(ally.name + " deals " + result.to_s + " damage.")
        @info.add_text(ally.name + " evades the counterattack!")
        enemy.troops -= result
        post_results(a, b, index)
        return
      end
    elsif skill_check("Evade", enemy)
      # Enemy unit Evade success, ally unit at risk.
      # In this situation, only Critical would matter. First Strike doesn't
      # grant any advantages here.
      if skill_check("Critical", enemy)
        result = damage(100, enemy.str, ally.def)
        @info.add_text(enemy.name + " evades the attack!")
        @info.add_text(enemy.name + " counterattacks!")
        @info.add_text("Critical hit for " + result.to_s + " damage!")
        ally.troops -= result
        post_results(a, b, index)
        return
      else
        result = damage(50, enemy.str, ally.def)
        @info.add_text(enemy.name + " evades the attack!")
        @info.add_text(enemy.name + " counterattacks for " + result.to_s + " damage.")
        a[index].troops -= result
        post_results(a, b, index)
        return
      end
    end
    # Evasion failure on both ends.
    
    # Check for First Strike.
    if skill_check("First Strike", ally, enemy)
      # First Strike success on both ends. Abilities cancel, proceed as normal.
      # Check for Ally Critical.
      if skill_check("Critical", ally)
        result = damage(100, ally.str, enemy.def)
        @info.add_text(ally.name + " criticals, dealing " + result.to_s + " damage!")
        enemy.troops -= result
      else
        result = damage(50, ally.str, enemy.def)
        @info.add_text(ally.name + " deals " + result.to_s + " damage.")
        enemy.troops -= result
      end
      
      # Check for Enemy Critical
      if skill_check("Critical", enemy)
        result = damage(100, enemy.str, ally.def)
        @info.add_text(enemy.name + " counterattacks!")
        @info.add_text("Critical hit for " + result.to_s + " damage!")
        ally.troops -= result
        post_results(a, b, index)
        return
      else
        result = damage(50, enemy.str, ally.def)
        @info.add_text(enemy.name + " counterattacks, dealing " + result.to_s + " damage.")
        ally.troops -= result
        post_results(a, b, index)
        return
      end
    elsif skill_check("First Strike", ally)
      # Ally unit First Strike success.
      # Check for Ally Critical.
      if skill_check("Critical", ally)
        result = damage(100, ally.str, enemy.def)
        @info.add_text(ally.name + " criticals, dealing " + result.to_s + " damage!")
        enemy.troops -= result
      else
        result = damage(50, ally.str, enemy.def)
        @info.add_text(ally.name + " deals " + result.to_s + " damage.")
        enemy.troops -= result
      end
      @info.add_text(ally.name + " gets a first strike!")
      @info.add_text("No counterattack for " + enemy.name + "!")
      post_results(a, b, index)
      return
    elsif skill_check("First Strike", enemy)
      # Enemy unit First Strike success.
      # Check for Enemy Critical.
      if skill_check("Critical", enemy)
        result = damage(100, enemy.str, ally.def)
        @info.add_text(enemy.name + " criticals, dealing " + result.to_s + " damage!")
        ally.troops -= result
      else
        result = damage(50, enemy.str, ally.def)
        @info.add_text(enemy.name + " deals " + result.to_s + " damage.")
        ally.troops -= result
      end
      @info.add_text(enemy.name + " gets a first strike!")
      @info.add_text("No counterattack for " + ally.name + "!")
      post_results(a, b, index)
      return
    end
    # First Strike failure on both ends.
    
    # Ally Critical check.
    if skill_check("Critical", ally)
      result = damage(100, ally.str, enemy.def)
      @info.add_text(ally.name + " criticals, dealing " + result.to_s + " damage!")
      enemy.troops -= result
    else
      result = damage(50, ally.str, enemy.def)
      @info.add_text(ally.name + " deals " + result.to_s + " damage.")
      enemy.troops -= result
    end
    
    # Enemy Critical check.
    if skill_check("Critical", enemy)
      result = damage(100, enemy.str, ally.def)
      @info.add_text(enemy.name + " counterattacks!")
      @info.add_text("Critical hit for " + result.to_s + " damage!")
      ally.troops -= result
      post_results(a, b, index)
      return
    else
      result = damage(50, enemy.str, ally.def)
      @info.add_text(enemy.name + " counterattacks for " + result.to_s + " damage.")
      ally.troops -= result
      post_results(a, b, index)
      return
    end
  end
end

...this is a code-snippet from this game. While what you're looking for is probably going to be different in execution, perhaps it can at least inspire.
Assuming I understood you correctly, you can do it with Common Events. Although it does get clunky, but it is doable.

Like so:

Thank you.

Both of you!

Truely, thanks.

Now.. to the many many days and weeks of data entry and trial.
Pages: 1