Jump to content

evievi

New Member
  • Posts

    4
  • Joined

  • Last visited

Everything posted by evievi

  1. Thank you! Yep looking back at my code you are right I was using the wrong types. And yes you're right about the two objects being used, I had passed the pokemon object by reference in a helper function and just copied it here- that's why it's not consistent. Update: btw in case anyone wanted to know if it worked, calling GetShinyPID as shown above works! Since objects are passed by reference, I wrote this function in a class to make a PK4 object shiny: internal void MakeShiny(PK4 pokemon) { // Get IDs ushort trainer_id = pokemon.TID16; ushort secret_id = pokemon.SID16; uint pid = ShinyUtil.GetShinyPID(trainer_id, secret_id, 0, 0); pokemon.PID = pid; }
  2. I think sadly pkhex doesn't cannot run natively on Linux due to it using the windows forms api which to my knowledge has not been made cross-platform. You will probably need to resort to Wine or a VM. If you wanted to try native, I had this idea: You could try installing dotnet: apt-get update && apt-get install -y dotnet-sdk-8.0 ca-certificates And then try to compile it and see if you can get a linux executable # Install pkhex dependencies RUN dotnet restore pkhex # Compile the app to test RUN dotnet build --no-restore pkhex
  3. Hi all, I'm a little stuck trying to programmatically create a shiny egg in a Gen 4 save file. I have a PK4 object that I've initialized (called mew), and to my understanding, an egg will hatch shiny based on its personality value (the PID) lining up with the save file's secret id and trainer id. In doing that, I initialized the pokemon like this but don't know how to set the PID: // Assume mew is a PK4() object that I've constructed and have set other attrivbutes (species, held item, etc.) // Set the trainer ID according to the save file mew.TrainerTID7 = this.currentSave.TrainerTID7; mew.TrainerSID7 = this.currentSave.TrainerSID7; uint trainer_id = pokemon.TrainerTID7; uint secret_id = pokemon.TrainerSID7; uint pid = ShinyUtil.GetShinyPID(trainer_id, secret_id, 0, 0); mew.PID = pid; I see that there is a ShinyUtil class that should help me generate a shiny PID for the egg, but I don't think I'm using the function right. My egg currently doesn't register as a shiny when I check the exported save file in Pkhex. I wonder if I'm maybe not running the right function? It seems strange that I'd have to feed getshinypid a pid when I'm actively trying to get a shiny pid? I also have no idea what the last arg is supposed to take. Some help would be appreciated!
  4. Hello, Am an experienced user with PKHeX but an inexperienced user when it comes to using the PKHeX.core DLL. I've been making my way through it with some posts, but ran into a part of the code that's not super well documented as it related to held items. So, if I have a PK4 pokemon object for example, it looks like there's an integer field where I can assign it a held item like in the GUI: public override int HeldItem { get => ReadUInt16LittleEndian(Data.AsSpan(0x0A)); set => WriteUInt16LittleEndian(Data.AsSpan(0x0A), (ushort)value); } For other fields (i.e. abilities), I've been able to use the enums in the DLL to decode what number value corresponds to what value. However, there doesn't seen to really be any documentation or references to figure out what means what. I did find some unrelated code in the game strings that mentions held items like max potions, etc. but I'm not sure how to get an index I could use. It also seems like the integer index may change depending on generation because I saw that gen4 mail seems to shift the indexes. Does the integer value used internally correlate with the bulpapedia integer values? ex. below for gen 4: https://bulbapedia.bulbagarden.net/wiki/List_of_items_by_index_number_(Generation_IV)
×
×
  • Create New...