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.

HBGames

Hi

I'm using Kios reputation system (ver. 1.2), but I dont remember the call scripts to use it. In example, how to decrease fanction's reputation.

Here's the code:

PHP:
#==============================================================
# Kio's Reputation System v1.2
#==============================================================


class Game_System
attr_accessor :fac_rep
attr_accessor :fac_active

alias rep_initialize initialize
def initialize
rep_initialize
@fac_rep=[]
@fac_active=[]
end
end

class Scene_Title
alias cng command_new_game
def command_new_game
cng
#Determine the initial settings for the faction's reputations here
$game_system.fac_rep = [50, 50, 50, 50, 50, 50, 50, 50]
#Determine the inital factions you can see here.
$game_system.fac_active = ["active", "active", "active", "active", "active", "active", "active"]
end
end

class Scene_Reputation
def main
@status_window = Window_Reputation.new
@sprite = Spriteset_Map.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@status_window.dispose
@sprite.dispose
end

def update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(5)
return
end
end
end

class Window_Reputation < Window_Base
attr_accessor :factions
attr_accessor :fac_rep
attr_accessor :reptypes
attr_accessor :fac_active

def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.back_opacity = 120
@factions = ["Test1", "Test2", "Test3", "Test4", "Test5", "Test6", "Test7"]
@rep = ["Test", "Test", "Test", "Test", "Test", "Test", "Test"]
refresh
end

def draw_repbar(x, y, width, height, current, max)
x -= 10
for i in 0..(height+2)
self.contents.fill_rect(x-3+i, y - 1 + i, width+5, 1, Color.new(255, 255, 255, 255))
end
for i in 0..height
self.contents.fill_rect(x+i, y+i, width+1, 1, Color.new(0, 0, 0, 255))
end
for i in 0..height
for j in 0..current
self.contents.fill_rect(x+j+i, y+i, 1, 1, Color.new(0, 0 + (1.25*j), 255 - (1.25*j), 255 - (5*i)))
end
end
end

def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = 32
self.contents.draw_text(20, 40, 184, 32, "Arvostus", 2)
self.contents.font.size = $fontsize
for i in [email=0...@factions.size]0...@factions.size[/email]
y = 80 + (i * 70)
x = -30
if i > 4
x = 280
y = 80 + ((i - 5) * 70)
end
if $game_system.fac_rep[i] > 100
$game_system.fac_rep[i] = 100
end
if $game_system.fac_rep[i] < 0
$game_system.fac_rep[i] = 0
end
if $game_system.fac_active[i] == "active"
draw_fac(x, y, i)
end
self.contents.font.color = normal_color
end
end

def draw_fac(x, y, i)
self.contents.draw_text(x+40, y, 160, 32, @factions[i], 0)
draw_repbar(x+90, y+32, 200, 14, 2 * $game_system.fac_rep[i], 100)
self.contents.font.color = system_color
if $game_system.fac_rep[i] >= 90
self.contents.draw_text(x+210, y, 96, 32, @rep[0], 2)
elsif $game_system.fac_rep[i] >= 75
self.contents.draw_text(x+210, y, 96, 32, @rep[1], 2)
elsif $game_system.fac_rep[i] >= 55
self.contents.draw_text(x+210, y, 96, 32, @rep[2], 2)
elsif $game_system.fac_rep[i] >= 45
self.contents.draw_text(x+210, y, 96, 32, @rep[3], 2)
elsif $game_system.fac_rep[i] >= 25
self.contents.draw_text(x+210, y, 96, 32, @rep[4], 2)
elsif $game_system.fac_rep[i] >= 10
self.contents.draw_text(x+210, y, 96, 32, @rep[5], 2)
else
self.contents.draw_text(x+210, y, 96, 32, @rep[6], 2)
end
end
end

Thanks if someone is willing to help :) . I'm not a scripter

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