04-25-2021, 07:41 AM
Just in the very hypothetical case you have been wondering what the hell have I been doing as of late, here you can find the answer to your silly question.
I have been playing Lords of the Realms 2 and got an idea for a game or mini game so I started crafting the barebones of a new script. Here it is for you to check it out and get an idea on what it might do in the (not so near) future.
I have been playing Lords of the Realms 2 and got an idea for a game or mini game so I started crafting the barebones of a new script. Here it is for you to check it out and get an idea on what it might do in the (not so near) future.
Code:
# * KLords of XP
# Scripter : Kyonides Arkanthes
# 2021-04
# This is a free adaptation of Lords of the Realm 2 game for RMXP. The goal of
# this script is to partially replicate some of its features.
# * Script Calls * #
# $scene = KLordsMapScene.new(MapID)
# $game_system.lords
# $game_system.lord(LordID)
# $game_system.lord_name(LordID)
# $game_system.lord_cities(LordID)
# $game_system.lord_allies(LordID)
# $game_system.lord_lands(LordID)
# $game_system.cities
# $game_system.city(MapID)
# $game_system.city_land(MapID)
# $game_party.set_leader_as_lord
# # #MapData.change_lord(MapID, RulerID)
module KLords
# List of Icons representing the player and the rest of the nobles
NOBLE_ICONS = ["",""]
BUILDING_ICONS = ["keep01","keep03","castle01","castle01"]
DEFENSE_ICONS = ["keep02", "keep04", "castle02","castle03"]
ENV_ICONS = ["tree01","tree02","wood"]
LABELS = {}
LABELS[:title] = "Stockpiles"
LABELS[:wood] = "Wood"
LABELS[:stone] = "Stone"
LABELS[:gold] = "Gold"
LABELS[:iron] = "Iron"
# MapID => "Backdrop Filename", etc.
BACKDROPS = { 2 => "" }
module Font
MAP_NAME = "Arial"
MAP_SIZE = 24
LORD_NAME = "Arial"
LORD_SIZE = 22
end
end
module MapData
@infos = load_data("MapInfos.rxdata")
def map(mid) @infos[mid] || RPG::MapInfo.new end
end
module KLords
class MapObject
def initialize
@id = 0
@name = "Unknown"
@resources = { :wood => 0, :stone => 0, :iron => 0,
:gold => 0, :medicines => 0 }
end
attr_accessor :id, :name
attr_reader :resources
end
class Lord < MapObject
def initialize
@cities = 0
@lands = 0
@allies = []
end
attr_accessor :cities, :lands, :allies
end
class City < MapObject
def initialize
@land = 0
@tax_percent = 0
@happiness = 0
@health = 50
@population = 0
end
attr_accessor :land, :tax_percent, :happiness, :health, :population
end
end
class Game_System
alias :kyon_lords_gm_sys_init :initialize
def initialize
kyon_lords_gm_sys_init
@lords = Hash.new{ KLords::Lord.new }
@cities = Hash.new{ KLords::City.new }
end
def lord(lid) @lords[lid] end
def lord_name(lid) @lords[lid].name end
def lord_cities(lid) @lords[lid].cities end
def lord_lands(lid) @lords[lid].lands end
def lord_allies(lid) @lords[lid].allies end
def lord_resources(lid) @lords[lid].resources end
def city(mid) @cities[mid] end
def city_land(mid) @cities[mid].land end
attr_reader :lords, :cities
#def change_lord(lid, rid) @lords[mid] = rid end
end
class Game_Party
alias :kyon_lords_gm_pty_init :initialize
def initialize
kyon_lords_gm_pty_init
set_leader_as_lord unless @actors.empty?
end
def set_player_as_lord
$game_system.lord(1).name = @actors[0].name
end
end
class KLordsSpriteset
include KLords::Font
def initialize
map_id = $game_map.map_id
map = MapData.map(map_id).name
lord = MapData.lord(map_id).name
@name = Sprite.new
@name.x = 4
@name.y = 8
@name.bitmap = b = Bitmap.new(180, 24)
b.font.name = MAP_NAME
b.font.size = MAP_SIZE
b.draw_text(0, 0, b.width, 24, map, 1)
@lord_name = Sprite.new
@lord_name.x = 4
@lord_name.y = 36
@lord_name.bitmap = b = Bitmap.new(180, 24)
b.font.name = LORD_NAME
b.font.size = LORD_SIZE
b.draw_text(0, 0, b.width, 24, lord, 1)
end
def dispose
@lord_name.dispose
@name.dispose
end
end
class KLordsMapScene < Scene_Map
def initialize(pos) @index = pos end
def main
@running = true
@backdrop = Sprite.new
@backdrop.bitmap = RPG::Cache.title(KLords::BACKDROPS[@index])
@tileset = Spriteset_Map.new
@spriteset = KLordsSpriteset.new
Graphics.transition
while @running
Graphics.update
Input.update
update
end
Graphics.freeze
@spriteset.dispose
@tileset.dispose
@backdrop.dispose
end
def update
if Input.trigger?(Input::B)
$game_sytem.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return @running = nil
elsif Input.trigger?(Input::C)
$game_sytem.se_play($data_system.decision_se)
end
end
end
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE