Author Topic: [XP] Interpreter Script Call Fix  (Read 15224 times)

Offline Juan

  • Ethereal Devastator
  • ****
  • Posts: 409
  • LV: 48
  • Gender: Male
  • Evil Twin
    • View Profile
[XP] Interpreter Script Call Fix
« on: April 27, 2008, 10:58:14 PM »
Interpreter Script Call Fix
Authors: Juan, Blizzard
Version: 1.0
Type: Bug Fix
Key Term: Misc Add-on

Introduction

This script fixes the interpreter script call when you use $game_system.anything = false it would normal frezze this script fixes that.

Features

  • Fixes the call script
  • Plug in and play

Screenshots

N/A for this type of script.

Demo

N/A

Script
(click to show/hide)



Instructions

Just make a new script and post it above main

Compatibility

Compatable with sdk.

Credits and Thanks

  • Juan
  • Boris "Blizzard" Mikić
  • Zeriab

Author's Notes

If there are any bugs please post it or email me at juanpena1111@yahoo.com
and credit me.
« Last Edit: March 23, 2019, 06:35:19 PM by Blizzard »
Dropbox Who need luck when you can make your own.
(click to show/hide)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP]Interpreter Script Call Fix
« Reply #1 on: April 28, 2008, 04:07:33 PM »
I love you. <3 *powers up*
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Sally

  • Sallygirl :P
  • Chaos User
  • ******
  • Posts: 1283
  • LV: 12
  • Gender: Female
    • View Profile
Re: [XP]Interpreter Script Call Fix
« Reply #2 on: April 29, 2008, 02:27:06 AM »
i... dont get it....?

Offline Juan

  • Ethereal Devastator
  • ****
  • Posts: 409
  • LV: 48
  • Gender: Male
  • Evil Twin
    • View Profile
Re: [XP]Interpreter Script Call Fix
« Reply #3 on: April 29, 2008, 06:48:20 AM »
@Blizzard thanks for the power up.
@Susys If you tried using
Code: [Select]
game_system.save_disabled = false or something similar to that the game would frezze.
Dropbox Who need luck when you can make your own.
(click to show/hide)

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6591
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Interpreter Script Call Fix
« Reply #4 on: March 24, 2009, 09:39:02 PM »
I get en error everytime I run my game with it I've put it below all the scripts and above main. I've tried above blizz's scripts and below mine. I've tried above mine as well but here are the errors I am getting please help!


The things in the red square are the scripts The only ones I didnt make are the ABS 1-3 the Hud and the Script call fix.

Offline fugibo

  • World Conqueror
  • Chaos User
  • ******
  • Posts: 1966
  • LV: 44
    • View Profile
Re: [XP] Interpreter Script Call Fix
« Reply #5 on: March 24, 2009, 10:04:10 PM »
Just take away the parentheses (accept for the ones around "script") and the "= true" part; it's unneeded.

ie
Code: [Select]
return eval(script)

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6591
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Interpreter Script Call Fix
« Reply #6 on: March 24, 2009, 10:31:32 PM »
I still got a syntax error
Code: [Select]
class Interpreter
  #--------------------------------------------------------------------------
  # * Script
  #--------------------------------------------------------------------------
  def command_355
    # Set first line to script
    script = @list[@index].parameters[0] + "\n"
    # Loop
    loop {
      # If next event command is not second line of script or after
      if @list[@index+1].code != 655
        # Abort loop
        break
      end
      # Add second line or after to script
      script += @list[@index+1].parameters[0] + "\n"
      # Advance index
      @index += 1
    }
    # Evaluation and return resulting value
    return eval(script) = true
  end
end

Offline Aqua

  • Lexima Warrior
  • *******
  • Posts: 2554
  • LV: 118
  • Gender: Female
  • Quack!
    • View Profile
Re: [XP] Interpreter Script Call Fix
« Reply #7 on: March 24, 2009, 11:03:02 PM »
GG... you didn't even change what WcW told you to change...

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6591
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Interpreter Script Call Fix
« Reply #8 on: March 24, 2009, 11:24:38 PM »
I did too didnt I?

Offline fugibo

  • World Conqueror
  • Chaos User
  • ******
  • Posts: 1966
  • LV: 44
    • View Profile
Re: [XP] Interpreter Script Call Fix
« Reply #9 on: March 24, 2009, 11:40:36 PM »
You didn't take off the "= true" part.

Offline Juan

  • Ethereal Devastator
  • ****
  • Posts: 409
  • LV: 48
  • Gender: Male
  • Evil Twin
    • View Profile
Re: [XP] Interpreter Script Call Fix
« Reply #10 on: March 25, 2009, 05:25:52 AM »
Oh lol I couldn't remember what part I forgot to change. I'll update my post.
Dropbox Who need luck when you can make your own.
(click to show/hide)

Offline legacyblade

  • Pretzel Man
  • Moderator
  • Chaos User
  • ***
  • Posts: 1838
  • LV: 84
  • Gender: Male
  • There is a fate worse than hell
    • View Profile
    • SpencerConrad.com
Re: [XP] Interpreter Script Call Fix
« Reply #11 on: March 25, 2009, 05:26:28 PM »
Is there any way to make the game not crash on syntax error? I want to make a "command prompt" thing, for beta testing, that doesn't crash if you type something that would cause an error.

Great script though!

Offline Juan

  • Ethereal Devastator
  • ****
  • Posts: 409
  • LV: 48
  • Gender: Male
  • Evil Twin
    • View Profile
Re: [XP] Interpreter Script Call Fix
« Reply #12 on: March 25, 2009, 10:27:19 PM »
I'll have to look into that.
Dropbox Who need luck when you can make your own.
(click to show/hide)

Offline fugibo

  • World Conqueror
  • Chaos User
  • ******
  • Posts: 1966
  • LV: 44
    • View Profile
Re: [XP] Interpreter Script Call Fix
« Reply #13 on: March 25, 2009, 10:49:33 PM »
I've seen one of those on another forum. All you'd do is get a keyboard input script, make an input box, have it eval on enter, and output to another window. To keep it from crashing, you'd just use rescue.

Offline legacyblade

  • Pretzel Man
  • Moderator
  • Chaos User
  • ***
  • Posts: 1838
  • LV: 84
  • Gender: Male
  • There is a fate worse than hell
    • View Profile
    • SpencerConrad.com
Re: [XP] Interpreter Script Call Fix
« Reply #14 on: March 26, 2009, 12:56:20 AM »
can you find me a link, WcW?

Offline fugibo

  • World Conqueror
  • Chaos User
  • ******
  • Posts: 1966
  • LV: 44
    • View Profile
Re: [XP] Interpreter Script Call Fix
« Reply #15 on: March 26, 2009, 04:03:28 AM »
Just search for console on RMXP.org. I'll see if I can find it myself, though :P

Offline legacyblade

  • Pretzel Man
  • Moderator
  • Chaos User
  • ***
  • Posts: 1838
  • LV: 84
  • Gender: Male
  • There is a fate worse than hell
    • View Profile
    • SpencerConrad.com
Re: [XP] Interpreter Script Call Fix
« Reply #16 on: March 26, 2009, 04:19:42 AM »
I found it, thanks for the tip, WcW!

Offline Zeriab

  • Ethereal Devastator
  • ****
  • Posts: 350
  • LV: 65
  • Mighty Scripter
    • View Profile
    • Zeriab's Junk
Re: [XP] Interpreter Script Call Fix
« Reply #17 on: January 07, 2010, 04:20:38 PM »
Reviving this topic because I don't feel this 'fix' properly fixes the problem.
If the result of evaluating the script is false then it will wait just like normally.
It doesn't wait on multi-line script calls. Two lines of false will for example cause the event to wait one frame before continuing.

That said the waiting feature is nice and should be kept. Having false as what's triggering the wait is perhaps not the best idea since accidental waiting is likely to happen.
Of course you can just put $game_switches[42] in a call script to wait until that switch is turned on. (No wait if it already is on)

My own fix is this:
Code: [Select]
class Interpreter
  SCRIPT_WAIT_RESULTS = [:wait, FalseClass]
  #-------------------------------------------------------------------
  # * Script
  #-------------------------------------------------------------------
  def command_355
    # Set first line to script
    script = @list[@index].parameters[0] + "\n"
    # Store index in case we need to wait.
    current_index = @index
    # 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)
    # If return value is false
    if SCRIPT_WAIT_RESULTS.include?(result)
      # Set index back (If multi-line script call)
      @index = current_index
      # End and wait
      return false
    end
    # Continue
    return true
  end
end

It fixes the multi-line issue and I use :wait to when it should wait. The FalseClass check is for providing compatibility with and older version of mine.
To wait for switch 42 to be on you now have to use something like :wait unless $game_switches[42].

Considering how it can ease certain integration issue it's stupid not to keep that feature :3

*hugs*

Offline Juan

  • Ethereal Devastator
  • ****
  • Posts: 409
  • LV: 48
  • Gender: Male
  • Evil Twin
    • View Profile
Re: [XP] Interpreter Script Call Fix
« Reply #18 on: January 07, 2010, 08:00:15 PM »
I'll update the main post with yours.
Dropbox Who need luck when you can make your own.
(click to show/hide)