FlagBrew / PKSM-Scripts

General purpose scripts to use with PKSM.
58 stars 14 forks source link

Script Updating: Merge Groups of Simple Scripts into picoC scripts #38

Open GriffinG1 opened 2 years ago

GriffinG1 commented 2 years ago

List of simple scripts (.txt) that would be better suited being merged into picoC scripts per section.

Please Note!!!

This list is not yet complete, I will be continuing to work on it for a bit. My eyes are hurting from reading through the script list. I am simply posting it now in case anyone would like to put forth feedback on what's on it so far. Please do not suggest scripts to add to this list until I have finished updating it.

Scripts to Merge

Further Ongoing Ideas (Behind the scenes)

Issue Edit Changelog

SpiredMoth commented 2 years ago

Pokedex Scripts: While I agree that merging all these would be good, I have no idea how we could easily do so with the Regional scripts due to the scattered nature of National dex numbers of species in them. BW1 is the only easy one since its Regional dex is only the new Gen 5 stuff (Victini and beyond).

Daycare Scripts: I tried merging these into a single picoC script a while back, but ran into trouble recognizing the contents of the Daycare slots so I abandoned it until I could research why. I don't remember how functional this code is, but here is the WIP script

GriffinG1 commented 2 years ago

I have no idea how we could easily do so with the Regional scripts due to the scattered nature of National dex numbers of species in them.

Depending on if picoC has any array serialization support (I'm not sure, cc @piepie62) we could either have files stored server side that get received same as LLD and your ideas for injecting from yesterday, or possibly have them pulled with a GET request from an API endpoint (cc @FM1337 for that)?

In terms of the arrays themselves, going gen 4 and up the sizes are: DP: 151 Pt: 210 HGSS: 256 BW: 156 B2W2: 301 (this and BW is increased by one due to Victini being 000) XY: 153/153/151 (Central/Coastal/Mountain) ORAS: 211 SM: 302 (Should this be split by island? Dunno) USUM: 403 (again, split by island?)

To make these arrays, if we can make a key-pair set of species-NatDex number using coreAPI then it would be a simple matter of just feeding in a list of each RegDex's pokemon to a script that would check against those key-pairs then return a list containing the NatDex numbers for all of the pokemon for that RegDex.

SNBeast commented 2 years ago

For client-side processing, I think you can do what you want with fetch_web_content and the json functions. Fetch a json file that is just an array listing every regional dex entry for the generation as the Species number, create the json object, check that it is valid and an array, get the array size, iterate through the array elements, check if it is an int and get int, and set the seen/caught flag.

The flaw with this is that the API doesn't have a function for setting pokedex flags, but that's easy to fix by changing the API.

Actually PKSM-Core doesn't let you reset Pokedex flags or just let you use species number.

piepie62 commented 2 years ago

Dex flags are annoying to set because they depend on species, form, gender, and shiny value, which is why it currently requires a full PKX. Theoretically, an API that takes those four things could be added, but just using species is not really viable.

SpiredMoth commented 2 years ago

I just updated the daycare script's code to match the current script API so it should now run on PKSM v9.2.0 but I haven't tested if the problems I was experiencing before (bizarre species value when trying to verify if slots are occupied) still happens

SNBeast commented 2 years ago

Dex flags are annoying to set because they depend on species, form, gender, and shiny value, which is why it currently requires a full PKX. Theoretically, an API that takes those four things could be added, but just using species is not really viable.

Looking at for example Sav7::dex there's actually even more. The simplest way to implement in API would be to just add a function for registering a PKX, and have the script writer handle what is desired and needed for each generation by retrieving a default PKX for the generation and modifying its species and etc. The JSON fetched as described above would get more complicated.

There's also doing that, but instead of a new API function you just stash whatever is in the first slot in the first box, use sav_inject_pkx, which writes the dex entry, and then restore whatever was there previously at the end.

SpiredMoth commented 1 year ago

DPPt/HGSS Berry: Should be opened up to all berry trees, which requires more documentation (either provided or researched).

DPPt/HGSS Lotto ID: This could/should be expanded to support all generations with ID-based Lotto (probably with research). Ideally this would give the user multiple winning ID options, such as:

DPPt Level Man: There's probably more daily NPCs that could be lumped into a single script with this.

Illegal Scripts: I think they are too varied to all be combined into a single picoC script. Illegal item injection could be workable, with lists of illegal items per pouch+game/generation. Illegal dex scripts are unlikely to be easily combined. Dex manipulation is annoying enough now without trying to factor in legality (was this species/form/shiny released?).