Thoughts on the Interpreter's Script Command
#1
The conditional branch script command requires the result to specifically be either true or false. Try putting in a number like 12 and you'll see the conditional branch being skipped as well.
Expanding it to work with truthy and falsey values is a good idea ^^

Not a fan of your command_355 fix. Being able to run a script call every frame while it returns a special value can be useful.
Here's a version I did where you can let your script call return :wait to run it again. 
Code:
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

*hugs*
 - Zeriab
[Image: ZeriabSig.png]
Reply }


Messages In This Thread
Thoughts on the Interpreter's Script Command - by Zeriab - 02-13-2025, 03:19 PM
RE: Script Commands Bug Fixes - by kyonides - 02-13-2025, 08:35 PM
RE: Script Commands Bug Fixes - by Zeriab - 02-26-2025, 07:53 AM
RE: Script Commands Bug Fixes - by kyonides - 02-26-2025, 05:45 PM
RE: Script Commands Bug Fixes - by Zeriab - 02-26-2025, 07:25 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Your thoughts on Action Game Maker? PK8 10 20,279 11-18-2011, 03:58 AM
Last Post: KasperKalamity
   Pause Script Feature Requests? PK8 11 18,632 05-25-2009, 11:07 AM
Last Post: Kain Nobel
   Beyond the script editor line: Is it bad practice? PK8 6 12,479 05-22-2009, 09:27 PM
Last Post: Charlie Fleed



Users browsing this thread: 3 Guest(s)