ARGOL228'S PROFILE
Argol228
0
Search
Filter
Best way to handle random loot in chests
Best way to handle random loot in chests
yes I did make sure to have the actor/class able to equip it. I had to so I was able to set it as default equipment. Ok it is in my locker
Best way to handle random loot in chests
Ok found it and pasted the script in. it works, sort of.
If I start with the PC equiped with one of the enchented swors, they work. Once unequiped though it reverts to the base sword. if I add them via chest They can't be equiped and show no stat change via the stat display on the equip screen where as removing an enchanted sword does show the appropriate stat changes.
If I start with the PC equiped with one of the enchented swors, they work. Once unequiped though it reverts to the base sword. if I add them via chest They can't be equiped and show no stat change via the stat display on the equip screen where as removing an enchanted sword does show the appropriate stat changes.
Best way to handle random loot in chests
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
# This class performs title screen processing.
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# If battle test
if $BTEST
battle_test
return
end
# Load database
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
for weapon in $data_weapons
if weapon.id > 100
$data_weapons = $data_weapons.clone
end
if weapon.id%100 == 1
$data_weapons.str_plus = 10 # +10 strength
$data_weapons.name += " of power"
end
if weapon.id%100 == 2
$data_weapons.agi_plus = 10 # +10 agility
$data_weapons.name += " of swiftness"
end
if weapon.id%100 == 3
$data_weapons.dex_plus = 10 # +10 dexterity
$data_weapons.name += " of nimbleness"
end
if weapon.id%100 == 4
$data_weapons.int_plus = 10 # +10 intellect
$data_weapons.name += " of magic"
end
if weapon.id%100 == 5
$data_weapons.element_set = # Elemental attack is the 1st element in your game
$data_weapons.name = "Blazing " + $data_weapons.name
end
if weapon.id%100 == 6
$data_weapons.element_set = # Elemental attack is the 2nd element in your game
$data_weapons.name = "Freezing " + $data_weapons.name
end
end
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
# Make system object
$game_system = Game_System.new
# Make title graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
# Make command window
s1 = "New Game"
s2 = "Continue"
s3 = "Shutdown"
@command_window = Window_Command.new(192, )
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
# Continue enabled determinant
# Check if at least one save file exists
# If enabled, make @continue_enabled true; if disabled, make it false
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
# If continue is enabled, move cursor to "Continue"
# If disabled, display "Continue" text in gray
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
# Play title BGM
$game_system.bgm_play($data_system.title_bgm)
# Stop playing ME and BGS
Audio.me_stop
Audio.bgs_stop
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of command window
@command_window.dispose
# Dispose of title graphic
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update command window
@command_window.update
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end
end
#--------------------------------------------------------------------------
# * Command: New Game
#--------------------------------------------------------------------------
def command_new_game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Stop BGM
Audio.bgm_stop
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each type of game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up initial party
$game_party.setup_starting_members
# Set up initial map position
$game_map.setup($data_system.start_map_id)
# Move player to initial position
$game_player.moveto($data_system.start_x, $data_system.start_y)
# Refresh player
$game_player.refresh
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Command: Continue
#--------------------------------------------------------------------------
def command_continue
# If continue is disabled
unless @continue_enabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to load screen
$scene = Scene_Load.new
end
#--------------------------------------------------------------------------
# * Command: Shutdown
#--------------------------------------------------------------------------
def command_shutdown
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Fade out BGM, BGS, and ME
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# Shutdown
$scene = nil
end
#--------------------------------------------------------------------------
# * Battle Test
#--------------------------------------------------------------------------
def battle_test
# Load database (for battle test)
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up party for battle test
$game_party.setup_battle_test_members
# Set troop ID, can escape flag, and battleback
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# Play battle start SE
$game_system.se_play($data_system.battle_start_se)
# Play battle BGM
$game_system.bgm_play($game_system.battle_bgm)
# Switch to battle screen
$scene = Scene_Battle.new
end
end
# ** Scene_Title
#------------------------------------------------------------------------------
# This class performs title screen processing.
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# If battle test
if $BTEST
battle_test
return
end
# Load database
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
for weapon in $data_weapons
if weapon.id > 100
$data_weapons = $data_weapons.clone
end
if weapon.id%100 == 1
$data_weapons.str_plus = 10 # +10 strength
$data_weapons.name += " of power"
end
if weapon.id%100 == 2
$data_weapons.agi_plus = 10 # +10 agility
$data_weapons.name += " of swiftness"
end
if weapon.id%100 == 3
$data_weapons.dex_plus = 10 # +10 dexterity
$data_weapons.name += " of nimbleness"
end
if weapon.id%100 == 4
$data_weapons.int_plus = 10 # +10 intellect
$data_weapons.name += " of magic"
end
if weapon.id%100 == 5
$data_weapons.element_set = # Elemental attack is the 1st element in your game
$data_weapons.name = "Blazing " + $data_weapons.name
end
if weapon.id%100 == 6
$data_weapons.element_set = # Elemental attack is the 2nd element in your game
$data_weapons.name = "Freezing " + $data_weapons.name
end
end
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
# Make system object
$game_system = Game_System.new
# Make title graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
# Make command window
s1 = "New Game"
s2 = "Continue"
s3 = "Shutdown"
@command_window = Window_Command.new(192, )
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
# Continue enabled determinant
# Check if at least one save file exists
# If enabled, make @continue_enabled true; if disabled, make it false
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
# If continue is enabled, move cursor to "Continue"
# If disabled, display "Continue" text in gray
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
# Play title BGM
$game_system.bgm_play($data_system.title_bgm)
# Stop playing ME and BGS
Audio.me_stop
Audio.bgs_stop
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of command window
@command_window.dispose
# Dispose of title graphic
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update command window
@command_window.update
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end
end
#--------------------------------------------------------------------------
# * Command: New Game
#--------------------------------------------------------------------------
def command_new_game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Stop BGM
Audio.bgm_stop
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each type of game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up initial party
$game_party.setup_starting_members
# Set up initial map position
$game_map.setup($data_system.start_map_id)
# Move player to initial position
$game_player.moveto($data_system.start_x, $data_system.start_y)
# Refresh player
$game_player.refresh
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Command: Continue
#--------------------------------------------------------------------------
def command_continue
# If continue is disabled
unless @continue_enabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to load screen
$scene = Scene_Load.new
end
#--------------------------------------------------------------------------
# * Command: Shutdown
#--------------------------------------------------------------------------
def command_shutdown
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Fade out BGM, BGS, and ME
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# Shutdown
$scene = nil
end
#--------------------------------------------------------------------------
# * Battle Test
#--------------------------------------------------------------------------
def battle_test
# Load database (for battle test)
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up party for battle test
$game_party.setup_battle_test_members
# Set troop ID, can escape flag, and battleback
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# Play battle start SE
$game_system.se_play($data_system.battle_start_se)
# Play battle BGM
$game_system.bgm_play($game_system.battle_bgm)
# Switch to battle screen
$scene = Scene_Battle.new
end
end
Best way to handle random loot in chests
well again my problem is how do I test this. Using an event to change weapon or by setting the weapon number as the default for the PC, results in getting blank weapon data, I have been putting it in the right spot.
Best way to handle random loot in chests
Well I was only going to use what you posted to start just to test, I will no doubt add to it if it works.
Edit: Ok so I pasted the script in, changed my maximum weapons to 406, added test sword to 100. made a chest to give me weapon 101 and 102. went to test and activated the chest and checked inventory. nothing appears except 2 blank weapons.
Edit: Ok so I pasted the script in, changed my maximum weapons to 406, added test sword to 100. made a chest to give me weapon 101 and 102. went to test and activated the chest and checked inventory. nothing appears except 2 blank weapons.
Best way to handle random loot in chests
so to clarify, I would change the on the first line of the below excerpt to to tell the rest of the script that the base weapon is the first weapon in the database?
$data_weapons = $data_weapons
if weapon.id%100 == 1
$data_weapons.str_plus = 10 # +10 strength
$data_weapons.name += " of power"
I am a newb to scripting and only half understand it sometimes. I can generally pick up on patterns but I have no idea how I would go about setting up for a simple test using your posted example.
$data_weapons = $data_weapons
if weapon.id%100 == 1
$data_weapons.str_plus = 10 # +10 strength
$data_weapons.name += " of power"
I am a newb to scripting and only half understand it sometimes. I can generally pick up on patterns but I have no idea how I would go about setting up for a simple test using your posted example.
Best way to handle random loot in chests
So I suppose that means there is no way of getting around having to manually enter every item into the database.
Best way to handle random loot in chests
author=noicreC
Hmm, perhaps you should dig into this system: http://grimoirecastle.wordpress.com/2011/12/08/alchemic-synthesis-go-go-totori/
You'll need to download a few scripts for it, but it's all listed on the site: even without any knowledge of scripting, you should be able to install that.
It's a shop, but it does feature item traits, on top of normal items. I guess that comes the closest to what you want, as far as I've seen.
Good luck anyways!
Bugger, That looks like it's for Ace. I use XP
Best way to handle random loot in chests
I haven't got any kind of system or script. My system was just me using notepad to write a checklist of items with the enchantments and curses I would have to make
Iron sword
Iron sword of flame
Iron sword of might
Cursed Iron sword of leech
Cursed Iron sword of Monster bait
ect
I am not a scripter and I have not been able to find any kind of Item generation scripts.
Ideally I would use a Diablo/Borderlands set up
Weapon Type (chooses from a list of available weapon types
Material (Chooses from the mentioned materials, affects appearance)
Quality (Chooses from list of qualities which affect the base damage)
Magical effect (Chooses from a list of enchantments and curses, basically how suffix and prefix names work in diablo)
Open a chest, it uses that formula and bam you get
A cursed rusted Iron sword of bleeding.
Atk 5 (Normal Iron sword atk is 7)
Bleeding causes you to take damage when you attack
As an extra affect, The actual properties of the loot is not revealed until you either equip it or take it to an NPC to identify it, cursed items cannot be unequiped without visiting a special NPC or using a spell
So that Rusted iron sword of bleeding would probably just be recognized as
A rusted iron sword Until it is equipped or Identified.
Iron sword
Iron sword of flame
Iron sword of might
Cursed Iron sword of leech
Cursed Iron sword of Monster bait
ect
I am not a scripter and I have not been able to find any kind of Item generation scripts.
Ideally I would use a Diablo/Borderlands set up
Weapon Type (chooses from a list of available weapon types
Material (Chooses from the mentioned materials, affects appearance)
Quality (Chooses from list of qualities which affect the base damage)
Magical effect (Chooses from a list of enchantments and curses, basically how suffix and prefix names work in diablo)
Open a chest, it uses that formula and bam you get
A cursed rusted Iron sword of bleeding.
Atk 5 (Normal Iron sword atk is 7)
Bleeding causes you to take damage when you attack
As an extra affect, The actual properties of the loot is not revealed until you either equip it or take it to an NPC to identify it, cursed items cannot be unequiped without visiting a special NPC or using a spell
So that Rusted iron sword of bleeding would probably just be recognized as
A rusted iron sword Until it is equipped or Identified.













