Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Damage: Ranged and Close-Combat

Is there any way to make it so that if you use a Gun or if you use a Melle weapon that the damages can be different depending on your level?

For Example: There are several characters to choose from in my game. One happens to be skinny and weak, but is very accurate with a rifle. Another man has never used a gun in his life, but is very strong and would rather use a bat or a steel pipe.

Both of these characters advance differently when they level. But Damage is still calculated the same way for both the Handgun and the Baseball Bat. How can I make it so that lets say Ranged Weapon damage is calculated one way and Close Combat damage is handled another. Because damage is always damage = (atk - (enemy def / 2)) * (20 + str) / 20  and guns don't require strength, but hand weapons do.

Any ideas?
 
I guess you could always make the gun a Skill-- then the "Shoot Gun" move could be set to do damage based on DEX and AGIL.  Not a perfect solution, but it's worth a try, I guess, if nothing else works.
 
can use a script to make it so different stats are used to calculate different weapons damage
ie: dex for the gun and str for the melee

if thats what your looking for you can try this...
paste this in GameBattler3 just under the class
Code:
class Game_Battler
  Range = { 1 => 'Range', 5 => 'Range'}  # <--- like this
the numbers correspond to the weapon's number in the database

then at the damage section paste something like this
Code:
    if Range.has_key?(attacker.weapon_id)
      self.damage = atk * (20 + attacker.str) / 20
    else
       self.damage = atk * (20 + attacker.dex) / 20
    end
think that should work
though my " Range = { " could probably be done in a tidier way =P

can also try this http://www.rmxp.org/forums/index.php?topic=11918.0

hopefully that'll work / is what your looking for
 
vVTalonVv":28tnhonb said:
Any tips on doing so? How do I make it so that not every single character has those skills and only has the skills if they possess that specific weapon?
Sure.  Make a common event with the trigger "Parallel Process" and use a switch which can be turned on when the game starts with an autorun event.  Then, create a conditional branch based on Actor [Person] has [Gun] equipped.  If it's true, then add the skill.  In the else, remove the skill.  This means the person has the skill only while the weapon is equipped.  You can create a chain of these conditional branches to include each gun.  Just a note, though - the changes don't take effect in the menu right away.  The menu has to be closed out and reopened for the changes to take effect because parallel events only work on maps.

If you want to remove attack while the gun is equipped, make the skill become their attack, or just go past the events and make the changes occur with a script, you should head over to the Script Request subforum.

Edit: It looks like Clockwise has you covered.

~Guardian1239
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top