Commit Graph

852 Commits

Author SHA1 Message Date
haven1433
53b4ed35e0 allow scripts to see scripts before they start 2023-10-01 12:50:07 -05:00
haven1433
c12d15bb04 scripts should continue formatting after an early end 2023-10-01 12:12:46 -05:00
haven1433
5dc7eaecda refactor
ScriptParser.cs is getting too long
* move ScriptLine and related types to their own file
* move ScriptArg and related types to their own file
2023-10-01 12:12:10 -05:00
haven1433
abc23f6ea2 wild pokemon rate comments for pokemon in the grass 2023-10-01 09:52:39 -05:00
haven1433
8a7cd6746e add puzzle tables for fortree / trickhouse
R/S addresses later if anyone cares
2023-09-30 18:53:02 -05:00
haven1433
8b46613dae improve map warp script commands 2023-09-30 17:42:27 -05:00
haven1433
55b3cfbbd4 allow value offsets for non-enum in scripts 2023-09-30 17:42:07 -05:00
haven1433
c50c42cdcd split tokens on tabs 2023-09-30 16:53:22 -05:00
haven1433
b37acb160c add autocomplete to script editor
* Autocomplete Overlay supports TextEditor
* Add Overlay to CodyBody's ControlTemplate
* Don't show help tip when autocomplete is showing
* 3 categories of autocomplete:
-> streams
-> arguments
-> commands
2023-09-30 16:49:12 -05:00
haven1433
3161bac7e4 better error when names contain quotes 2023-09-30 12:58:46 -05:00
haven1433
39d3c339dc watch for errors in script templates
fix error in tutor template
2023-09-30 12:47:17 -05:00
haven1433
d45bf408f1 guard against crash in content help for scripts 2023-09-30 12:32:31 -05:00
haven1433
7779df402e Merge branch 'master' of https://github.com/haven1433/HexManiacAdvance 2023-09-09 22:37:46 -05:00
ShinyTillDawn
7007e016cc
Added an eor alias. (#194)
HMA now accepts `eor r1, r0, r1` as a valid alternative of `eor r1, r0`.
2023-09-09 22:37:30 -05:00
haven1433
5a4e49d0fb simplify message in script help -> command usage 2023-09-07 21:15:02 -05:00
haven1433
e04da2f899 documentation improvements
pull examples from actual code, semi-randomly. This takes a lot longer, but produces much better documentation, including realistic values and streams.
2023-09-07 20:58:00 -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
haven1433
27de9dc88b in a script, error if the user types something that doesn't parse when a number is expected 2023-09-06 21:55:51 -05:00
haven1433
dfb08d9b16 web-links don't work for headings within details 2023-08-28 06:40:08 -05:00
haven1433
661c7f2047 update doc markdown file 2023-08-27 19:57:06 -05:00
haven1433
5e5060f9ac prefer unique section names when multiple CodeBody objects are available 2023-08-24 21:07:03 -05:00
haven1433
0d2c8968ea first pass at adding documentation to home menu
documentation comes from multiple sources.
* It's assumed that there's a List called specials. Those specials are used to create documentation.scripting.overworld.reference.specials.*
* It's assumed that there's commands in scriptReference. Those commands are used to create documentation.scripting.overworld.reference.commands.*
* Content from docRefreence.txt is read to create additional documention links that open web pages
2023-08-24 21:06:29 -05:00
haven1433
2940174382 improve Decap for FR 2023-08-23 23:21:01 -05:00
haven1433
f9937a0d9b add safari end script 2023-08-23 18:59:18 -05:00
haven1433
bdd7aa344d remove clear macro
it needs to have an argument (see 47AA18 in FireRed 1.1) but text macros don't support arguments.
2023-08-23 07:38:52 -05:00
haven1433
ca41b67dd8 don't include keywords for other games 2023-08-23 07:33:18 -05:00
haven1433
8432d1d1e2 add namescreen display and data 2023-08-23 07:23:45 -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
554c0d1dd5 improve sorting order for elements
`IndexOfPartial` now uses improved sort order.
Improved sort order now prefers shorter tokens over longer tokens (PIDGEOT before PIDGEOTTO)
GetBestOptions now uses SortOptions
TrainerPokemonTeamRun now uses SortOptions for autocomplete
Update tests based on new expected sort orders
2023-08-22 23:23:25 -05:00
haven1433
1935411543 only allow a 2/3 byte gap if we're joining data.
Scripts still are limited to only a 1-byte gap.
2023-08-21 19:58:15 -05:00
haven1433
bf43d8bc40 ExtractLocalLabels should only consider commands that match the current game 2023-08-21 19:56:53 -05:00
haven1433
4d2675f564 support completion tips for mart content in scripts 2023-08-20 22:14:07 -05:00
haven1433
63fb9b3ac6 add mul rA, rA, rB alias for mul rA, rB 2023-08-19 07:40:02 -05:00
haven1433
ac1f6dedc5 compile error on invalid command 2023-08-18 21:20:37 -05:00
haven1433
068695beaf adjust readable script reference 2023-08-18 20:53:57 -05:00
haven1433
9fbd269958 Update readable scriptReference
* Include example usage for commands, created using random options (fixed seed)
* Include example usage of specials, using special2 with the most common var based on usage in whatever tabs are loaded.
* Use collapsible sections for details of both script commands and specials, so it's easier to browse.
2023-08-18 20:46:17 -05:00
haven1433
1b6ee6d639 specials documentation update 2023-08-18 20:42:43 -05:00
haven1433
067bdb0883 setfarbyte bugfix 2023-08-18 20:42:21 -05:00
haven1433
e3b1dde092 formatting fix 2023-08-18 20:42:03 -05:00
haven1433
cc66577c01 implement autocomplete for script commands
when typing a script command, when you press space, it'll autocomplete to the 'best' match. So if you forget a period or capital letter, it'll still work the way you expect.
2023-08-16 22:25:27 -05:00
haven1433
924e7008ce move sprites.elevation table higher in the tool to put it next to coordinates.front 2023-08-15 20:40:18 -05:00
haven1433
857d6f115f add offset pointers for trainer stats
there are pointers directly to the trainer names
there's a pointer directly to the trainer items
2023-08-14 22:43:54 -05:00
haven1433
6af14ce89b update script reference 2023-08-13 23:39:46 -05:00
haven1433
2a57fb4c28 pokemart data needs to be 4-byte aligned
When creating pokemart data using <auto>, make sure the resulting data is 4-byte aligned.
2023-08-13 23:16:49 -05:00
haven1433
b8aa9ee781 smarter line splitting during scripts 2023-08-13 22:28:56 -05:00
haven1433
446f9b4502 only allow msgbox.instant.* macros for Emerald (relies on preparemsg3) 2023-08-13 22:12:14 -05:00
haven1433
d32c0c2e1d count empty lines when adding error squiggles 2023-08-13 11:43:42 -05:00
haven1433
1a8f2732e2 Update NoNamespaceHasMoreThanNineElements test / names
* Check all namespaces, not just final namespaces.
* Allow 16 elements in the top-level namespaces, and 9 in lower levels.
* Include some exemptions for categories that are already too large, but would be brittle to fix.
* Rename tables/images to get things back under the limit.
* Upgrade tests to provide better failure information
2023-08-11 20:26:50 -05:00
haven1433
83dbe06e12 allow elevation to be 0 through 10 instead of 0 through 9 2023-08-10 22:43:07 -05:00
haven1433
8dad38be4a fix nested table format code
* look for matching braces
* expect whitespace
* add sanity checks to `tpt` format
* add formatting for pokemon teams
2023-08-10 21:11:40 -05:00