02-13-2025, 03:19 PM
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.
*hugs*
- Zeriab
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]](http://www.twinkfish.com/al/ZeriabSig.png)