Commit Graph

717 Commits

Author SHA1 Message Date
haven1433
99d5bc52d8 Merge branch 'master' of https://github.com/haven1433/HexManiacAdvance 2023-03-31 21:11:05 -05:00
haven1433
380af0d051 tileset -> lzt4 rather than sprite
this means you can't import it, but you don't want to, it's just a bunch of tiles.
2023-03-30 20:05:10 -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
5ebf0c7925 update layouts when loading map editor
also include formats in layout table
2023-03-28 21:05:18 -05:00
haven1433
d396300c02 update current/available blockset addresses when repointing blocksets
also fix possible race condition when refreshing border render while drawing the map
also fix condition where writing script data content formats shouldn't write empty runs if the token doesn't allow changes.
2023-03-22 22:10:45 -05:00
haven1433
e666861f1a improve freespace address interactions for scripts
if you use a freespace address, the script should introduce a new blank stream for you to use. This didn't work correctly for marts, now it does.
2023-03-21 20:44:40 -05:00
haven1433
11db60e5d2 use number section headers rather than addresses as section headers
* better for experts because they can more easily parse a handful of section headers compared to random hex addresses
* Better for new users because it helps them learn that they can use whatever names they want for the headers of scripts and for pointers.
2023-03-21 19:59:01 -05:00
haven1433
1f640cfdea Merge branch 'master' of https://github.com/haven1433/HexManiacAdvance 2023-03-20 22:10:01 -05:00
haven1433
fc05cd58e6 add comments explaining base commands for macros 2023-03-20 22:10:00 -05:00
haven1433
7c357f00fd don't support <auto> when reading/writing script addresses, only data addresses 2023-03-20 22:09:25 -05:00
haven1433
f21f3c0e0e auto pointers should get syntax highlighting 2023-03-18 21:47:44 -05:00
haven1433
6ef8253e02 fix cursor when resolving ?????? addresses
doing <??????> auto-included a new {} block, which is cool. But that block needs to not be included when calculating the new cursor position, because the cursor position should remain _before_ the new {}, so it's still on the same line in case you're writing `trainerbattle` or something with multiple pointers in the line.
2023-03-18 21:47:00 -05:00
ShinyTillDawn
b14baacd73
Changed which NPC facing option we shouldn't use. (#133)
* Changed which NPC facing option we shouldn't use.

The movement behavior right below "FaceRight" is actually the one that confuses people as it used to be called "Look Down" in AdvanceMap. That one causes weird stuff to happen after a battle while the first movement option is now correctly labeled "No Movement."

* Reverted the CausesGlitches change.
2023-03-18 11:31:34 -05:00
haven1433
2bef8d62f0 write updated run after deserializing 2023-03-17 22:04:30 -05:00
haven1433
d547f88ebc insert end token when writing a movement stream
note that this could be dangerous, since we're writing an end token to an arbitrary address that is still being decided on. A couple things mitigate this problem:
* the user can use <auto> pointers in scripts
* addresses won't be checked/used unless the user has both an open < and a close >.
2023-03-17 15:06:21 -05:00
haven1433
542ac1ca86 auto-include closing } after inserting a { 2023-03-17 14:27:23 -05:00
ShinyTillDawn
80b4b17bc8
Added rematch tables for Emerald and RS (#132)
They're separate because Ruby and Sapphire have fewer rematchable trainers than Emerald.
2023-03-16 20:57:16 -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
6d3cd3aef9
Added a [[List]] for move particle names. (#130)
* Added a [[List]] for move particle names.

I indicated which ones are unused.

* Added a missing apostrophe

silly me
2023-03-13 15:36:37 -05:00
ShinyTillDawn
1d232469e1
Incorporating an animations options table for back sprites causes some compromises. (Attempt 2) (#129)
* Adjusted Pokémon animation options.

- Renamed "...animations.options" to "...animations.options.front" (even though those animation codes are not exclusive to front sprite animations)
- Added "...animations.options.back" since there's a smaller table for Pokémon's back sprite animations.

The words "extreme," "medium," and "mild" are used (in this context) to describe the differences in animations used for each back animation sprite slot. The Pokémon's nature determines which of the three to use.

* Added the nature mod table for Pokémon back anims.

I also updated the formatting for "graphics.pokemon.animations.back."
2023-03-13 13:46:06 -05:00
ShinyTillDawn
9428cd5778
Fixed numbers misplacement for OW Table Constant (#125)
Sorry for breaking the OW sprites table ;-;

I genuinely didn't see that mixup!
2023-03-12 12:50:21 -05:00
ShinyTillDawn
e4daf4c234
Table Reference typos got corrected. (#126)
I think the second typo would only get fixed if loading a new ROM for the first time.
2023-03-12 11:02:07 -05:00
ShinyTillDawn
78faf673b4
Added aliases for the three buffer half-words: \\02, \\03, and \\04. (#124)
* Added buffer macros

These can be used instead of \\02, \\03, and \\04 in the Text tool.

* Buffers now don't have spaces in them.

* Fixed an alignment error.
2023-03-11 19:55:40 -06: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
haven1433
0e518c4c37
Get all tests passing (#122)
* submit failing tests

* Grab failing trainer test from remote branch (#121)

* Updated flash constants

* Fixed flash constant locations

I originally supplied anchor references, not locations of the constants themselves. That's been fixed. Also, I changed the field name for flash.radius, so it's hopefully clearer.

* Fixed some other pointer issues with RAM addresses in script commands

RAM addresses can't be encased in <> nicely. Some commands still needed their RAM-address pointers to have the ::|h formatting instead.

* Fixing some parameter formats in the script reference file.

There were a few other commands that needed RAM-address parameters set to their correct format so that typing "2024284" doesn't auto format to 0xA024284, etc.

* update script reference (again)

* Added a failing test for duplicating trainer data

Bug report in query: https://discord.com/channels/538022037718040588/538022038376415234/1083215729177931877

---------

Co-authored-by: ShinyTillDawn <80070404+ShinyTillDawn@users.noreply.github.com>

* Fix test

ExportTilesetWithPalette2_EditTileset_ImportTilesetWithPalette2_DataMatches
-> fix formatting in LzSpriteRun
-> fix overflow error in SpriteRun
-> fix default palette detection in SpriteTool
-> improve test so it gives better failure info

* fix trainer duplication assert

fix test name / remove unneeded comments
handle Trainer team runs specially
update assertion error message

* Improve pointer error logic

Pointers are allowed to point into the middle of an existing run. Such a pointer is an error, but is not a metadata inconsistency. Update metadata checking for new logic. Update pointer logic to display pointer as an error.

* improve handling of `auto`

allow <auto> to be used if there's a one-byte gap

* improve interruptingSourceRun logic

an interrupting table is not always valid.
It's only valid if the source is at an index that would make it a pointer.

* don't clear bytes, clear anchors

If you have a custom anchor name in the middle of a script and then edit the script, that custom anchor name will be lost. But anything pointing to it will still point to it.

---------

Co-authored-by: ShinyTillDawn <80070404+ShinyTillDawn@users.noreply.github.com>
2023-03-10 21:40:55 -06:00
ShinyTillDawn
32ae955c3b
Added the constant related to OW table limiters. (#119)
* Added the constant related to OW table limiters.

By default, it's 151 (0x97) in the Kanto games.

* Updated the OW table for FRLG.

The length is now controlled by a newly added constant.
2023-03-10 18:08:30 -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
haven1433
1c4f842dbf Merge branch 'master' of https://github.com/haven1433/HexManiacAdvance 2023-03-07 19:54:07 -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
haven1433
420f0dd1f9 Merge branch 'master' of https://github.com/haven1433/HexManiacAdvance 2023-03-07 08:42:13 -06:00
haven1433
4959d8f8ca don't auto-format script pointers in edge cases
* points to itself? Don't add the format
* points into existing data? Don't add the format
2023-03-07 07:29:37 -06:00
ShinyTillDawn
93395800eb
Added calculated Base Stat Total ''field'' (#115)
Similar to the prize money field in the trainer table, I added a field to the Pokémon stats table for a Pokémon's base stat total.
(Requested by Dweebio The Rom Hacker)
2023-03-07 02:23:22 -06:00
haven1433
36706bc740 remove bad default hashes 2023-03-05 22:40:28 -06:00
haven1433
c9ec9d3379 Merge branch 'master' of https://github.com/haven1433/HexManiacAdvance 2023-03-05 22:39:00 -06:00
ShinyTillDawn
f108a05f96
Implemented 8 feature requests or so (#113)
* Implemented 8 feature requests or so

- fixing money cap description
- updating trainer AI script command parameters so names of types/moves can be used
- updated various font anchors
- made lists for trainer AI scripts
- added floor names for FRLG

* Fixed ability field oversight

IDK how I had the ability field use the type field.
2023-03-05 22:37:16 -06:00
ShinyTillDawn
a31ec6b0a8
Update scriptReference.txt (#112) 2023-03-05 22:31:03 -06:00
haven1433
ccbdca51f3 support |z suffix for arguments in script reference files 2023-03-05 21:39:41 -06:00
haven1433
10f177154c fix broken tests 2023-03-04 22:00:44 -06:00
haven1433
43542dcf17 don't create orphans while no-edit formatting a script
When scripts get merged together, some inner-scripts no longer appear to be real scripts. These were showing up as orphans when the scripts get formatted, since that causes scripts to get merged. But the pointers are still there, so they're not actually orphans.

Fix the orphan-naming logic so that it won't name things as orphans if they're inner scripts that still have pointers
2023-03-04 21:33:49 -06:00
haven1433
3fdb3a8028 improve caching for improved performance
don't re-calculate the length of scripts if nothing has changed
2023-03-03 22:46:17 -06:00
haven1433
8896946db2 ai script performance updates
ai script children should appear as ai scripts
editing an AI script shouldn't make a bunch of orphans
introduce a light caching system for noticing when scripts don't need to be loaded again.
script edits that don't change any compiled bytes should be capable of skipping the metadata update in situations where the metadata is already correct
2023-03-03 22:10:49 -06:00
haven1433
944806e2ad fixing R/S 1.1 addresses for data.pokemon.natures.stats 2023-03-02 19:58:29 -06:00
haven1433
715c163de6 nature stats for all the games 2023-03-02 19:52:15 -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
f3d986882e Merge branch 'master' of https://github.com/haven1433/HexManiacAdvance 2023-03-01 06:54:56 -06:00