PKSM-Scripts icon indicating copy to clipboard operation
PKSM-Scripts copied to clipboard

Script Updating: Merge Groups of Simple Scripts into picoC scripts

Open GriffinG1 opened this issue 2 years ago • 7 comments

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

  • Encounter reset scripts

    • This should be done as one picoC script per generation due to how many resettable encounters there are. Incl Kanto birds for XY
    • Gen 4: DP Pt HGSS
    • Gen 5: BW B2W2
    • Gen 6: XY ORAS
    • Gen 7: SM USUM
  • Black 2/White 2 Hidden Grotto scripts

    • List here.
  • Pokedex scripts

    • This should merge all seen/caught dex scripts into one file. Ideal set up would be:
      • Generation
        • Game Set
          • Regional - Seen
          • Regional - Owned
          • National - Seen
          • National - Owned
          • Illegal - Full Dex (Complete) # Please note: This script is legal in generation 4 due to lack of shiny locks.
          • Alternate Language Entries
  • Clear Mystery Gift Data

    • There is one of these per game set (including Platinum)
  • Ultra Sun/Ultra Moon and Sun/Moon Plaza scripts

    • Lists here and here.
  • Various Battle Facility scripts

    • This should be one script per generation.
    • Possibly include Set Max Battle Points in these scripts? May be better to have an overall 'Set Max x' script instead that also handles stuff like Pokedollars and other non-item based values?
    • SM, USUM, and XY all also have an individual 'title' script for the Battle Royal and the Battle Chateau, respectively. Unsure if these should be merged into here, or left as standalone simple scripts.
    • Gen 4: DP Pt HGSS
    • Gen 5: BW B2W2
    • Gen 6: XY ORAS
    • Gen 7: SM USUM
  • Daycare scripts

    • See this reply for possible issues merging these.
    • File links: DP Pt HGSS BW B2W2 XY ORAS
  • 'Set max' script

    • No point having these separate
    • Fold in money, BP, underground flag, game corner, volcanic ash, etc. scripts
  • BW/B2W2 Season scripts

  • DPPt Poffin scripts

  • DPPt/HGSS Berry scripts

  • Illegal scripts

    • Can all of these be moved into a single universal picoC?
  • USUM Battle Style scripts

  • SM/USUM Zygarde cell scripts

  • XY/ORAS O-Power scripts

  • DPPt Level Man scripts

  • DPPt Poketch scripts

  • DPPt Spiritomb scripts

    • implemented in 0a4b2bc
  • DPPt/HGSS Contest scripts

    • Include fashion case stuff here
  • HGSS Pokeathlon scripts

  • DPPt/HGSS Lotto ID scripts

  • B2W2 Join Avenue scripts

  • ORAS Mirage scripts

Further Ongoing Ideas (Behind the scenes)

  • Pokemon Injection scripts

    • The team is currently seeing if it would be better to have these scripts work similarly to how the Legal Living Dex script functions - by pulling the files from the FlagBrew server instead of packaging them with the scripts. These will likely be merged into a single picoC file at that time.
  • Item Injection scripts

    • Due to the Bag Editor, these may no longer be needed. Arguments for/against keeping them are welcome.
  • Pass Powers script

    • Should the Entree scripts be merged in?

Issue Edit Changelog

  • Added in Encounter Reset script links
  • Resorted Battle Facility and Daycare script links to be in ascending generational order
  • Added link to Spired's comment about daycare script merging
  • Added 'Set max' script info
  • Added BW/B2W2 Season scripts
  • Added DPPt Poffin scripts
  • Added DPPt/HGSS Berry scripts
  • Added illegal scripts
  • Added USUM Battle Style scripts
  • Added SM/USUM Zygarde cell scripts
  • Added XY/ORAS O-Power scripts
  • Added DPPt Level Man scripts
  • Added DPPt Poketch scripts
  • Added DPPt Spiritomb scripts
  • Added DPPt/HGSS Contest scripts
  • Added HGSS Pokeathlon scripts
  • Added DPPt/HGSS Lotto ID scripts
  • Added B2W2 Join Avenue scripts
  • Merged XY Kanto bird scripts into reset script
  • Added ORAS mirage scripts

GriffinG1 avatar Apr 07 '22 00:04 GriffinG1

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

SpiredMoth avatar Apr 07 '22 02:04 SpiredMoth

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.

GriffinG1 avatar Apr 07 '22 12:04 GriffinG1

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.

SNBeast avatar Apr 07 '22 13:04 SNBeast

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.

piepie62 avatar Apr 07 '22 17:04 piepie62

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

SpiredMoth avatar Apr 14 '22 07:04 SpiredMoth

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.

SNBeast avatar Apr 21 '22 14:04 SNBeast

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:

  • own ID
  • one for each in-game trade
  • user provided

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?).

SpiredMoth avatar Jan 09 '23 22:01 SpiredMoth