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.

[Resolved] Player Initial Atk

Status
Not open for further replies.
solved Q #1
First Question: How do I make it so that an actor starts off with a certain attack value, so they don't do 0 damage all the time.

solved Q #2
Second Questin: Ok, most problem solved. except i want my weapon to add onto the base attack instead of re-write the atk. Like say base atk is 15, and weapon is 75, the atk is 75, i want it to be 90, any one help with this small problem? Thanks
Current Question
Third Question: Im sure im annoying you all right now, but i want to show an animation when unarmed, such as hit. Any help is appreciated. Thanks
                                           -Rpgfanatic
 

poccil

Sponsor

The base_atk method of Game_Actor looks like this:

Code:
  def base_atk
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.atk : 0
  end

Replace the 0 with 20, or even with a method call, in case the initial ATK should be different for different actors:

Code:
  def base_atk
    weapon = $data_weapons[@weapon_id]
    startingAtk=0
    startingAtk=20 if @class_id==1 # @class_id for classes, or @actor_id for actors
    startingAtk=30 if @class_id==2
    startingAtk=10 if @class_id==3
    return weapon != nil ? weapon.atk : startingAtk
  end

Many of the other functions of Game_Actor, like base_str, base_int, and base_dex, are very similar and can be modified in much the same way.
 
thanks, ill check and see if i can get it too work!

EDIT: Ok, 1 more thing. Can you tell me how to make it so the weapon adds on to the base atk, not just make it the weapon atk? Thx for everything though.
 

poccil

Sponsor

That's also easy to do.  Using the example above:

Code:
  def base_atk
    weapon = $data_weapons[@weapon_id]
    startingAtk=0
    startingAtk=20 if @class_id==1 # @class_id for classes, or @actor_id for actors
    startingAtk=30 if @class_id==2
    startingAtk=10 if @class_id==3
    atk=startingAtk
    atk+=weapon != nil ? weapon.atk : 0
    return atk
  end

Example with base_dex:

Code:
  def base_dex
    n = $data_actors[@actor_id].parameters[3, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    #########
    n+=20 if @class_id==1 # @class_id for classes, or @actor_id for actors
    n+=30 if @class_id==2
    n+=10 if @class_id==3
    #########
    n += weapon != nil ? weapon.dex_plus : 0
    n += armor1 != nil ? armor1.dex_plus : 0
    n += armor2 != nil ? armor2.dex_plus : 0
    n += armor3 != nil ? armor3.dex_plus : 0
    n += armor4 != nil ? armor4.dex_plus : 0
    return [[n, 1].max, 999].min  # Minimum 1, maximum 999
  end
 
rpgfanatic":1v2lwldn said:
Ok, most problem solved. except i want my weapon to add onto the base attack instead of re-write the atk. Like say base atk is 15, and weapon is 75, the atk is 75, i want it to be 90, any one help with this small problem? Thanks

                                          -Rpgfanatic

Please don't edit your posts so that the original question is deleted, simply add your further questions in case. That makes the discussion inconsistent.
 
Look in Game_Actor
Code:
  #--------------------------------------------------------------------------
  # * Get Offensive Animation ID for Normal Attacks
  #--------------------------------------------------------------------------
  def animation1_id
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.animation1_id : 0
  end
  #--------------------------------------------------------------------------
  # * Get Target Animation ID for Normal Attacks
  #--------------------------------------------------------------------------
  def animation2_id
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.animation2_id : 0
  end

Just replace those 0's with an animation id of your choice.
 
Status
Not open for further replies.

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