This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Adds a custom 'agbl' (AGB Loop end) chunk to looped .wav files. | |
| This chunk specifies the exact loop-end point to handle the off-by-one error | |
| in the original game, where the loop-end should be one sample earlier than | |
| the total number of samples in the file. | |
| """ | |
| import struct |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Converts .aif or .bin (GBA format) files to .wav files. | |
| Can also read .aif files directly and convert them to .wav. | |
| """ | |
| import struct | |
| import sys | |
| import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This script will apply the same changes to your project as this PR: https://github.com/pret/pokeemerald/pull/1755/files | |
| # You can run this before or after merging with upstream pret, so that your project's custom code and data are updated appropriately. | |
| # To run this script: | |
| # - Place this file in the root of your project. For example, pokeemearld/map_constants_update.py | |
| # - Run "python map_constants_update.py" | |
| import re | |
| import glob | |
| # 1. In map.json files, convert "dest_warp_id" to string value instead of integer. 127 becomes "WARP_ID_DYNAMIC". 126 becomes "WARP_ID_SECRET_BASE." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a hacky thrown-together script that procedurally | |
| # generates Gen-3 Pokemon region map images. I intend to build | |
| # an online tool to facilitate this, but this is the first | |
| # proof of concept. | |
| # | |
| # Requires the opensimplix, Pillow, and scikit-learn: | |
| # pip install opensimplex | |
| # pip install Pillow | |
| # pip install -U scikit-learn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "encoding/binary" | |
| "image" | |
| "image/color" | |
| "image/draw" | |
| "image/png" | |
| "io/ioutil" | |
| "os" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ( | |
| copyByte = iota | |
| copyBackReference | |
| copyPairs | |
| ) | |
| type command struct { | |
| action int | |
| length int | |
| distance int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "io/ioutil" | |
| "os" | |
| "path/filepath" | |
| "strings" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| script BugContestOfficer_EnterContest | |
| { | |
| if (var(VAR_BUG_CONTEST_PRIZE) != ITEM_NONE) { | |
| bufferitemname(0, VAR_BUG_CONTEST_PRIZE) | |
| msgbox(BugContestOfficer_Text_GivePrizeItem) | |
| giveitem_std(VAR_BUG_CONTEST_PRIZE) | |
| if (var(VAR_RESULT)) { | |
| setvar(VAR_BUG_CONTEST_PRIZE, ITEM_NONE) | |
| } else { | |
| msgbox(BugContestOfficer_Text_NoRoomInBag) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pokemap2json.py | |
| # This script will process a pokeemerald project and generate the wild encounters JSON data for it. | |
| # It creates: | |
| # src/data/wild_encounters.json | |
| # | |
| # In order to convert your project's existing data from src/data/wild_encounters.h: | |
| # 1. Merge pret/master. | |
| # 2. Run wildencounters2json.py on your project. | |
| # Example: "python wildencounters2json.py path/to/my/project" | |
| # 3. Commit the src/data/wild_encounters.json file it creates. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This script will convert some map json fields from integers to strings. | |
| # Place this script in data/maps directory, and run it. | |
| # python 3 version of the script | |
| import re | |
| import glob | |
| for filepath in glob.iglob('./**/map.json', recursive=True): | |
| with open(filepath) as file: |
NewerOlder