Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Looking for script call

Save-Point

Full Version: Looking for script call
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Can anybody tell me if there's a script call for this script?: https://forum.chaos-project.com/index.php?topic=12727.0

I'd like to call the Key Item Menu during an event with a script call if it's possible. Thanks :)
After examining the script, Chrono Cross Key Items, I can safely say that there is no script call to bring up the menu.

So... let's add one. Laughing

Paste this below the other script, and use the script call cckey_open. "Poof!* Your window will appear.

Code:
module CCKeyDVV
  
  
  # If true, only the player is frozen.  If false, all events freeze
  PLAYER_ONLY = false
  
  # If true, plays the built-in Decision SE.  Otherwise.... nope!
  SFX = true
  
end



#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias cckeypatch_game_character_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Only function if player only disabled
    unless CCKeyDVV::PLAYER_ONLY == true
      # Only if in the field map
      if $scene.is_a?(Scene_Map)
        # Ensure no character moves when showing
        return if $scene.key_window.visible == true
      end
    end
    # The original call
    cckeypatch_game_character_update
  end
end



#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
#  This class handles the player. Its functions include event starting
#  determinants and map scrolling. Refer to "$game_player" for the one
#  instance of this class.
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias cckeypatch_game_player_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Ensure player doesn't move when showing
    return if $scene.key_window.visible == true
    # The original call
    cckeypatch_game_player_update
  end
end



#==============================================================================
# ** Interpreter
#------------------------------------------------------------------------------
#  This interpreter runs event commands. This class is used within the
#  Game_System class and the Game_Event class.
#==============================================================================

class Interpreter
  def cckey_open.
    # Play Decision SE if effect turned on
    $game_system.se_play($data_system.decision_se) if CCKeyDVV::SFX == true
    # Perform rest from call
    $scene.key_window.refresh
    $scene.key_window.index           = 0
    $scene.key_window.active          = true
    $scene.key_window.visible         = true
    $game_temp.message_window_showing = true
  end
end

#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================

class Scene_Map
  attr_accessor :key_window
end

Took all of 60 seconds, this one. Laughing + Tongue sticking out

Took two minutes... noting changes added.
Awesome dude! However when I call the menu my character keeps moving along with my selections in the menu lol, is that just an eventing issue?
Does this issue crop up without my patch?

The project I made was baseline, no scripts other than gameus's Chrono Cross Key Item script and my patch. When I grab the keys and run the script call, the player doesn't move when I'm using the cursor in the window. He's frozen.

I think it must be something causing a problem on your end.
It works fine when I call the menu normally (by pushing Shift). He stays in place. Only when I use the script call during an event.

Edit: Well actually I found a pretty cheesy way of fixing it (invisible walls, direction fix lmao)
Query: Did you test this script combination in a fresh demo; determine if the issue happens outside your project? Afterall... if it happens only in your project, something in your project caused the initial glitch.

If that's the case, you'll want to do a search through your scripts for the culprit... just in case of other upcoming issues. But that's another thread.
As of right now gameus's Item script and your patch are the only 2 scripts in my project

Edit: I just tried it in a brand new project with the same event and yes it happened again, so it has something to do with the event itself.
Well, here's the project itself. No edits to the default scripts, just the two included, and two events. At no point does the player move about when selecting a key with an action event (nor player touch or event touch).

[attachment=1140]
Oh, I managed to replicate the issue. It only happens when the script call is inside of a "Show Choices" event: 
[Image: vLfmkA8.png]
Okay... okay... be that way. Tongue sticking out Gotta test for the window n FREEZE the player (and optionally all other events)

Updated originally posted script (Post #2)
Pages: 1 2