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.

[XP] Cheats Input Script

RPG Gamer;116068 said:
I was wondering if a cheat could do any of these?

  • Turn on/off a switch
$game_switches[putIDhere] = true #switch on
$game_switches[putIDhere] = false #switch off
Marcel_Makkink;119806 said:
I would like changing a variable too. However, when you find these out could you pm me how to Rpg Gamer?
$game_variables[putIDhere] = number #set variable
BudsieBuds;119695 said:
@alexanderpas:
I don't get it... explain?
i mean, just like in zelda when in certain games you input a certain name in the name entry and you get a special thing.
if you put in ZELDA as name in links awakening, you get a special music played
 
okay... i incorperated the cheat entry into the name entry... (man, that was easy!) you bettter look into this because you will be stunned by it too ;) it's too easy if you ask me ;)
Code:
#==============================================================================
# ** Scene_Name (with cheats support.)
#------------------------------------------------------------------------------
#  This class performs name input screen processing. (and handles cheats too!)
#==============================================================================

class Scene_Name
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @edit_window.update
    @input_window.update
    # If B button was pressed
    if Input.repeat?(Input::B)
      # If cursor position is at 0
      if @edit_window.index == 0
        return
      end
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Delete text
      @edit_window.back
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If cursor position is at [OK]
      if @input_window.character == nil
# ------------------- CHEAT ENTRIES -------------------------- #
        if @edit_window.name == "ZELDA"
          # Play title BGM (example effect ;))
          $game_system.bgm_play($data_system.title_bgm)
          # remove following two lines if you wish to allow the cheat as a name
          @edit_window.restore_default
          return
        end
# ---------------- END OF CHEAT ENTRIES ---------------------- #
        # If name is empty
        if @edit_window.name == ""
          # Return to default name
          @edit_window.restore_default
          # If name is empty
          if @edit_window.name == ""
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          # Play decision SE
          $game_system.se_play($data_system.decision_se)
          return
        end
        # Change actor name
        @actor.name = @edit_window.name
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to map screen
        $scene = Scene_Map.new
        return
      end
      # If cursor position is at maximum
      if @edit_window.index == $game_temp.name_max_char
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # If text character is empty
      if @input_window.character == ""
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Add text character
      @edit_window.add(@input_window.character)
      return
    end
  end
end
don't forget, always add below ;)
oh, and sorry about the double post ;)
 
alexanderpas;119834 said:
$game_switches[putIDhere] = true #switch on
$game_switches[putIDhere] = false #switch off

$game_variables[putIDhere] = number #set variable

You wish it was that easy. I already tried that before, however, the switch or variable don't change. If a switch was on or off, it'll just stay the same way.
 
Marcel_Makkink;120173 said:
You wish it was that easy. I already tried that before, however, the switch or variable don't change. If a switch was on or off, it'll just stay the same way.
it works over here (at least with my version)
 
@alexanderpas: Ohh... like that! That's indeed very easy.

@Darth Cid: Well, no. Trickster and SephiriothSpawn where working on it, but I believe they never finished it. I shall try to contact SephiriothSpawn soon.

~Budsie
 
downcase

Returns a copy of a string with all uppercase letters replaced with their lowercase counterparts.
The operation is locale insensitive
Only characters A to Z are affected.

Code:
"hEllO".downcase # returns "hello"
 
Hey every one check out this new site for more help and scripts it is brandnew soo were still workin on it so there arent to many posts but were gona need your help to get started if you do help we will post your name on the fron page!!!!!!!! this is the site type it in your url box freewebs.com/vote4cesar..
 
instead of using. (accepts only exact as you've written)
Code:
# ------------------- CHEAT ENTRIES -------------------------- #
        if @edit_window.name == "ZELDA"
          # Play title BGM (example effect ;))
          $game_system.bgm_play($data_system.title_bgm)
          # remove following two lines if you wish to allow the cheat as a name
          @edit_window.restore_default
          return
        end
# ---------------- END OF CHEAT ENTRIES ---------------------- #
you simply use
Code:
# ------------------- CHEAT ENTRIES -------------------------- #
        if @edit_window.name.downcase == "zelda"
          # Play title BGM (example effect ;))
          $game_system.bgm_play($data_system.title_bgm)
          # remove following two lines if you wish to allow the cheat as a name
          @edit_window.restore_default
          return
        end
# ---------------- END OF CHEAT ENTRIES ---------------------- #
which accepts Zelda, ZELDA, zelda, ZeLdA etc. (note that the check must also be downcase "zelda" ;))


this means you can decide per entry if you want it to be case-sensitive or not!
 
Horay! Nice script!

Just one issue, can i make it hit a button and it brings up the cheat menu???

also it doesnt show up on my main menu!
 
@Asmodeanmage - Well, you'll have to input it in your menu first, otherwise it won't show up indeed. Search the forums on how to do that!

@alexanderpas - Thanks, but... I don't really get it.
Please explain as detailed as possible...

~Budsie
 
Putting it in my menu??? Already done!;)

Doesnt take scripting skill to find your version of Scene_Menu

Find the changes and BAM insert into mine! :p

But yeah about the whole press a button....
 

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