Class: Interpreter_RMXP

Inherits:
Object show all
Defined in:
docs/00600_Script_RMXP.rb

Overview

Interpreter of the event commands

Direct Known Subclasses

Interpreter

Constant Summary collapse

LiteRGSS2RGSS_Input =

Constant that holds the LiteRGSS input key to RGSS input Key

{A: 13, B: 12, X: 14, Y: 15, L: 17, R: 18, UP: 8, DOWN: 2, LEFT: 4, RIGHT: 6, L2: 16, R2: 25, L3: 23, R3: 29, START: 22, SELECT: 21}
RGSS2LiteRGSS_Input =

Constant that holds the RGSS input key to LiteRGSS input key

LiteRGSS2RGSS_Input.invert
COMMAND_TRANSLATION =

Hash containing the command translation from code to method name

{101 => :command_101, 102 => :command_102, 402 => :command_402, 403 => :command_403, 103 => :command_103, 104 => :command_104, 105 => :command_105, 106 => :command_106, 111 => :command_111, 411 => :command_411, 112 => :command_112, 413 => :command_413, 113 => :command_113, 115 => :command_115, 116 => :command_116, 117 => :command_117, 118 => :command_118, 119 => :command_119, 121 => :command_121, 122 => :command_122, 123 => :command_123, 124 => :command_124, 125 => :command_125, 126 => :command_126, 127 => :command_127, 128 => :command_128, 129 => :command_129, 131 => :command_131, 132 => :command_132, 133 => :command_133, 134 => :command_134, 135 => :command_135, 136 => :command_136, 201 => :command_201, 202 => :command_202, 203 => :command_203, 204 => :command_204, 205 => :command_205, 206 => :command_206, 207 => :command_207, 208 => :command_208, 209 => :command_209, 210 => :command_210, 221 => :command_221, 222 => :command_222, 223 => :command_223, 224 => :command_224, 225 => :command_225, 231 => :command_231, 232 => :command_232, 233 => :command_233, 234 => :command_234, 235 => :command_235, 236 => :command_236, 241 => :command_241, 242 => :command_242, 245 => :command_245, 246 => :command_246, 247 => :command_247, 248 => :command_248, 249 => :command_249, 250 => :command_250, 251 => :command_251, 301 => :command_301, 601 => :command_601, 602 => :command_602, 603 => :command_603, 302 => :command_302, 303 => :command_303, 311 => :command_311, 312 => :command_312, 313 => :command_313, 314 => :command_314, 315 => :command_315, 316 => :command_316, 317 => :command_317, 318 => :command_318, 319 => :command_319, 320 => :command_320, 321 => :command_321, 322 => :command_322, 331 => :command_331, 332 => :command_332, 333 => :command_333, 334 => :command_334, 335 => :command_335, 336 => :command_336, 337 => :command_337, 338 => :command_338, 339 => :command_339, 340 => :command_340, 351 => :command_351, 352 => :command_352, 353 => :command_353, 354 => :command_354, 355 => :command_355}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(depth = 0, main = false) ⇒ Interpreter_RMXP

Initialize the Interpreter

Parameters:

  • depth (Integer) (defaults to: 0)

    depth of the Interpreter

  • main (Boolean) (defaults to: false)

    if the interpreter is the main interpreter



567
568
# File 'docs/00600_Script_RMXP.rb', line 567

def initialize(depth = 0, main = false)
end

Instance Attribute Details

#event_idInteger (readonly)

Id of the event that started the Interpreter

Returns:

  • (Integer)


563
564
565
# File 'docs/00600_Script_RMXP.rb', line 563

def event_id
  @event_id
end

Instance Method Details

#clear

Clear the state of the interpreter



570
571
# File 'docs/00600_Script_RMXP.rb', line 570

def clear
end

#command_101

Command that starts a message display, if followed by a choice/input num command, displays the choice/input num in the meantime



660
661
# File 'docs/00600_Script_RMXP.rb', line 660

def command_101
end

#command_102

Command that display a choice if possible (no message)



663
664
# File 'docs/00600_Script_RMXP.rb', line 663

def command_102
end

#command_103

Display an input number if possible (no message)



672
673
# File 'docs/00600_Script_RMXP.rb', line 672

def command_103
end

#command_104

Change the message settings (position / frame type)



675
676
# File 'docs/00600_Script_RMXP.rb', line 675

def command_104
end

#command_105

Start a store button id to variable process



678
679
# File 'docs/00600_Script_RMXP.rb', line 678

def command_105
end

#command_106

Wait 2 times the number of frame requested



681
682
# File 'docs/00600_Script_RMXP.rb', line 681

def command_106
end

#command_111

Conditionnal command



684
685
# File 'docs/00600_Script_RMXP.rb', line 684

def command_111
end

#command_112

Loop command



694
695
# File 'docs/00600_Script_RMXP.rb', line 694

def command_112
end

#command_113

Break loop command (try to go to the end of the loop)



700
701
# File 'docs/00600_Script_RMXP.rb', line 700

def command_113
end

#command_115

End the interpretation of the current event



703
704
# File 'docs/00600_Script_RMXP.rb', line 703

def command_115
end

#command_116

erase this event



706
707
# File 'docs/00600_Script_RMXP.rb', line 706

def command_116
end

#command_117

Call a common event



709
710
# File 'docs/00600_Script_RMXP.rb', line 709

def command_117
end

#command_118

Label command



712
713
# File 'docs/00600_Script_RMXP.rb', line 712

def command_118
end

#command_119

jump to a label



715
716
# File 'docs/00600_Script_RMXP.rb', line 715

def command_119
end

#command_121

Multiple switch set



719
720
# File 'docs/00600_Script_RMXP.rb', line 719

def command_121
end

#command_122

Variable set



722
723
# File 'docs/00600_Script_RMXP.rb', line 722

def command_122
end

#command_123

Self Switch set



725
726
# File 'docs/00600_Script_RMXP.rb', line 725

def command_123
end

#command_124

Timer start / stop



728
729
# File 'docs/00600_Script_RMXP.rb', line 728

def command_124
end

#command_125

Earn gold command



731
732
# File 'docs/00600_Script_RMXP.rb', line 731

def command_125
end

#command_126

Get item command



734
735
# File 'docs/00600_Script_RMXP.rb', line 734

def command_126
end

#command_127

Gain weapon command



737
738
# File 'docs/00600_Script_RMXP.rb', line 737

def command_127
end

#command_128

Gain armor command



740
741
# File 'docs/00600_Script_RMXP.rb', line 740

def command_128
end

#command_129

Add or remove actor command



743
744
# File 'docs/00600_Script_RMXP.rb', line 743

def command_129
end

#command_131

Window skin change command



746
747
# File 'docs/00600_Script_RMXP.rb', line 746

def command_131
end

#command_132

Battle BGM change command



749
750
# File 'docs/00600_Script_RMXP.rb', line 749

def command_132
end

#command_133

Battle end ME change command



752
753
# File 'docs/00600_Script_RMXP.rb', line 752

def command_133
end

#command_134

Save disable command



755
756
# File 'docs/00600_Script_RMXP.rb', line 755

def command_134
end

#command_135

Menu disable command



758
759
# File 'docs/00600_Script_RMXP.rb', line 758

def command_135
end

#command_136

Encounter disable command



761
762
# File 'docs/00600_Script_RMXP.rb', line 761

def command_136
end

#command_201

Warp command



765
766
# File 'docs/00600_Script_RMXP.rb', line 765

def command_201
end

#command_202

Displace command



768
769
# File 'docs/00600_Script_RMXP.rb', line 768

def command_202
end

#command_203

Map scroll command



771
772
# File 'docs/00600_Script_RMXP.rb', line 771

def command_203
end

#command_204

Map property change command



774
775
# File 'docs/00600_Script_RMXP.rb', line 774

def command_204
end

#command_205

Map Tone change command



777
778
# File 'docs/00600_Script_RMXP.rb', line 777

def command_205
end

#command_206

Map fog opacity change command



780
781
# File 'docs/00600_Script_RMXP.rb', line 780

def command_206
end

#command_207

Display animation on character command



783
784
# File 'docs/00600_Script_RMXP.rb', line 783

def command_207
end

#command_208

Make player transparent command



786
787
# File 'docs/00600_Script_RMXP.rb', line 786

def command_208
end

#command_209

Move route set command



789
790
# File 'docs/00600_Script_RMXP.rb', line 789

def command_209
end

#command_210

Wait until end of events move route



792
793
# File 'docs/00600_Script_RMXP.rb', line 792

def command_210
end

#command_221

Prepare transition command



795
796
# File 'docs/00600_Script_RMXP.rb', line 795

def command_221
end

#command_222

Execute transition command



798
799
# File 'docs/00600_Script_RMXP.rb', line 798

def command_222
end

#command_223

Screen tone change command



801
802
# File 'docs/00600_Script_RMXP.rb', line 801

def command_223
end

#command_224

Flash screen command



804
805
# File 'docs/00600_Script_RMXP.rb', line 804

def command_224
end

#command_225

Shake screen command



807
808
# File 'docs/00600_Script_RMXP.rb', line 807

def command_225
end

#command_231

Picture display command



810
811
# File 'docs/00600_Script_RMXP.rb', line 810

def command_231
end

#command_232

Picture move command



813
814
# File 'docs/00600_Script_RMXP.rb', line 813

def command_232
end

#command_233

Picture rotate command



816
817
# File 'docs/00600_Script_RMXP.rb', line 816

def command_233
end

#command_234

Picture tone change command



819
820
# File 'docs/00600_Script_RMXP.rb', line 819

def command_234
end

#command_235

Picture erase command



822
823
# File 'docs/00600_Script_RMXP.rb', line 822

def command_235
end

#command_236

Weather change command



825
826
# File 'docs/00600_Script_RMXP.rb', line 825

def command_236
end

#command_241

BGM play command



828
829
# File 'docs/00600_Script_RMXP.rb', line 828

def command_241
end

#command_242

BGM fade command



831
832
# File 'docs/00600_Script_RMXP.rb', line 831

def command_242
end

#command_245

BGS play command



834
835
# File 'docs/00600_Script_RMXP.rb', line 834

def command_245
end

#command_246

BGS Fade command



837
838
# File 'docs/00600_Script_RMXP.rb', line 837

def command_246
end

#command_247

BGM & BGS memorize command



840
841
# File 'docs/00600_Script_RMXP.rb', line 840

def command_247
end

#command_248

BGM & BGS restore command



843
844
# File 'docs/00600_Script_RMXP.rb', line 843

def command_248
end

#command_249

ME play command



846
847
# File 'docs/00600_Script_RMXP.rb', line 846

def command_249
end

#command_250

SE play command



849
850
# File 'docs/00600_Script_RMXP.rb', line 849

def command_250
end

#command_251

SE stop command



852
853
# File 'docs/00600_Script_RMXP.rb', line 852

def command_251
end

#command_301

Start battle command



856
857
# File 'docs/00600_Script_RMXP.rb', line 856

def command_301
end

#command_302

Call a shop command



868
869
# File 'docs/00600_Script_RMXP.rb', line 868

def command_302
end

#command_303

Name calling command



871
872
# File 'docs/00600_Script_RMXP.rb', line 871

def command_303
end

#command_311

Add or remove HP command



874
875
# File 'docs/00600_Script_RMXP.rb', line 874

def command_311
end

#command_312

Add or remove SP command



877
878
# File 'docs/00600_Script_RMXP.rb', line 877

def command_312
end

#command_313

Add or remove state command



880
881
# File 'docs/00600_Script_RMXP.rb', line 880

def command_313
end

#command_314

Heal command



883
884
# File 'docs/00600_Script_RMXP.rb', line 883

def command_314
end

#command_315

Add exp command



886
887
# File 'docs/00600_Script_RMXP.rb', line 886

def command_315
end

#command_316

Add level command



889
890
# File 'docs/00600_Script_RMXP.rb', line 889

def command_316
end

#command_317

Change stat command



892
893
# File 'docs/00600_Script_RMXP.rb', line 892

def command_317
end

#command_318

Skill learn/forget command



895
896
# File 'docs/00600_Script_RMXP.rb', line 895

def command_318
end

#command_319

Equip command



898
899
# File 'docs/00600_Script_RMXP.rb', line 898

def command_319
end

#command_320

Name change command



901
902
# File 'docs/00600_Script_RMXP.rb', line 901

def command_320
end

#command_321

Class change command



904
905
# File 'docs/00600_Script_RMXP.rb', line 904

def command_321
end

#command_322

Actor graphic change command



907
908
# File 'docs/00600_Script_RMXP.rb', line 907

def command_322
end

#command_331

Enemy HP change command



911
912
# File 'docs/00600_Script_RMXP.rb', line 911

def command_331
end

#command_332

Enemy SP change command



914
915
# File 'docs/00600_Script_RMXP.rb', line 914

def command_332
end

#command_333

Enemy state change command



917
918
# File 'docs/00600_Script_RMXP.rb', line 917

def command_333
end

#command_334

Enemy heal command



920
921
# File 'docs/00600_Script_RMXP.rb', line 920

def command_334
end

#command_335

Enemy show command



923
924
# File 'docs/00600_Script_RMXP.rb', line 923

def command_335
end

#command_336

Enemy transform command



926
927
# File 'docs/00600_Script_RMXP.rb', line 926

def command_336
end

#command_337

Play animation on battler



929
930
# File 'docs/00600_Script_RMXP.rb', line 929

def command_337
end

#command_338

Damage on battler command



932
933
# File 'docs/00600_Script_RMXP.rb', line 932

def command_338
end

#command_339

Battler force action command



935
936
# File 'docs/00600_Script_RMXP.rb', line 935

def command_339
end

#command_340

End battle command



938
939
# File 'docs/00600_Script_RMXP.rb', line 938

def command_340
end

#command_351

Call menu command



941
942
# File 'docs/00600_Script_RMXP.rb', line 941

def command_351
end

#command_352

Call save command



944
945
# File 'docs/00600_Script_RMXP.rb', line 944

def command_352
end

#command_353

Game Over command



947
948
# File 'docs/00600_Script_RMXP.rb', line 947

def command_353
end

#command_354

Go to title command



950
951
# File 'docs/00600_Script_RMXP.rb', line 950

def command_354
end

#command_355

Execute script command



953
954
# File 'docs/00600_Script_RMXP.rb', line 953

def command_355
end

#command_402

Command that execute the choice branch depending on the choice result



666
667
# File 'docs/00600_Script_RMXP.rb', line 666

def command_402
end

#command_403

Command that execute the cancel branch if the result was 4 (max option in RMXP)



669
670
# File 'docs/00600_Script_RMXP.rb', line 669

def command_403
end

#command_411

Command testing the false section of condition



691
692
# File 'docs/00600_Script_RMXP.rb', line 691

def command_411
end

#command_413

Repeat loop command (try to go back to the loop command of the same indent)



697
698
# File 'docs/00600_Script_RMXP.rb', line 697

def command_413
end

#command_601

勝った場合



859
860
# File 'docs/00600_Script_RMXP.rb', line 859

def command_601
end

#command_602

逃げた場合



862
863
# File 'docs/00600_Script_RMXP.rb', line 862

def command_602
end

#command_603

負けた場合



865
866
# File 'docs/00600_Script_RMXP.rb', line 865

def command_603
end

#command_end

Command that end the interpretation of the current event



639
640
# File 'docs/00600_Script_RMXP.rb', line 639

def command_end
end

#command_skip

Command that skip the next commands until it find a command with the same indent



642
643
# File 'docs/00600_Script_RMXP.rb', line 642

def command_skip
end

#eval_condition_script(script)

Function that execute a script for the conditions

Parameters:



688
689
# File 'docs/00600_Script_RMXP.rb', line 688

def eval_condition_script(script)
end

#eval_script(script)

Function that execute a script

Parameters:



957
958
# File 'docs/00600_Script_RMXP.rb', line 957

def eval_script(script)
end

#execute_command

Execute a command of the current event



636
637
# File 'docs/00600_Script_RMXP.rb', line 636

def execute_command
end

#get_character(parameter) ⇒ Game_Event, ...

Command that retrieve a Game_Character object

Parameters:

  • parameter (Integer, Symbol)

    > 0 : id of the event, 0 : current event, -1 : player or follower, Symbol : alias

Returns:



647
648
# File 'docs/00600_Script_RMXP.rb', line 647

def get_character(parameter)
end

#input_button

Check if a button is triggered and store its id in a variable



599
600
# File 'docs/00600_Script_RMXP.rb', line 599

def input_button
end

#iterate_actor(parameter)

Execute a block on a specific actor (parameter > 0) or every actors in the Party

Parameters:

  • parameter (Integer)

    whole party or id of an actor in the database



606
607
# File 'docs/00600_Script_RMXP.rb', line 606

def iterate_actor(parameter)
end

#iterate_battler(parameter1, parameter2)

Execute a block on a every enemies (parameter1 == 0) or every actors (parameter2 == -1) or a specific actor in the party

Parameters:

  • parameter1 (Integer)

    if 0, execute a block on every enemies

  • parameter2 (Integer)

    whole party or index of an actor in the party



615
616
# File 'docs/00600_Script_RMXP.rb', line 615

def iterate_battler(parameter1, parameter2)
end

#iterate_enemy(parameter)

Execute a block on a specific enemy (parameter >= 0) or every enemies in the troop

Parameters:

  • parameter (Integer)

    whole troop or index of an enemy in the troop



610
611
# File 'docs/00600_Script_RMXP.rb', line 610

def iterate_enemy(parameter)
end

#launch_common_event(id)

Launch a common event in a child interpreter

Parameters:

  • id (Integer)

    id of the common event



574
575
# File 'docs/00600_Script_RMXP.rb', line 574

def launch_common_event(id)
end

#operate_value(operation, operand_type, operand)

Command that retrieve a value and negate it if wanted

Parameters:

  • operation (Integer)

    if 1 negate the value

  • operand_type (Integer)

    if 0 takes operand, otherwise take the game variable n°operand

  • operand (Integer)

    the value or index



653
654
# File 'docs/00600_Script_RMXP.rb', line 653

def operate_value(operation, operand_type, operand)
end

#running?Boolean

Tells if the interpreter is running or not

Returns:

  • (Boolean)


584
585
# File 'docs/00600_Script_RMXP.rb', line 584

def running?
end

#setup(list, event_id, block = nil)

Setup the interpreter with a list of Commands

Parameters:

  • list (Array<RPG::Command>)

    list of commands

  • event_id (Integer)

    id of the event that launch the interpreter

  • block (Proc) (defaults to: nil)

    the ruby commands to execute using a fiber (list is ignored if this variable is set)



580
581
# File 'docs/00600_Script_RMXP.rb', line 580

def setup(list, event_id, block = nil)
end

#setup_choices(parameters)

Setup choices in order to start a choice process



602
603
# File 'docs/00600_Script_RMXP.rb', line 602

def setup_choices(parameters)
end

#setup_starting_event

Setup the interpreter with an event (Game_Event / Game_CommonEvent) that can run



587
588
# File 'docs/00600_Script_RMXP.rb', line 587

def setup_starting_event
end

#update

Update the interpreter



590
591
# File 'docs/00600_Script_RMXP.rb', line 590

def update
end