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.

read out str (strength) from database ?

hey.
i have here 6 rates :
@str = 5
@dex = 5
@con = 5
@wis = 5
@int = 5
@cha = 5

how can i read these rates from the database ?
i hope you know what im meaning. for example :
@str = base_str ( but this isnt working )
@str = str_plus ( isnt working too )
please help me, and sry for my bad english.
 
@str = (readout in Database)
should sets the strength value from the database, in Game_Actor the str were calculated, but how can i readout the calculated str value ? sorry i cannot explain it more exactly.
 
Try to explain what are are wanting without any code. Sometimes when people ask for something and insert their own code, it doesn't do anything but confuse people who are helping you. ^_^


If you are just trying to read the strength from an actor, just use:

Code:
str = $game_actors[actor_id].str

The base_str is just something that is used throughout Game_Battler, Game_Enemy, and Game_Actor. Deleting it takes a good amount of knowledge of these classes, but even then, can cause compatability trouble.
 
i was using Realistic ABS by Caldaron. But when i get a level up, i didnt get more strongth, and i even cant change it in the database. her is the RPG:ACTOR from his script
Code:
module RPG
  class Actor
    
    attr_accessor :str
    attr_accessor :dex
    attr_accessor :con
    attr_accessor :wis
    attr_accessor :int
    attr_accessor :cha
    attr_accessor :right_hand
    attr_accessor :left_hand
    attr_accessor :head_id
    attr_accessor :body_id
    attr_accessor :hands_id
    attr_accessor :legs_id
    attr_accessor :feet_id
    attr_accessor :cape_id
    attr_accessor :neck_id
    attr_accessor :ring1_id
    attr_accessor :ring2_id
    attr_accessor :right_hand_fix
    attr_accessor :left_hand_fix
    attr_accessor :head_fix
    attr_accessor :body_fix
    attr_accessor :hands_fix
    attr_accessor :legs_fix
    attr_accessor :feet_fix
    attr_accessor :cape_fix
    attr_accessor :neck_fix
    attr_accessor :ring1_fix
    attr_accessor :ring2_fix
    
    def set_evergore
      @str = 5
      @dex = 5
      @con = 5
      @wis = 5
      @int = 5
      @cha = 5
      @right_hand = [1, 1, 1] # [1 = Weapon 2 = Armor, ID]
      @left_hand = [1, 2, 1]
      @head_id = 2
      @body_id = 3
      @hands_id = 4
      @legs_id = 5
      @feet_id = 6
      @cape_id = 7
      @neck_id = 8
      @ring1_id = 9
      @ring2_id = 10
      @right_hand_fix = false
      @left_hand_fix = false
      @head_fix = false
      @body_fix = false
      @hands_fix = false
      @legs_fix = false
      @feet_fix = false
      @cape_fix = false
      @neck_fix = false
      @ring1_fix = false
      @ring2_fix = false
    end
  end
end
but i cant just remove the 6 abilities, i get a lot of errors in other scripts. so i just want to read the abilities from the database. And for example
str = $game_actors[actor_id].str isnt working. "Name error occured. undefined local variable or method `actor_id for #...
 

Mac

Member

If you aren't getting any extra stats then it would be because the variables aren't being updated, what you have there sets it, so your problem is most doubtably somewhere else.
 

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