From 6508469259cc7eb37c37814f16b2f3a29e9d9555 Mon Sep 17 00:00:00 2001 From: Tustin2121 Date: Sat, 17 Aug 2019 10:38:02 -0400 Subject: Rename movobjectoffscreen to copyobjectxytoperm Renaming the command to something that makes more sense as to what the command actually does. The command copies the current xy of the instantiated object back to its template, so that the object remains in the same place if the player walks away and despawns the object, and then comes back. "moveobjectoffscreen" implies that it might be taking the object and moving it physically to an off-screen location somehow. --- src/scrcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/scrcmd.c') diff --git a/src/scrcmd.c b/src/scrcmd.c index 57cd3edbe..8746e0cfb 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1102,7 +1102,7 @@ bool8 ScrCmd_setobjectxyperm(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_moveobjectoffscreen(struct ScriptContext *ctx) +bool8 ScrCmd_copyobjectxytoperm(struct ScriptContext *ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); -- cgit v1.2.3 From 9bcd39d86c06882c1c17909ee72ebc2b2819254b Mon Sep 17 00:00:00 2001 From: Tustin2121 Date: Sat, 17 Aug 2019 10:38:48 -0400 Subject: Document the braille window id. --- src/scrcmd.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/scrcmd.c') diff --git a/src/scrcmd.c b/src/scrcmd.c index 8746e0cfb..aa03181e6 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -62,7 +62,7 @@ static EWRAM_DATA u16 sMovingNpcMapBank = 0; static EWRAM_DATA u16 sMovingNpcMapId = 0; static EWRAM_DATA u16 sFieldEffectScriptId = 0; -static u8 gUnknown_03000F30; +static u8 gBrailleWindowId; extern const SpecialFunc gSpecials[]; extern const u8 *gStdScripts[]; @@ -1515,13 +1515,13 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) yText = (yText - yWindow - 1) * 8; winTemplate = CreateWindowTemplate(0, xWindow, yWindow + 1, width, height, 0xF, 0x1); - gUnknown_03000F30 = AddWindow(&winTemplate); - LoadUserWindowBorderGfx(gUnknown_03000F30, 0x214, 0xE0); - DrawStdWindowFrame(gUnknown_03000F30, 0); - PutWindowTilemap(gUnknown_03000F30); - FillWindowPixelBuffer(gUnknown_03000F30, PIXEL_FILL(1)); - AddTextPrinterParameterized(gUnknown_03000F30, 6, gStringVar4, xText, yText, 0xFF, 0x0); - CopyWindowToVram(gUnknown_03000F30, 3); + gBrailleWindowId = AddWindow(&winTemplate); + LoadUserWindowBorderGfx(gBrailleWindowId, 0x214, 0xE0); + DrawStdWindowFrame(gBrailleWindowId, 0); + PutWindowTilemap(gBrailleWindowId); + FillWindowPixelBuffer(gBrailleWindowId, PIXEL_FILL(1)); + AddTextPrinterParameterized(gBrailleWindowId, 6, gStringVar4, xText, yText, 0xFF, 0x0); + CopyWindowToVram(gBrailleWindowId, 3); return FALSE; } @@ -2254,8 +2254,8 @@ bool8 ScrCmd_setmonmetlocation(struct ScriptContext *ctx) void sub_809BDB4(void) { - ClearStdWindowAndFrame(gUnknown_03000F30, 1); - RemoveWindow(gUnknown_03000F30); + ClearStdWindowAndFrame(gBrailleWindowId, 1); + RemoveWindow(gBrailleWindowId); } bool8 ScrCmd_buffertrainerclassname(struct ScriptContext *ctx) -- cgit v1.2.3 From bac8974ce375bc464c6374cfeb4d74e4dc98a20a Mon Sep 17 00:00:00 2001 From: Tustin2121 Date: Sat, 17 Aug 2019 11:16:54 -0400 Subject: Added note about addvar The contest scripts actually use addvar to add a -1 to a variable instead of using subvar to subtract a positive number. This is fine in vanilla, where addvar script command does NOT support adding the value of a variable to another variable (like subvar supports), but should anyone want to change it, contests will be inexplicably broken. --- src/scrcmd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/scrcmd.c') diff --git a/src/scrcmd.c b/src/scrcmd.c index aa03181e6..e31be848a 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -466,6 +466,9 @@ bool8 ScrCmd_addvar(struct ScriptContext *ctx) { u16 *ptr = GetVarPointer(ScriptReadHalfword(ctx)); *ptr += ScriptReadHalfword(ctx); + // Note: addvar doesn't support adding from a variable in vanilla. If you were to + // add a VarGet() to the above, make sure you change the `addvar VAR_0x8006, 65535` + // in the contest scripts to `subvar VAR_0x8006, 1`, else contests will break. return FALSE; } -- cgit v1.2.3 From 23979c4d7d6f7b10107f94781add4c9d3b0c7e52 Mon Sep 17 00:00:00 2001 From: GriffinR <25753467+GriffinRichards@users.noreply.github.com> Date: Sun, 4 Aug 2019 04:22:19 -0400 Subject: initial documentation commit --- src/scrcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/scrcmd.c') diff --git a/src/scrcmd.c b/src/scrcmd.c index e31be848a..0326a56a4 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1633,7 +1633,7 @@ bool8 ScrCmd_buffercontesttype(struct ScriptContext *ctx) u8 stringVarIndex = ScriptReadByte(ctx); u16 index = VarGet(ScriptReadHalfword(ctx)); - sub_818E868(sScriptStringVars[stringVarIndex], index); + BufferContestName(sScriptStringVars[stringVarIndex], index); return FALSE; } -- cgit v1.2.3