Commit Graph

91 Commits

Author SHA1 Message Date
haven1433
545b3b316e add names for common variables
temps and vars
2023-10-28 20:36:07 -05:00
haven1433
a82a022fdc use signed values for showpokepic 2023-10-28 17:01:01 -05:00
haven1433
4771532e09 add warp.center macro 2023-10-01 14:17:47 -05:00
haven1433
5dc5706c85 re-add warp changes
lost during merging
2023-10-01 14:12:59 -05:00
PhoenixBound
2dd69848d1
Document a few script commands (#196)
* Document a few script commands

* Undo change to initclock parameters

Variable numbers will display in hex even without a |h, so this change
was misguided.

---------

Co-authored-by: haven1433 <haven1433@gmail.com>
2023-10-01 14:09:20 -05:00
haven1433
8b46613dae improve map warp script commands 2023-09-30 17:42:27 -05:00
haven1433
26eae01cfa rename give.item to find.item
clear up confusion about an npc trying to give you an item vs finding an item on the ground
2023-09-06 21:58:01 -05:00
ShinyTillDawn
9ce2b6cd10
Updating script references (#191)
* Specified the formatting of some ptr<> fields.

I wasn't too sure about the "virtualbuffer" command, so I left it untouched.

* A few preliminary changes

Script command 0x10 should be "loadbyte" instead of "setbyte2," but based on the official description of the command, "setbyte" makes more sense over "loadbyte".

I kept the old names & comments for "jumpram" and such.

I also made the last 6 commands or so in battleAIScriptReference.txt exclusive to Emerald via the [BPEE] tag as those are only defined in Emerald, not the older games.

* Changed "resetvars" to "gettime."

* Replaced "playsong2" with "savesong".

* Switched commands 4D and 4E.

Both "checkdecoration" and "testdecoration" were in the wrong places. The pokéemerald decomp puts "checkdecor" at command 4D while "checkdecorspace" ("testdecoration") is positioned at command 4E.

* Corrected applymovement2's parameters.

Because the 2 bytes after the pointer in "applymovement2" actually correspond to map data, supplying invalid maps (thinking that they were bytes for the next few commands) could lead to bugs.

* Did the same treatment with "waitmovement2."

I also made sure that "bank" comes before "map" for both commands.

* Multiple changes

- Replaced more instances of x & y when they should be bank & map.
- Clarified what "spriteinvisible" and "spritevisible" do.

For commands like "hidesprite" and "showsprite", the decomps call them "removeobject" and "addobject," respectively. Those deal with flags while "spritevisible" and "spriteinvisible" deal with some other attribute.

* Added more info to the "repeattrainerbattle" cmd.

* Clarified the description for "waitkeypress".

* "showbox" and "clearbox" are a nop in Emerald.

* Added a description for "preparemsg2."

* Adjusted the descs of "cry" and "sethealingplace."

* Updated some descriptions.

Commands B1 & B2 are actually nops in Emerald, not RS. Either way, they were unused in RS. The "addelevmenuitem" command actually takes in 4 parameters.

* Added descriptions for "hidecoins" & "updatecoins"

* Added more descriptions.

* Added descriptions for commands D8 and D9.

* Finishing touches
2023-08-22 23:40:25 -05:00
haven1433
067bdb0883 setfarbyte bugfix 2023-08-18 20:42:21 -05:00
haven1433
446f9b4502 only allow msgbox.instant.* macros for Emerald (relies on preparemsg3) 2023-08-13 22:12:14 -05:00
ShinyTillDawn
5f1123a230
Added the "scripts.battle.badge.obey" category. (#178)
* Added the "scripts.battle.badge.obey" category.

Credit to Axcellerator for finding these offsets.

For the life of me, I could not link the flags table to the other 4 new anchors.

Since all of these are part of a THUMB routine, nothing points to these individual anchors, so I had to put them here.

The 0badges to 6badges anchors link to each other, so that's why 3 of them do not have a 1 after their [level.] formatting.

* Fixed a typo from a merge-fix commit.

* Added obedience anchors for FireRed/LeafGreen 1.0.

I tested these, and they seem to work and load correctly.

* Added obedience anchors for FireRed/LeafGreen 1.1.

* Added obedience anchors for Ruby & Sapphire.

I tested it, and these 5 additions work universally for AXVE0, AXVE1, AXPE0, and AXPE1.
2023-08-02 23:23:49 -05:00
haven1433
2db6f890e9 update fadescreen 2023-08-02 23:10:35 -05:00
haven1433
23a891a5eb improve documentation for msgbox.npc 2023-07-31 20:52:32 -05:00
haven1433
6bdc9e801c fixes from merge 2023-07-20 07:04:47 -05:00
haven1433
9930f21f9e Merge branch 'master' of https://github.com/haven1433/HexManiacAdvance 2023-07-20 07:00:07 -05:00
ShinyTillDawn
34ea580f12
Made "buffer1" through "buffer3" valid arguments. (#176)
"buffer1" is associated with 0 for a parameter in a command like "buffernumber." That misalignment by 1 can cause some confusion, so this change will allow the word "buffer1" to be used instead of 0 for such commands to line up with the \\ 02 text macro ([buffer1]) that would be used afterwards.
2023-07-20 06:45:56 -05:00
haven1433
c76acd2536 improve comments 2023-07-19 21:06:04 -05:00
haven1433
435a36a535 Add human-readable documentation for scripts 2023-07-14 06:44:03 -05:00
haven1433
1fc1566d4c add comment 2023-07-09 20:23:47 -05:00
haven1433
daea25bd4e make it possible to add comments to list elements
right now the comments are only shown by the script editor. But they could be added to other things too, like maybe wild pokemon rates?
2023-07-07 08:58:16 -05:00
haven1433
6fc0f568dc Basic implementation for flag/vars show&tell
Currently hidden
2023-06-29 19:31:08 -05:00
haven1433
59fc5fc648 add multichoicegrid alias for multichoice3 2023-06-26 22:23:14 -05:00
haven1433
67506e5828 add if macros for gender/male/female goto/call 2023-06-23 20:35:39 -05:00
haven1433
e10dfb00ab fix scriptRef bugs
* fix documentation for checktrainerflag
* fix typo in if yes/no goto/call
2023-06-12 23:33:06 -05:00
haven1433
32c5c558e5 code cleanup
* Remove the `compact` macro, since it's just a combination of 3 macros that each make sense by themselves. The goal for macros is to put them in situations where you wouldn't ever want the command by itself.
* Move the `if` macros down to live with the other `if` macros.
2023-06-05 22:36:14 -05:00
ShinyTillDawn
08cf3a1015
Revamping the Yes/No Message Box (#165)
* The `(` symbol has been moved.

This was supposed to go in the previous pull request, but I was too late...

* Added another `msgbox.yesno` macro.

No testing has been done yet.

* Added if.yes & if.no macroes.

Caution: These macroes will show up unintentionally if you're using commands other than msgbox.yesno that involve comparing the last result variable (800D) with the literal number 1.

* Fixed the `ptr` pointer format.

my bad
2023-06-05 22:28:05 -05:00
ShinyTillDawn
6eb79dac33
New trainerbattle macros (#162)
* Configured the macroes.

* Added comments to the macros.

They seem all jumbled up.

* Added corresponding cmds. for trainerbattle 0−8.

Testing needs to be done to make sure they work atm.

* Updated trainerbattle 09 & 0C.

though trainerbattle 09 will need another change.

* Added trainerbattle 09 types based on a bit field.

Right-most bit: Whether or not the player can lose

Second-right-most bit: Tutorial battle w/ Professor Oak

Based on the combinations of bits, I added more variants to FRLG's `trainerbattle 09` command.

* LocalIDs are correctly filled in as 1/2-words now.

My bad

---------

Co-authored-by: haven1433 <haven1433@gmail.com>
2023-06-05 22:22:34 -05:00
ShinyTillDawn
d1e50a10b1
Added a macro for multichoice's allowCancel field. (#157)
* Added a macro for multichoice's allowCancel field.

0 = the game does not ignore B presses (OK to cancel out)
1 = the game ignores B presses (forbid canceling out)

* Clarified by adding "Cancel" to each option.
2023-06-03 10:30:45 -05:00
ShinyTillDawn
b2ecec72e5
Added a "movenpc" command macro. (#159)
* Added "movenpc" command.

The exact things will be subj to change.

* Fixed "move.npc" and added "move.player."

I'll need to test these soon.

* Switched the order of 2 command macroes.

Switched the order of move.player and move.npc.

* Fixed the move.player command macro.

I can't specify base-10 numbers to hard code, apparently.

* Added the "move.camera" macro.

* Each new movement macro has 2 lines of flavor text
2023-06-02 22:14:10 -05:00
ShinyTillDawn
aa9563afaa
Updated reference info in "scriptReference.txt". (#154) 2023-05-07 10:17:26 -05:00
haven1433
3c6930b527 small fixes
* fadescreen should use screenfades list
* map object graphics should use overworld sprites enum (allows finding events from the overworld sprites table)
* change field name from 'unused' to 'padding' for final part of object event data
2023-05-06 16:33:37 -05:00
TheDiamondMiner
564b298fc2
Updated Scriptreference.txt for the new macros (#137)
* Updated scriptreference

* Amended changes
2023-03-30 09:55:56 -05:00
haven1433
fc05cd58e6 add comments explaining base commands for macros 2023-03-20 22:10:00 -05:00
ShinyTillDawn
aacd573bf6
More scriptReference.txt changes (#131)
* Correctly fixed the domains of script commands.

According to the 3 decomps' "script_cmd_table.inc" file, Ruby/Sapphire's last command is at index C5 while FireRed/LeafGreen's last command is at index D4. Thus, I updated the file so that valid commands would only show up if you're editing a game with which said commands would be valid.
ex. preparemsg3 no longer shows up as a valid command in FR/LG.

* Found out the parameter for fadescreen3.

Thank you decomps!

I'm not sure if the "mode.screenfades" parameter is the same for the "fadescreen" command.

* Updated "trainerbattle" & other scripts' comments.

Added some comments to clarify some unknowns in commands 5E, 5F, and 65.

I also fixed some comments and unknown pointers in the trainer battle commands.

* More minor comment fixes.

I mean the word "not" in the comments for commands 4D & 4E. The commands are technically not "nop"s in the code, but the edit to 0x800D is commented out.

* Clarified warp descriptions & other commands.

- Warp commands have more descriptive comments.
- Changed FRLG's description for "nop2C."
- Added another way to fill in the "condition" parameter for "gotostdif" and "callstdif" to make it more in line with "if1" and "if2."
2023-03-16 20:55:30 -05:00
ShinyTillDawn
49d207985a
Fixed preparemsg isotopes; added a desc to warp8 (#123)
Somehow, I did not catch these before the new version came out.
2023-03-11 19:39:02 -06:00
ShinyTillDawn
543a57ec25
Updated more scriptReference.txt parameters (#120)
I primarily focused on D2 setcatchlocation so that its location parameter allowed the user to type in map names. I found more commands that needed similar treatments.
2023-03-09 21:57:52 -06:00
ShinyTillDawn
c36d89e0f2
Updated the move field for 2 commands (#118)
You can use move names for the move field in both 'bufferattack' and 'checkattack' now.
2023-03-08 22:33:02 -06:00
ShinyTillDawn
2b4866b9f5
Another scriptReference edit (#114)
* Another scriptReference edit

Updated some incorrect/missing commands in script reference, adjusted the Address width, and implemented the directions macro for the spriteface command.

* Marked lines 270 and 273 as [BPEE].
2023-03-07 16:08:36 -06:00
ShinyTillDawn
a31ec6b0a8
Update scriptReference.txt (#112) 2023-03-05 22:31:03 -06:00
haven1433
dd9cf7070d improve if macros / trainer flags
* replace cleartrainerflag/settrainerflag with defeatedtrainer/readytrainer
* update `if` macros to include both goto and call forms, and both positive checks and negative checks for trainers/flags
2023-03-02 19:48:52 -06:00
haven1433
7e6dc34302 use decorations instead of mart for pokemart2
And fix name to decorationmart
2023-03-02 19:48:30 -06:00
haven1433
a679a006db setfarbyte uses RAM addresses 2023-03-01 22:25:34 -06:00
haven1433
4a3cbe15e2 loadbytefrompointer uses RAM addresses 2023-03-01 22:25:23 -06:00
haven1433
acb3629541 copybyte should use 4-byte hex, not pointers 2023-03-01 22:05:14 -06:00
haven1433
198cc42859 fix writebyteoffset parameters 2023-02-11 22:44:21 -06:00
haven1433
820173f3f1 settrainerflag needs to use trainer names 2023-02-02 07:44:46 -06:00
haven1433
9205f7b360 give.item is better than take.item
* take.item may be confusing, making the user think an item is being removed
* give.item is closer to the XSE name
2023-02-01 21:35:10 -06:00
haven1433
649a4f5f6d replace give.item with take.item and npc.item
npc's also want to give items, but without making the NPC disappear.
2023-02-01 21:26:38 -06:00
haven1433
44d841ad6c checktrainerflag / cleartrainerflag argument update 2023-01-30 23:09:23 -06:00
haven1433
6ac5c89dfb add if.flagset macro 2023-01-24 20:16:37 -06:00