-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Competitive-formatted parties #3545
Conversation
e5d1e2c
to
67dad07
Compare
Can this be done for facility pokémon too? |
There's this open issue for that #3484 |
67dad07
to
d159ba8
Compare
Added a Please let me rebase this before merging. EDIT: I have rebased. |
0f68efd
to
41cd4da
Compare
I'm parking this because it doesn't feel like it will be possible to please enough people to get it merged, and I'm not motivated to spend any more time on it. If somebody picks this back up:
|
6ad2aec
to
5bc3dc5
Compare
NOTE: In the context of #4169, we should set |
168ab1f
to
e8efb70
Compare
Ready for re-review. Promoted SDH's mugshots from being a An important thing that I'm unwilling to budge on is that by default (i.e. unless you use This feature is entirely optional,
Note that we run |
Addressed some of Alex's comments from Discord—specifically, IVs now default to 31s and levels now default to 100. You can opt-out of both of these defaults with |
$ python3 migration_scripts/convert_parties.py src/data/trainers.h src/data/trainer_parties.h src/data/npc_trainers.party Is available to convert Trainer Control-formatted trainers/parties into Competitive-formatted ones. Multiple '#include's can be placed in the trainer section of src/data.c to support spreading the trainers across multiple .party files. trainerproc does not interpret the values, leaving that job to the C compiler, so we use '#line' to associate those errors with the lines in the .party file(s). Because the columns don't make sense we use -fno-show-column and -fno-diagostics-show-caret. We might want to move gTrainers into its own file so that the rest of src/data.c isn't affected by those flags. Extensions (misfeatures, imo): - .party files are passed through cpp, so '#define's are supported, and so are '// ...' and '/* ... */' comments. - .party files also support writing, e.g. 'SPECIES_PIKACHU' instead of 'Pikachu'. This allows people to write constants explicitly if they like. Pragmas: - '#pragma trainerproc ivs explicit' requires an explicit 'IVs:' line rather than defaulting to 31s. - '#pragma trainerproc ivs <IVs>' changes the default IVs. - '#pragma trainerproc level explicit' requires an explicit 'Level:' line rather than defaulting to 100. - '#pragma trainerproc level <level>' changes the default level.
Added support for |
btw if/when this gets accepted, please squash the commits and just keep the message from the first one :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it'd be better that we add defines for aliases so that we assist the form name handling 🤔
Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com>
1.9.0 Changelog note: Warn users to not accept the incoming
src/data/trainers.h
/src/data/trainer_parties.h
/src/data/battle_partners.h
/src/data/partner_parties.h
changes and instead use the migration tool to keep their custom changes.This format predates Smogon, so "competitive-formatted parties" rather than "Smogon-formatted parties".
Introduces
trainerproc
, a tool which converts Competitive-formatted parties into Trainer Control-formatted parties.Also features
convert_party.py
which can be used aspython3 migration_scripts/convert_parties.py src/data/trainers.h src/data/trainer_parties.h src/data/trainers.party
to convert Trainer Control-formatted parties into Competitive-formatted parties. This is what I used to producesrc/data/trainers.party
.From Discord:
So ig the steps are:
# During the merge git checkout --ours -- src/data/trainers.h src/data/trainer_parties.h python3 migration_scripts/convert_parties.py src/data/trainers.h src/data/trainer_parties.h src/data/trainers.party
But please test this!
Before:
After:
Backwards compatibility
In order to let people keep using
src/data/trainers.h
andsrc/data/trainer_parties.h
I have introduced aCOMPETITIVE_PARTY_SYNTAX
config intoinclude/config.h
. If set toTRUE
(the default) we usesrc/data/trainers.party
. If set toFALSE
we usesrc/data/trainers.h
andsrc/data/trainer_parties.h
.To make this work, this branch keeps
src/data/trainers.h
andsrc/data/trainer_parties.h
even though if they're generated they shouldn't be part of the repository.Change Log:
In addition to the migration script described above:
#pragma trainerproc ivs explicit
— requires anIVs:
line for every Pokémon instead of defaulting to 31s.#pragma trainerproc ivs <IVs>
— changes the default IVs.#pragma trainerproc level explicit
— requires aLevel:
line for every Pokémon instead of defaulting to 100.#pragma trainerproc level <level>
— changes the default level.src/data/trainers.h
andsrc/data/trainer_parties.h
and then run the conversion script to update thesrc/data/trainers.party
,make
, then check in all three files. Alternatively don't run the conversion script and turn offCOMPETITIVE_PARTY_SYNTAX
ininclude/config.h
.//
or/* ... */
like in C.SPECIES_PIKACHU
instead ofPikachu
(etc etc) if you want.Future work
Hidden Power:
to set IVs appropriate for a particular Hidden Power type.