Refresh the Equip Scene

killerfer

Veteran
Veteran
Joined
Nov 4, 2015
Messages
198
Reaction score
50
First Language
Portuguese
I'm using a common event inside the equip scene (with Hime - Scene Interpreter), and I need to refresh the equip scene (more specifically the slots window) after the event is over. Is there a way to do it with a script call from the event?
I'm using VX Ace btw.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
SceneManager.scene.slot_window.refresh ?

not sure about grabbing the item window from the scene, though.
things like that should be engineered within the script itself, not as a patch up.
 

killerfer

Veteran
Veteran
Joined
Nov 4, 2015
Messages
198
Reaction score
50
First Language
Portuguese
SceneManager.scene.slot_window.refresh ?

not sure about grabbing the item window from the scene, though.
things like that should be engineered within the script itself, not as a patch up.
Yeah, that didn't work... Let me try to elaborate.

In my commom event, I add slots to the actor using Hime - Dynamic Equip Slots whenever he/she equips an item, and I remove the slots when he/she unequips. It's working fine, except Hime's script doens't refresh the Equip Scene, it just adds to the battler slot. Maybe if I add something to Hime's script to refresh the scene my problem is over?

=begin
#===============================================================================
Title: Dynamic Equip Slots
Author: Hime
Date: Jul 13, 2013
--------------------------------------------------------------------------------
** Change log
Jul 13, 2013
- Initial release
--------------------------------------------------------------------------------
** Terms of Use
* Free to use in non-commercial projects
* Contact me for commercial use
* No real support. The script is provided as-is
* Will do bug fixes, but no compatibility patches
* Features may be requested but no guarantees, especially if it is non-trivial
* Credits to Hime Works in your project
* Preserve this header
--------------------------------------------------------------------------------
** Description

This script allows you to add or remove equip slots during the game using
script calls. You can add or remove equip slots as many times as you want
using simple script calls.

--------------------------------------------------------------------------------
** Required

Core - Equip Slots
(http://himeworks.com/2013/07/13/core-equip-slots/)
--------------------------------------------------------------------------------
** Installation

Place this script below Core - Equip Slots and above Main

--------------------------------------------------------------------------------
** Usage

The following methods are available for adding or removing equip slots
using script calls:

add_equip_slot(actor_id, etype_id)
remove_equip_slot(actor_id, etype_id)

When an equip is removed, the item is returned to your inventory.

#===============================================================================
=end
$imported = {} if $imported.nil?
$imported["TH_DynamicEquipSlots"] = true
#===============================================================================
# ** Configuration
#===============================================================================
module TH
module Dynamic_Equip_Slots
end
end
#===============================================================================
# ** Rest of script
#===============================================================================
class Game_Interpreter

#-----------------------------------------------------------------------------
# New. Adds an equip slot with the given etype to the specified actor.
#-----------------------------------------------------------------------------
def add_equip_slot(actor_id, etype_id)
$game_actors[actor_id].add_equip_slot(etype_id)
end

#-----------------------------------------------------------------------------
# New. Removes an equip slot with the given etype from the specified actor.
#-----------------------------------------------------------------------------
def remove_equip_slot(actor_id, etype_id)
$game_actors[actor_id].remove_equip_slot(etype_id)
end
end

class Game_Actor < Game_Battler
#-----------------------------------------------------------------------------
# New. Adds an equip slot to the actor with the given etype id
#-----------------------------------------------------------------------------
def add_equip_slot(etype_id)
@equips.push(Game_EquipSlot.new(etype_id))
sort_equip_slots
end

#-----------------------------------------------------------------------------
# New. Deletes an equip slot for the given etype. If there are multiple slots
# with that etype, simply removes one at random. Any equipped items in that
# slot is returned to the inventory.
#-----------------------------------------------------------------------------
def remove_equip_slot(etype_id)
slot_id = @equips.index {|eslot| eslot.etype_id == etype_id }
return unless slot_id
change_equip(slot_id, nil)
@equips.delete_at(slot_id)
end
end
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
http://himeworks.com/2013/07/13/core-equip-slots/
Code:
#-------------------------------------------------------------------------------
# Adjust contents size to account for additional slots
#-------------------------------------------------------------------------------
class Window_EquipSlot < Window_Selectable

  def refresh
    create_contents
    super
  end
end
make sure you have the core file


>>when debugging a third party's script, make sure you find their hooks into the actual program<<
 

killerfer

Veteran
Veteran
Joined
Nov 4, 2015
Messages
198
Reaction score
50
First Language
Portuguese
http://himeworks.com/2013/07/13/core-equip-slots/
Code:
#-------------------------------------------------------------------------------
# Adjust contents size to account for additional slots
#-------------------------------------------------------------------------------
class Window_EquipSlot < Window_Selectable

  def refresh
    create_contents
    super
  end
end
make sure you have the core file


>>when debugging a third party's script, make sure you find their hooks into the actual program<<
A already have that script, it's a dependency for Dynamic Slots. =/
I am pretty newbie when it comes to RGSS3 but I don't think it's the Window Class I should refresh, it is the SceneEquip? Sorry if i'm wrong.
I took a look at the SceneEquip and it has @slot_window.refresh on item ok, optimize and change actors, and all that work, my additional slot "appear" whenever I do that.
 
Last edited:

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
I don't follow.
it works, but it doesnt? or you want it to work outside the regular .refresh call?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,070
Members
137,577
Latest member
SadaSoda
Top