-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
2716 lines (2679 loc) · 161 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<html>
<head>
<title>Pokémon FireRed scripting commands</title>
<noscript>
<style>
.js-only{display:none}
#list div.collapsible-section>div.body{display:block!important}
</style>
</noscript>
<script src="jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="filter.js" type="text/javascript"></script>
<link rel="stylesheet" href="style.css" type="text/css" media="screen"/>
</head>
<body>
<h1>Pokémon FireRed Scripting Commands</h1>
<h4>original document created by <a href="http://www.pokecommunity.com/member.php?username=DavidJCobb">DavidJCobb<a/> with some revisions</h4>
<p>This document is meant to serve as a comprehensive reference to
each scripting command. The information is FireRed-centric and
includes detailed descriptions of what the commands do, the
locations of their ASM code, and more.</p>
<p>Commands above <code>0xD5</code> are not listed because they do
not exist in FireRed.</p>
<p>Some revisions have been added in. They are styled
<span class="comment">like so</span>. Want to make a contribution? <a href="http://www.pokecommunity.com/member.php?username=Spherical Ice">PM Spherical Ice on PokéCommunity</a>, or <a href="mailto:[email protected]">e-mail him</a>.
<h2>Table of contents</h2>
<ol id="TOC">
<li>
<a href="#data-types">List of data types</a>
</li>
<li>
<a href="#commands">List of script commands</a>
<form id="command-list-filter" class="js-only">
<p class="form-header">Filter:</p>
<ul class="states">
<li><input type="checkbox" data-type="undocumented" id="fUndoc"> <label for="fUndoc">Undocumented</label></li>
<li><input type="checkbox" data-type="documented" id="fDoc"> <label for="fDoc">Documented</label></li>
<li><input type="checkbox" data-type="complete" id="fCom"> <label for="fCom">Complete</label></li>
<li><input type="checkbox" data-type="incomplete" id="fInc"> <label for="fInc">Incomplete</label></li>
<li class="right"><input type="checkbox" id="fAll"> <label for="fAll">All</label></li>
</ul>
<ul class="types">
<li><input type="checkbox" data-type="banks" id="fBanks"> <label for="fBanks">Banks</label></li>
<li><input type="checkbox" data-type="battles" id="fBattles"> <label for="fBattles">Battles</label></li>
<li><input type="checkbox" data-type="blocking" id="fBlocking"> <label for="fBlocking">Blocking</label></li>
<li><input type="checkbox" data-type="buffer" id="fBuffer"> <label for="fBuffer">Buffer</label></li>
<li><input type="checkbox" data-type="comparisons" id="fComparisons"> <label for="fComparisons">Comparisons</label></li>
<li><input type="checkbox" data-type="dialogs" id="fDialogs"> <label for="fDialogs">Dialogs</label></li>
<li><input type="checkbox" data-type="flags" id="fFlags"> <label for="fFlags">Flags</label></li>
<li><input type="checkbox" data-type="items" id="fItems"> <label for="fItems">Items</label></li>
<li><input type="checkbox" data-type="logic" id="fLogic"> <label for="Logic">Logic</label></li>
<li><input type="checkbox" data-type="map" id="fMap"> <label for="fMap">Map</label></li>
<li><input type="checkbox" data-type="sound" id="fSound"> <label for="fSound">Sound</label></li>
<li><input type="checkbox" data-type="std" id="fStd"> <label for="fStd">Std</label></li>
<li><input type="checkbox" data-type="timing" id="fTiming"> <label for="fTiming">Timing</label></li>
<li><input type="checkbox" data-type="variables" id="fVariables"> <label for="fVariables">Variables</label></li>
<li><input type="checkbox" data-type="warping" id="fWarping"> <label for="fWarping">Warping</label></li>
<li><input type="checkbox" data-type="nop" id="fNop"> <label for="fNop">Nop</label></li>
<li><input type="checkbox" data-type="unknown" id="fUnknown"> <label for="fUnknown">Unknown</label></li>
<li><input type="checkbox" data-type="uncategorized" id="fUncat"> <label for="fUncat">Uncategorized</label></li>
</ul>
</form>
<ol id="command-list-TOC" class="height-limited" start="0">
<li><a href="#c-00" class="c-link">0x00 nop</a></li>
<li><a href="#c-01" class="c-link">0x01 nop1</a></li>
<li><a href="#c-02" class="c-link">0x02 end</a></li>
<li><a href="#c-03" class="c-link">0x03 return</a></li>
<li><a href="#c-04" class="c-link">0x04 call</a></li>
<li><a href="#c-05" class="c-link">0x05 goto</a></li>
<li><a href="#c-06" class="c-link">0x06 if1</a> (if)</li>
<li><a href="#c-07" class="c-link">0x07 if2</a> (if)</li>
<li><a href="#c-08" class="c-link">0x08 gotostd</a></li>
<li><a href="#c-09" class="c-link">0x09 callstd</a></li>
<li><a href="#c-0A" class="c-link">0x0A gotostdif</a></li>
<li><a href="#c-0B" class="c-link">0x0B callstdif</a></li>
<li><a href="#c-0C" class="c-link">0x0C jumpram</a></li>
<li><a href="#c-0D" class="c-link">0x0D killscript</a></li>
<li><a href="#c-0E" class="c-link">0x0E setbyte</a></li>
<li><a href="#c-0F" class="c-link">0x0F loadpointer</a> (acts like "setbank")</li>
<li><a href="#c-10" class="c-link">0x10 setbyte2</a></li>
<li><a href="#c-11" class="c-link">0x11 writebytetooffset</a></li>
<li><a href="#c-12" class="c-link">0x12 loadbytefrompointer</a></li>
<li><a href="#c-13" class="c-link">0x13 setfarbyte</a></li>
<li><a href="#c-14" class="c-link">0x14 copyscriptbanks</a></li>
<li><a href="#c-15" class="c-link">0x15 copybyte</a></li>
<li><a href="#c-16" class="c-link">0x16 setvar</a></li>
<li><a href="#c-17" class="c-link">0x17 addvar</a></li>
<li><a href="#c-18" class="c-link">0x18 subvar</a></li>
<li><a href="#c-19" class="c-link">0x19 copyvar</a></li>
<li><a href="#c-1A" class="c-link">0x1A copyvarifnotzero</a> (acts like "copyorsetvar")</li>
<li><a href="#c-1B" class="c-link">0x1B comparebanks</a></li>
<li><a href="#c-1C" class="c-link">0x1C comparebanktobyte</a></li>
<li><a href="#c-1D" class="c-link">0x1D comparebanktofarbyte</a></li>
<li><a href="#c-1E" class="c-link">0x1E comparefarbytetobank</a></li>
<li><a href="#c-1F" class="c-link">0x1F comparefarbytetobyte</a></li>
<li><a href="#c-20" class="c-link">0x20 comparefarbytes</a></li>
<li><a href="#c-21" class="c-link">0x21 compare</a></li>
<li><a href="#c-22" class="c-link">0x22 comparevars</a></li>
<li><a href="#c-23" class="c-link">0x23 callasm</a></li>
<li><a href="#c-24" class="c-link">0x24 cmd24</a></li>
<li><a href="#c-25" class="c-link">0x25 special</a></li>
<li><a href="#c-26" class="c-link">0x26 special2</a></li>
<li><a href="#c-27" class="c-link">0x27 waitstate</a></li>
<li><a href="#c-28" class="c-link">0x28 pause</a></li>
<li><a href="#c-29" class="c-link">0x29 setflag</a></li>
<li><a href="#c-2A" class="c-link">0x2A clearflag</a></li>
<li><a href="#c-2B" class="c-link">0x2B checkflag</a></li>
<li><a href="#c-2C" class="c-link">0x2C cmd2c</a> (nop)</li>
<li><a href="#c-2D" class="c-link">0x2D checkdailyflags</a> (nop)</li>
<li><a href="#c-2E" class="c-link">0x2E resetvars</a></li>
<li><a href="#c-2F" class="c-link">0x2F sound</a></li>
<li><a href="#c-30" class="c-link">0x30 checksound</a> (acts like "waitsound")</li>
<li><a href="#c-31" class="c-link">0x31 fanfare</a></li>
<li><a href="#c-32" class="c-link">0x32 waitfanfare</a></li>
<li><a href="#c-33" class="c-link">0x33 playsong</a></li>
<li><a href="#c-34" class="c-link">0x34 playsong2</a></li>
<li><a href="#c-35" class="c-link">0x35 fadedefault</a></li>
<li><a href="#c-36" class="c-link">0x36 fadesong</a></li>
<li><a href="#c-37" class="c-link">0x37 fadeout</a></li>
<li><a href="#c-38" class="c-link">0x38 fadein</a></li>
<li><a href="#c-39" class="c-link">0x39 warp</a></li>
<li><a href="#c-3A" class="c-link">0x3A warpmuted</a></li>
<li><a href="#c-3B" class="c-link">0x3B warpwalk</a></li>
<li><a href="#c-3C" class="c-link">0x3C warphole</a></li>
<li><a href="#c-3D" class="c-link">0x3D warpteleport</a></li>
<li><a href="#c-3E" class="c-link">0x3E warp3</a></li>
<li><a href="#c-3F" class="c-link">0x3F setwarpplace</a></li>
<li><a href="#c-40" class="c-link">0x40 warp4</a></li>
<li><a href="#c-41" class="c-link">0x41 warp5</a></li>
<li><a href="#c-42" class="c-link">0x42 getplayerpos</a></li>
<li><a href="#c-43" class="c-link">0x43 countPokémon</a></li>
<li><a href="#c-44" class="c-link">0x44 additem</a></li>
<li><a href="#c-45" class="c-link">0x45 removeitem</a></li>
<li><a href="#c-46" class="c-link">0x46 checkitemroom</a></li>
<li><a href="#c-47" class="c-link">0x47 checkitem</a></li>
<li><a href="#c-48" class="c-link">0x48 checkitemtype</a></li>
<li><a href="#c-49" class="c-link">0x49 addpcitem</a></li>
<li><a href="#c-4A" class="c-link">0x4A checkpcitem</a></li>
<li><a href="#c-4B" class="c-link">0x4B adddecoration</a> (nop)</li>
<li><a href="#c-4C" class="c-link">0x4C removedecoration</a> (nop)</li>
<li><a href="#c-4D" class="c-link">0x4D testdecoration</a> (nop)</li>
<li><a href="#c-4E" class="c-link">0x4E checkdecoration</a> (nop)</li>
<li><a href="#c-4F" class="c-link">0x4F applymovement</a></li>
<li><a href="#c-50" class="c-link">0x50 applymovementpos</a></li>
<li><a href="#c-51" class="c-link">0x51 waitmovement</a></li>
<li><a href="#c-52" class="c-link">0x52 waitmovementpos</a></li>
<li><a href="#c-53" class="c-link">0x53 hidesprite</a></li>
<li><a href="#c-54" class="c-link">0x54 hidespritepos</a></li>
<li><a href="#c-55" class="c-link">0x55 showsprite</a></li>
<li><a href="#c-56" class="c-link">0x56 showspritepos</a></li>
<li><a href="#c-57" class="c-link">0x57 movesprite</a></li>
<li><a href="#c-58" class="c-link">0x58 spritevisible</a></li>
<li><a href="#c-59" class="c-link">0x59 spriteinvisible</a></li>
<li><a href="#c-5A" class="c-link">0x5A faceplayer</a></li>
<li><a href="#c-5B" class="c-link">0x5B spriteface</a></li>
<li><a href="#c-5C" class="c-link">0x5C trainerbattle</a></li>
<li><a href="#c-5D" class="c-link">0x5D repeattrainerbattle</a> (acts like "dotrainerbattle")</li>
<li><a href="#c-5E" class="c-link">0x5E endtrainerbattle</a></li>
<li><a href="#c-5F" class="c-link">0x5F endtrainerbattle2</a></li>
<li><a href="#c-60" class="c-link">0x60 checktrainerflag</a></li>
<li><a href="#c-61" class="c-link">0x61 cleartrainerflag</a> (acts like "settrainerflag")</li>
<li><a href="#c-62" class="c-link">0x62 settrainerflag</a> (acts like "cleartrainerflag")</li>
<li><a href="#c-63" class="c-link">0x63 movesprite2</a></li>
<li><a href="#c-64" class="c-link">0x64 moveoffscreen</a></li>
<li><a href="#c-65" class="c-link">0x65 spritebehave</a></li>
<li><a href="#c-66" class="c-link">0x66 waitmsg</a></li>
<li><a href="#c-67" class="c-link">0x67 preparemsg</a></li>
<li><a href="#c-68" class="c-link">0x68 closeonkeypress</a></li>
<li><a href="#c-69" class="c-link">0x69 lockall</a></li>
<li><a href="#c-6A" class="c-link">0x6A lock</a></li>
<li><a href="#c-6B" class="c-link">0x6B releaseall</a></li>
<li><a href="#c-6C" class="c-link">0x6C release</a></li>
<li><a href="#c-6D" class="c-link">0x6D waitkeypress</a></li>
<li><a href="#c-6E" class="c-link">0x6E yesnobox</a></li>
<li><a href="#c-6F" class="c-link">0x6F multichoice</a></li>
<li><a href="#c-70" class="c-link">0x70 multichoice2</a></li>
<li><a href="#c-71" class="c-link">0x71 multichoice3</a></li>
<li><a href="#c-72" class="c-link">0x72 showbox</a></li>
<li><a href="#c-73" class="c-link">0x73 hidebox</a></li>
<li><a href="#c-74" class="c-link">0x74 clearbox</a></li>
<li><a href="#c-75" class="c-link">0x75 showpokepic</a></li>
<li><a href="#c-76" class="c-link">0x76 hidepokepic</a></li>
<li><a href="#c-77" class="c-link">0x77 showcontestwinner</a> (nop)</li>
<li><a href="#c-78" class="c-link">0x78 braille</a></li>
<li><a href="#c-79" class="c-link">0x79 givePokémon</a></li>
<li><a href="#c-7A" class="c-link">0x7A giveegg</a></li>
<li><a href="#c-7B" class="c-link">0x7B setpkmnpp</a></li>
<li><a href="#c-7C" class="c-link">0x7C checkattack</a></li>
<li><a href="#c-7D" class="c-link">0x7D bufferPokémon</a></li>
<li><a href="#c-7E" class="c-link">0x7E bufferfirstPokémon</a></li>
<li><a href="#c-7F" class="c-link">0x7F bufferpartyPokémon</a></li>
<li><a href="#c-80" class="c-link">0x80 bufferitem</a></li>
<li><a href="#c-81" class="c-link">0x81 bufferdecoration</a> (nop)</li>
<li><a href="#c-82" class="c-link">0x82 bufferattack</a></li>
<li><a href="#c-83" class="c-link">0x83 buffernumber</a></li>
<li><a href="#c-84" class="c-link">0x84 bufferstd</a></li>
<li><a href="#c-85" class="c-link">0x85 bufferstring</a></li>
<li><a href="#c-86" class="c-link">0x86 pokemart</a></li>
<li><a href="#c-87" class="c-link">0x87 pokemart2</a></li>
<li><a href="#c-88" class="c-link">0x88 pokemart3</a></li>
<li><a href="#c-89" class="c-link">0x89 pokecasino</a></li>
<li><a href="#c-8A" class="c-link">0x8A cmd8a</a> (nop)</li>
<li><a href="#c-8B" class="c-link">0x8B choosecontestpkmn</a></li>
<li><a href="#c-8C" class="c-link">0x8C startcontest</a> (nop)</li>
<li><a href="#c-8D" class="c-link">0x8D showcontestresults</a> (nop)</li>
<li><a href="#c-8E" class="c-link">0x8E contestlinktransfer</a> (nop)</li>
<li><a href="#c-8F" class="c-link">0x8F random</a></li>
<li><a href="#c-90" class="c-link">0x90 givemoney</a></li>
<li><a href="#c-91" class="c-link">0x91 paymoney</a></li>
<li><a href="#c-92" class="c-link">0x92 checkmoney</a></li>
<li><a href="#c-93" class="c-link">0x93 showmoney</a></li>
<li><a href="#c-94" class="c-link">0x94 hidemoney</a></li>
<li><a href="#c-95" class="c-link">0x95 updatemoney</a></li>
<li><a href="#c-96" class="c-link">0x96 cmd96</a> (nop)</li>
<li><a href="#c-97" class="c-link">0x97 fadescreen</a></li>
<li><a href="#c-98" class="c-link">0x98 fadescreendelay</a></li>
<li><a href="#c-99" class="c-link">0x99 darken</a></li>
<li><a href="#c-9A" class="c-link">0x9A lighten</a></li>
<li><a href="#c-9B" class="c-link">0x9B preparemsg2</a></li>
<li><a href="#c-9C" class="c-link">0x9C doanimation</a></li>
<li><a href="#c-9D" class="c-link">0x9D setanimation</a></li>
<li><a href="#c-9E" class="c-link">0x9E checkanimation</a> (acts like "waitanimation")</li>
<li><a href="#c-9F" class="c-link">0x9F sethealingplace</a></li>
<li><a href="#c-A0" class="c-link">0xA0 checkgender</a></li>
<li><a href="#c-A1" class="c-link">0xA1 cry</a></li>
<li><a href="#c-A2" class="c-link">0xA2 setmaptile</a></li>
<li><a href="#c-A3" class="c-link">0xA3 resetweather</a></li>
<li><a href="#c-A4" class="c-link">0xA4 setweather</a></li>
<li><a href="#c-A5" class="c-link">0xA5 doweather</a></li>
<li><a href="#c-A6" class="c-link">0xA6 cmda6</a> (acts like "settilemanager")</li>
<li><a href="#c-A7" class="c-link">0xA7 setmapfooter</a></li>
<li><a href="#c-A8" class="c-link">0xA8 spritelevelup</a></li>
<li><a href="#c-A9" class="c-link">0xA9 restorespritelevel</a></li>
<li><a href="#c-AA" class="c-link">0xAA createsprite</a></li>
<li><a href="#c-AB" class="c-link">0xAB spriteface2</a></li>
<li><a href="#c-AC" class="c-link">0xAC setdooropened</a></li>
<li><a href="#c-AD" class="c-link">0xAD setdoorclosed</a></li>
<li><a href="#c-AE" class="c-link">0xAE doorchange</a></li>
<li><a href="#c-AF" class="c-link">0xAF setdooropened2</a></li>
<li><a href="#c-B0" class="c-link">0xB0 setdoorclosed2</a></li>
<li><a href="#c-B1" class="c-link">0xB1 cmdb1</a> (nop)</li>
<li><a href="#c-B2" class="c-link">0xB2 cmdb2</a> (nop)</li>
<li><a href="#c-B3" class="c-link">0xB3 checkcoins</a></li>
<li><a href="#c-B4" class="c-link">0xB4 givecoins</a></li>
<li><a href="#c-B5" class="c-link">0xB5 removecoins</a></li>
<li><a href="#c-B6" class="c-link">0xB6 setwildbattle</a></li>
<li><a href="#c-B7" class="c-link">0xB7 dowildbattle</a></li>
<li><a href="#c-B8" class="c-link">0xB8 setvirtualaddress</a></li>
<li><a href="#c-B9" class="c-link">0xB9 virtualgoto</a></li>
<li><a href="#c-BA" class="c-link">0xBA virtualcall</a></li>
<li><a href="#c-BB" class="c-link">0xBB virtualgotoif</a></li>
<li><a href="#c-BC" class="c-link">0xB9 virtualcallif</a></li>
<li><a href="#c-BD" class="c-link">0xB9 virtualmsgbox</a></li>
<li><a href="#c-BE" class="c-link">0xB9 virtualloadpointer</a></li>
<li><a href="#c-BF" class="c-link">0xB9 virtualbuffer</a></li>
<li><a href="#c-C0" class="c-link">0xC0 showcoins</a></li>
<li><a href="#c-C1" class="c-link">0xC1 hidecoins</a></li>
<li><a href="#c-C2" class="c-link">0xC2 updatecoins</a></li>
<li><a href="#c-C3" class="c-link">0xC3 cmdc3</a></li>
<li><a href="#c-C4" class="c-link">0xC4 warp6</a></li>
<li><a href="#c-C5" class="c-link">0xC5 waitcry</a></li>
<li><a href="#c-C6" class="c-link">0xC6 bufferboxname</a></li>
<li><a href="#c-C7" class="c-link">0xC7 textcolor</a></li>
<li><a href="#c-C8" class="c-link">0xC8 cmdc8</a></li>
<li><a href="#c-C9" class="c-link">0xC9 cmdc9</a></li>
<li><a href="#c-CA" class="c-link">0xCA signmsg</a></li>
<li><a href="#c-CB" class="c-link">0xCB normalmsg</a></li>
<li><a href="#c-CC" class="c-link">0xCC comparehiddenvar</a></li>
<li><a href="#c-CD" class="c-link">0xCD setobedience</a></li>
<li><a href="#c-CE" class="c-link">0xCE checkobedience</a></li>
<li><a href="#c-CF" class="c-link">0xCF executeram</a></li>
<li><a href="#c-D0" class="c-link">0xD0 setworldmapflag</a></li>
<li><a href="#c-D1" class="c-link">0xD1 warpteleport2</a></li>
<li><a href="#c-D2" class="c-link">0xD2 setcatchlocation</a></li>
<li><a href="#c-D3" class="c-link">0xD3 braille2</a> (acts like "getbraillewidth")</li>
<li><a href="#c-D4" class="c-link">0xD4 bufferitems</a></li>
<li><a href="#c-D5" class="c-link">0xD5 cmdd5</a> (nop)</li>
</ol>
<div id="command-list-summary" class="js-only">
<i><b></b><u></u></i>
<span>X complete out of Y documented out of Z</span>
</div>
</li>
<li>
<a href="#appendix">Appendix</a>
<ul>
<li><a href="#appendix-comparisons">Comparison operators</a></li>
<li><a href="#appendix-dialogs">Dialog boxes</a></li>
<li><a href="#appendix-command-asm">Finding the offset of a command's ASM (FireRed)</a></li>
<li><a href="#appendix-hidden-vars">Hidden variables</a></li>
<li><a href="#appendix-person">Person event terminology</a></li>
<li><a href="#appendix-banks">Script banks</a></li>
<li><a href="#appendix-std">Standard functions</a></li>
<li><a href="#appendix-rematchtable">Trainer battles: the rematch flag table</a></li>
</ul>
</li>
</ol>
<hr>
<h2><a name="data-types">List of data types</a></h2>
<dl>
<dt>byte</dt>
<dd><p>A single-byte value.</p></dd>
<dt>word</dt>
<dd><p>A two-byte value.</p></dd>
<dt>dword</dt>
<dd><p>A four-byte value.</p></dd>
<dt>pointer</dt>
<dd><p>A dword. The value should be the offset (in ROM or RAM) of some piece of data that the command needs.</p></dd>
<dt>variable</dt>
<dd>
<p>The two-byte numeric identifier of any valid script variable; that is, a word value greater than <code>0x3FFF</code>.</p>
<p>In most cases, commands that accept variables will extract the variables' values and use those values as input. Sometimes, a command will actually act on the variable itself rather than on its value (i.e. <a href="#c-16" class="c-link">setvar</a>).</p>
<p>It should be noted that variables <code>0x5084</code> to <code>0x7FFF</code> are not actually valid scripting variables, and modifying them may overwrite game data (including Pokémon stored in the PC).<a href="#var-limits-pc" class="source-link">[source]</a> Variables <code>0x4100</code> to <code>0x4180</code> may also be unsafe; a list of all safe variables hasn't been created yet.</p>
<p><span class="comment">Check out <a href="http://www.pokecommunity.com/showthread.php?t=302347" target="_blank">this document by karatekid552</a> on safe variables and flags.</span>
</dd>
<dt>flag</dt>
<dd>
<p>The two-byte numeric identifier of any valid script flag; that is, a word value lower than <code>0x0900</code>.</p>
<p>It should be noted that many flags have been reserved by the game engine. Flags <code>0x500</code> to <code>0x700</code> are trainer flags, flags <code>0x890</code> to <code>0x8FD</code> are world map flags, and many others are used as well.</p>
</dd>
<dt>bank</dt>
<dd>
<p>The single-byte numeric identifier of one of the four zero-indexed <a href="#appendix-banks">script banks</a>.</p>
</dd>
<dt>buffer</dt>
<dd>
<p>The single-byte numeric identifier of one of the three zero-indexed string buffers.</p>
</dd>
<dt>hidden-variable</dt>
<dd>
<p>The single-byte numeric identifier of one of the game's 64 <a href="#appendix-hidden-vars">hidden variables</a>.</p>
</dd>
<dt>pointer-or-bank</dt>
<dd><p>If the supplied argument is between <code>0x00000000</code> and <code>0x00000003</code> (inclusive), then it will be treated as a reference to a script bank. Otherwise, it is treated as a four-byte pointer to data.</p></dd>
<dt>pointer-or-bank-0</dt>
<dd><p>A pointer or script bank 0 may be used, but the other script banks may not be used.</p></dd>
<dt>flag-or-variable</dt>
<dd><p>If the supplied argument is a variable, then the game will use its value to locate the proper flag. Otherwise, the argument itself is treated as a flag identifier.</p></dd>
<dt>word-or-variable</dt>
<dd><p>If the supplied argument is a variable, then the game will extract that variable's value and use that as the input. Otherwise, the argument itself becomes the input.</p></dd>
<dt>byte-or-variable</dt>
<dd><p>If the supplied argument is a variable, then the game will extract that variable's value and use that as the input. Otherwise, the argument itself becomes the input. Either way, the input must be a word but is converted to a single-byte value (all bytes except the least-significant byte are discarded; <code>0xYYZZ</code> -> <code>0x00ZZ</code>).</p></dd>
</dl>
<hr>
<h2><a name="commands">List of script commands</a></h2>
<ol id="list">
<li data-type="nop">
<a name="c-00"></a>
<h3>00 nop</h3>
<p>Does nothing.</p>
</li>
<li data-type="nop">
<a name="c-01"></a>
<h3>01 nop1</h3>
<p>Does nothing.</p>
</li>
<li data-type="logic">
<a name="c-02"></a>
<h3>02 end</h3>
<p>Terminates script execution.</p>
</li>
<li data-type="logic">
<a name="c-03"></a>
<h3>03 return</h3>
<p>Jumps back to after the last-executed <a href="#c-04" class="c-link">call</a> statement, and continues script execution from there.</p>
</li>
<li data-type="logic">
<a name="c-04"></a>
<h3>04 call</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>pointer</span> destination</li>
</ul>
</div>
<p>Jumps to <code>destination</code> and continues script execution from there. The location of the calling script is remembered and can be <a href="#c-03" class="c-link">return</a>ed to later.</p>
<p>The maximum script depth (that is, the maximum nested calls you can make) is 20. When this limit is reached, the game starts treating <code>call</code> as <a href="#c-05" class="c-link">goto</a>.<a href="#max-call-depth" class="source-link">[source]</a></p>
</li>
<li data-type="logic">
<a name="c-05"></a>
<h3>05 goto</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>pointer</span> destination</li>
</ul>
</div>
<p>Jumps to <code>destination</code> and continues script execution from there.</p>
</li>
<li data-type="logic">
<a name="c-06"></a>
<h3>06 if1</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>byte</span> condition</li>
<li><span>pointer</span> destination</li>
</ul>
</div>
<p>If the result of the last comparison matches <code>condition</code> (see <a href="#appendix-comparisons">Comparison operators</a>), jumps to <code>destination</code> and continues script execution from there.</p>
<p>XSE automatically converts the slightly-more-readable form <code>if <var>condition</var> goto <var>pointer</var></code> to an <code>if1</code>.</p>
</li>
<li data-type="logic">
<a name="c-07"></a>
<h3>07 if2</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>byte</span> condition</li>
<li><span>pointer</span> destination</li>
</ul>
</div>
<p>If the result of the last comparison matches <code>condition</code> (see <a href="#appendix-comparisons">Comparison operators</a>), <a href="#c-04" class="c-link">call</a>s <code>destination</code>.</p>
<p>XSE automatically converts the slightly-more-readable form <code>if <var>condition</var> call <var>pointer</var></code> to an <code>if2</code>.</p>
</li>
<li data-type="std" class="group-start">
<a name="c-08"></a>
<h3>08 gotostd</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>byte</span> function</li>
</ul>
</div>
<p>Jumps to the <a href="#appendix-std">standard function</a> at index <code>function</code>.</p>
</li>
<li data-type="std" class="group-mid">
<a name="c-09"></a>
<h3>09 callstd (a.k.a. boxset)</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>byte</span> function</li>
</ul>
</div>
<p><a href="#c-04" class="c-link">Call</a>s the <a href="#appendix-std">standard function</a> at index <code>function</code>.</p>
</li>
<li data-type="std" class="group-mid">
<a name="c-0A"></a>
<h3>0A gotostdif</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>byte</span> condition</li>
<li><span>byte</span> function</li>
</ul>
</div>
<p>If the result of the last comparison matches <code>condition</code> (see <a href="#appendix-comparisons">Comparison operators</a>), jumps to the <a href="#appendix-std">standard function</a> at index <code>function</code>.</p>
</li>
<li data-type="std" class="group-end">
<a name="c-0B"></a>
<h3>0B callstdif</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>byte</span> condition</li>
<li><span>byte</span> function</li>
</ul>
</div>
<p>If the result of the last comparison matches <code>condition</code> (see <a href="#appendix-comparisons">Comparison operators</a>), <a href="#c-04" class="c-link">call</a>s the <a href="#appendix-std">standard function</a> at index <code>function</code>.</p>
</li>
<li>
<a name="c-0C"></a>
<h3>0C jumpram [details needed]</h3>
<p>Executes a script stored in a default RAM location.</p>
</li>
<li>
<a name="c-0D"></a>
<h3>0D killscript [details needed]</h3>
<p>Terminates script execution and "resets the script RAM".</p>
</li>
<li>
<a name="c-0E"></a>
<span class="asm-offset investigated">ASM (FR): 0x0806A275</span>
<h3>0E setbyte [details needed]</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>byte</span> value</li>
</ul>
</div>
<p>Pads the specified value to a dword, and then writes that dword to a predefined address (<code>0x0203AAA8</code>).</p>
<p>(What does that RAM offset do?)</p>
</li>
<li data-type="banks">
<a name="c-0F"></a>
<h3>0F loadpointer</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>bank</span> destination</li>
<li><span>dword</span> value</li>
</ul>
</div>
<p>Sets the specified <a href="#appendix-banks">script bank</a> to <code>value</code>.</p>
<p>(The function is named "loadpointer" because it was originally used to store pointers to strings in script banks, in preparation for certain dialog box-related standard functions. "Setbank" would have been a better name.)</p>
</li>
<li data-type="banks">
<a name="c-10"></a>
<h3>10 setbyte2</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>bank</span> destination</li>
<li><span>byte</span> value</li>
</ul>
</div>
<p>Sets the specified <a href="#appendix-banks">script bank</a> to <code>value</code>.</p>
</li>
<li>
<a name="c-11"></a>
<h3>11 writebytetooffset</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>byte</span> value</li>
<li><span>pointer</span> offset</li>
</ul>
</div>
<p>Sets the byte at <code>offset</code> to <code>value</code>.</p>
</li>
<li data-type="banks">
<a name="c-12"></a>
<h3>12 loadbytefrompointer</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>bank</span> destination</li>
<li><span>pointer</span> source</li>
</ul>
</div>
<p>Copies the byte value at <code>source</code> into the specified <a href="#appendix-banks">script bank</a>.</p>
</li>
<li data-type="banks">
<a name="c-13"></a>
<h3>13 setfarbyte [details needed]</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>bank</span> source</li>
<li><span>pointer</span> destination</li>
</ul>
</div>
<p>Not sure. Judging from XSE's description I <em>think</em> it takes the least-significant byte in bank <code>source</code> and writes it to <code>destination</code>.</p>
</li>
<li data-type="banks">
<a name="c-14"></a>
<h3>14 copyscriptbanks</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>bank</span> destination</li>
<li><span>bank</span> source</li>
</ul>
</div>
<p>Copies the contents of bank <code>source</code> into bank <code>destination</code>.</p> <!-- It copies the ENTIRE value, not just the least-significant bytes. -->
</li>
<li>
<a name="c-15"></a>
<h3>15 copybyte</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>pointer</span> destination</li>
<li><span>pointer</span> source</li>
</ul>
</div>
<p>Copies the byte at <code>source</code> to <code>destination</code>, replacing whatever byte was previously there.</p>
</li>
<li data-type="variables">
<a name="c-16"></a>
<h3>16 setvar</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>variable</span> destination</li>
<li><span>word</span> value</li>
</ul>
</div>
<p>Changes the value of <code>destination</code> to <code>value</code>.</p>
</li>
<li data-type="variables">
<a name="c-17"></a>
<h3>17 addvar</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>variable</span> destination</li>
<li><span>word</span> value</li>
</ul>
</div>
<p>Changes the value of <code>destination</code> by adding <code>value</code> to it. Overflow is not prevented (<code>0xFFFF</code> + <code>1</code> = <code>0x0000</code>).</p>
</li>
<li data-type="variables">
<a name="c-18"></a>
<h3>18 subvar</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>variable</span> destination</li>
<li><span>word-or-variable</span> value</li>
</ul>
</div>
<p>Changes the value of <code>destination</code> by subtracting <code>value</code> to it. Overflow is not prevented (<code>0x0000</code> - <code>1</code> = <code>0xFFFF</code>).</p>
</li>
<li data-type="variables">
<a name="c-19"></a>
<h3>19 copyvar</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>variable</span> destination</li>
<li><span>variable</span> source</li>
</ul>
</div>
<p>Copies the value of <code>source</code> into <code>destination</code>.</p>
</li>
<li data-type="variables">
<a name="c-1A"></a>
<h3>1A copyvarifnotzero</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>variable</span> destination</li>
<li><span>word-or-variable</span> source</li>
</ul>
</div>
<p>If <code>source</code> is not a variable, then this function acts like <a href="#c-18" class="c-link">setvar</a>. Otherwise, it acts like <a href="#c-19" class="c-link">copyvar</a>.</p>
<p>("Copyvarifnotzero" is a misnomer. This function was previously thought to act like copyvar if <code>source</code> was a variable with a non-zero value, and to do nothing otherwise.)</p>
</li>
<li data-type="banks,comparisons">
<a name="c-1B"></a>
<span class="asm-offset investigated">ASM (FR): 0x0806A42D</span>
<h3>1B comparebanks</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>bank</span> a</li>
<li><span>bank</span> b</li>
</ul>
</div>
<p>Compares the values of script banks <code>a</code> and <code>b</code>, after forcing the values to bytes.</p>
<p><strong>Warning: XSE has it wrong. The arguments are bytes, not words. This means that you will need to use <code>#raw</code> to compile a script that uses this command, and that such scripts will not decompile properly.</strong></p>
</li>
<li data-type="banks,comparisons">
<a name="c-1C"></a>
<h3>1C comparebanktobyte</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>bank</span> a</li>
<li><span>byte</span> b</li>
</ul>
</div>
<p>Compares the least-significant byte of the value of script bank <code>a</code> to a fixed byte value (<code>b</code>).</p>
</li>
<li data-type="banks,comparisons">
<a name="c-1D"></a>
<h3>1D comparebanktofarbyte</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>bank</span> a</li>
<li><span>pointer</span> b</li>
</ul>
</div>
<p>Compares the least-significant byte of the value of script bank <code>a</code> to the byte located at offset <code>b</code>.</p>
</li>
<li data-type="banks,comparisons">
<a name="c-1E"></a>
<h3>1E comparefarbytetobank</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>pointer</span> a</li>
<li><span>bank</span> b</li>
</ul>
</div>
<p>Compares the byte located at offset <code>a</code> to the least-significant byte of the value of script bank <code>b</code>.</p>
</li>
<li data-type="comparisons">
<a name="c-1F"></a>
<h3>1F comparefarbytetobyte</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>pointer</span> a</li>
<li><span>byte</span> b</li>
</ul>
</div>
<p>Compares the byte located at offset <code>a</code> to a fixed byte value (<code>b</code>).</p>
</li>
<li data-type="comparisons">
<a name="c-20"></a>
<h3>20 comparefarbytes</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>pointer</span> a</li>
<li><span>pointer</span> b</li>
</ul>
</div>
<p>Compares the byte located at offset <code>a</code> to the byte located at offset <code>b</code>.</p>
</li>
<li data-type="comparisons,variables">
<a name="c-21"></a>
<h3>21 compare</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>variable</span> a</li>
<li><span>word</span> b</li>
</ul>
</div>
<p>Compares the value of <code>a</code> to a fixed word value (<code>b</code>).</p>
</li>
<li data-type="comparisons,variables">
<a name="c-22"></a>
<h3>22 comparevars</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>variable</span> a</li>
<li><span>variable</span> b</li>
</ul>
</div>
<p>Compares the value of <code>a</code> to the value of <code>b</code>.</p>
</li>
<li data-type="blocking">
<a name="c-23"></a>
<h3>23 callasm</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>pointer</span> code</li>
</ul>
</div>
<p>Calls the ASM routine stored at <code>code</code>. Script execution is blocked until the ASM returns (<code>bx lr</code>, <code>mov pc, lr</code>, etc.). Remember to add 1 to the offset when calling THUMB code.</p>
</li>
<li data-type="">
<a name="c-24"></a>
<span class="asm-offset investigated">ASM (FR): 0x08069EE5</span>
<h3>24 cmd24 [details needed]</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>pointer</span> asm_pointer</li>
</ul>
</div>
<p>Replaces a pointer in the script engine RAM with <code>asm_pointer</code>.</p>
<p>(The pointer points to a THUMB routine... What effect does replacing it have?)</p>
</li>
<li>
<a name="c-25"></a>
<h3>25 special</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>word</span> function</li>
</ul>
</div>
<p>Calls a special function; that is, a piece of ASM code designed for use by scripts and listed in a table of pointers.</p>
<p>The special table is located at <code>0x0815FD60</code>.</p>
</li>
<li>
<a name="c-26"></a>
<h3>26 special2</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>variable</span> output</li>
<li><span>word</span> function</li>
</ul>
</div>
<p>Calls a special function. That function's output (if any) will be written to the variable you specify.</p>
</li>
<li data-type="blocking">
<a name="c-27"></a>
<h3>27 waitstate [details needed]</h3>
<p>Blocks script execution until a command or ASM code manually unblocks it. Generally used with specific commands and specials. If this command runs, and a subsequent command or piece of ASM does not unblock state, the script will remain blocked indefinitely (essentially a hang).</p>
</li>
<li data-type="blocking,timing">
<a name="c-28"></a>
<h3>28 pause [details needed]</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>word</span> time</li>
</ul>
</div>
<p>Blocks script execution for <code>time</code> (frames? milliseconds?).</p>
<p>A value of <code>0x0010</code> represents the amount of time it takes for a walking NPC to move one tile (i.e. dec 16 pixels).</p>
</li>
<li data-type="flags" class="group-start">
<a name="c-29"></a>
<h3>29 setflag</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>flag-or-variable</span> a</li>
</ul>
</div>
<p>Sets <code>a</code> to 1.</p>
</li>
<li data-type="flags" class="group-mid">
<a name="c-2A"></a>
<h3>2A clearflag</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>flag-or-variable</span> a</li>
</ul>
</div>
<p>Sets <code>a</code> to 0.</p>
</li>
<li data-type="comparisons,flags" class="group-end">
<a name="c-2B"></a>
<h3>2B checkflag</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>flag-or-variable</span> a</li>
</ul>
</div>
<p>Compares <code>a</code> to 1.</p>
</li>
<li data-type="nop">
<a name="c-2C"></a>
<span class="asm-offset investigated">ASM (FR): 0x0806A9D5</span>
<h3>2C cmd2c</h3>
<p>In FireRed, this command is a <a href="#c-00" class="c-link">nop</a>.</p>
<p><strong>Warning: XSE has it wrong. The function has no arguments. This means that you may need to use <code>#raw</code> to compile a script that uses this command, and that such scripts will not decompile properly.</strong></p>
</li>
<li data-type="nop">
<a name="c-2D"></a>
<span class="asm-offset investigated">ASM (FR): 0x0806A9D9</span>
<h3>2D checkdailyflags</h3>
<p>In FireRed, this command is a <a href="#c-00" class="c-link">nop</a>.</p>
<hr>
<p>In R/S/E, it had something to do with flags and the real-time clock.</p>
</li>
<li data-type="variables">
<a name="c-2E"></a>
<h3>2E resetvars</h3>
<p>Resets the values of variables 0x8000, 0x8001, and 0x8002. Related to RTC in RSE?</p>
</li>
<li data-type="sound" class="group-start">
<a name="c-2F"></a>
<h3>2F sound</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>word</span> sound_number</li> <!-- does not accept a variable -->
</ul>
</div>
<p>Plays the specified (<code>sound_number</code>) sound. Only one sound may play at a time, with newer ones interrupting older ones.</p>
<p>If you specify sound <code>0x0000</code>, then all music will be muted. If you specify the number of a non-existent sound, no new sound will be played, and currently-playing sounds will not be interrupted. A comprehensive list of sound numbers may be found <a href="http://www.pokecommunity.com/showpost.php?p=5610866&postcount=3">on PokeCommunity</a>.</p>
<p>Note that when using older versions of VisualBoyAdvance, the sound channel used for this command (and, sometimes, in music) will be completely muted after loading from a savestate.</p>
</li>
<li data-type="blocking,sound,timing" class="group-end">
<a name="c-30"></a>
<h3>30 checksound [details needed]</h3>
<p>Blocks script execution until the currently-playing sound (triggered by <a href="#c-2F" class="c-link">sound</a>) finishes playing.</p>
<p>(Does this also block until cries finish playing? The manner in which it's used by default scripts suggests that it might.)</p>
</li>
<li data-type="sound" class="group-start">
<a name="c-31"></a>
<h3>31 fanfare [details needed]</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>word-or-variable</span> fanfare_number</li>
</ul>
</div>
<p>Plays the specified (<code>fanfare_number</code>) fanfare.</p>
<p>(Is it limited to one fanfare at a time, like sound?)</p>
</li>
<li data-type="blocking,sound,timing" class="group-end">
<a name="c-32"></a>
<h3>32 waitfanfare</h3>
<p>Blocks script execution until all currently-playing fanfares finish.</p>
</li>
<li data-type="sound" class="group-start">
<a name="c-33"></a>
<h3>33 playsong [details needed]</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>word</span> song_number</li>
<li><span>byte</span> unknown</li>
</ul>
</div>
<p>Plays the specified (<code>song_number</code>) song. The byte is apparently supposed to be <code>0x00</code>.</p>
<p>(I need to test this command to see it has any quirks... And does it accept a variable?)</p>
</li>
<li data-type="sound" class="group-end">
<a name="c-34"></a>
<h3>34 playsong2 [details needed]</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>word</span> song_number</li>
</ul>
</div>
<p>Plays the specified (<code>song_number</code>) song.</p>
<p>(I need to test this command to see it has any quirks... Among other things, it's failed to work for me in situations where playsong has worked. And does it accept a variable?)</p>
</li>
<li data-type="sound" class="group-start">
<a name="c-35"></a>
<h3>35 fadedefault [details needed]</h3>
<p>Crossfades the currently-playing song into the map's default song.</p>
<p>(I need to test this command to see it has any quirks...)</p>
</li>
<li data-type="sound" class="group-mid">
<a name="c-36"></a>
<h3>36 fadesong [details needed]</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>word</span> song_number</li>
</ul>
</div>
<p>Crossfades the currently-playng song into the specified (<code>song_number</code>) song.</p>
<p>(I need to test this command to see it has any quirks... And does it accept a variable?)</p>
</li>
<li data-type="sound" class="group-mid">
<a name="c-37"></a>
<h3>37 fadeout [details needed]</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>byte</span> speed</li>
</ul>
</div>
<p>Fades out the currently-playing song.</p>
<p>(I need to test this command to see it has any quirks... And what unit of measurement is used for <code>speed</code>? And does it accept a variable?)</p>
</li>
<li data-type="sound" class="group-end">
<a name="c-38"></a>
<h3>38 fadein [details needed]</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>byte</span> speed</li>
</ul>
</div>
<p>Fades the currently-playing song back in.</p>
<p>(I need to test this command to see it has any quirks... And what unit of measurement is used for <code>speed</code>? And does it accept a variable?)</p>
</li>
<li data-type="warping" class="group-start">
<a name="c-39"></a>
<span class="asm-offset investigated">ASM (FR): 0x0806AA65</span>
<h3>39 warp [details needed]</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>byte</span> bank</li>
<li><span>byte</span> map</li>
<li><span>byte</span> warp</li>
<li><span>byte-or-variable</span> X</li>
<li><span>byte-or-variable</span> Y</li>
</ul>
</div>
<p>Sends the player to Warp <code>warp</code> on Map <code>bank</code>.<code>map</code>. If the specified <code>warp</code> is <code>0xFF</code>, then the player will instead be sent to (<code>X</code>, <code>Y</code>) on the map.</p>
<p>This command will also play Sappy song 0x0009, but only if the bytes at 0x02031DD8 and 0x0203ADFA are not equal to 0x00 and 0x02, respectively.</p>
<p>(Function terminates script execution?)</p>
</li>
<li data-type="warping" class="group-mid">
<a name="c-3A"></a>
<span class="asm-offset investigated">ASM (FR): 0x0806AAED</span>
<h3>3A warpmuted</h3>
<p>Clone of <a href="#c-39" class="c-link">warp</a> that does not play a sound effect.</p>
</li>
<li data-type="warping" class="group-mid">
<a name="c-3B"></a>
<h3>3B warpwalk [details needed]</h3>
<p>Clone of <a href="#c-39" class="c-link">warp</a> that uses "a walking effect".</p>
<p>(Any other differences?)</p>
</li>
<li data-type="warping" class="group-mid">
<a name="c-3C"></a>
<h3>3C warphole [details needed]</h3>
<div class="args">
<span>Arguments:</span>
<ul>
<li><span>byte</span> bank</li>
<li><span>byte</span> map</li>
</ul>
</div>
<p>Warps the player to another map using a hole animation.</p>
<p><span class="comment">Warps to the same X,Y co-ords as the player's when activated.</span></p>
</li>
<li data-type="warping" class="group-mid">
<a name="c-3D"></a>
<h3>3D warpteleport [details needed]</h3>
<p>Clone of <a href="#c-39" class="c-link">warp</a> that uses a teleport effect. It is apparently only used in R/S/E.<a href="#warpteleport-use-cases" class="source-link">[source]</a></p>
<p>(Any other differences?)</p>
</li>
<li data-type="warping" class="group-mid">
<a name="c-3E"></a>