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.

[Resolved] Disable/Enable XRXS Script

Status
Not open for further replies.
Hey,
I've got a small request of an edit for the XRXS-XAS script. There are some parts of the game where I want to disable the attack and tool functions (for example, mini-games). The HUD can be easily disabled through a switch (configured in the script), but you can still attack, shield, use items and skills while the HUD is invisible.

So what I'm asking is, could someone script an edit or patch that allows you to disable and enable the entire system (excluding the HUD) either via "Call Script" or a switch?

If someone could just tell me a code to insert and where, that'd be much appreciated (preferable over copy-pasting the entire script).

Okay, the code is too long so I pasted it onto a notepad.
http://www.mediafire.com/?a3mr1vpco09

Also, here's the demo.
http://www.atelier-rgss.com/RGSS/Demos/XAS_Hero_2.exe
 
Okay, I understand you might be reluctant to download a whole demo so I put it on a notepad instead.

Again, all I want is a function to disable and enable the use of tools (weapons, shields, skills, and items) either by call script or a switch. Help would be much appreciated.
 
What exactly do you need disabled in the script? I've disabled the commands for you, its pretty simple really. It disables JUST the commands though, so enemies will still attack you and all of that.

http://pastebin.com/d468a77e6

To disable/enable the script in game, you have to use this constant.

XAS_COMMAND::DISABLE = true/false

Sidenote:

Also, these lines of the interpreter make it so that the game freezes when setting something 'false' with a call script. Really irritating really, these lines are useless I'd just delete 'em. I promise you, they're useless.

Go into Interpreter 7, replace command_355 with this one...

Code:
class Interpreter
  #--------------------------------------------------------------------------
  # * Script
  #--------------------------------------------------------------------------
  def command_355
    # Set first line to script
    script = @list[@index].parameters[0] + "\n"
    # Loop
    loop do
      # If next event command is second line of script or after
      if @list[@index+1].code == 655
        # Add second line or after to script
        script += @list[@index+1].parameters[0] + "\n"
      # If event command is not second line or after
      else
        # Abort loop
        break
      end
      # Advance index
      @index += 1
    end
    # Evaluation
    result = eval(script)
    return true
  end
end
 
Yeah, just the commands will do. It works like a charm, thanks a lot!

By the way, about the "false" thing, there's a little workaround. Instead of using "x = false", you can use "x = nil" for the same effect, plus it doesn't crash. Just a little something DerVV taught me awhile back.
 
Status
Not open for further replies.

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