Main Menu
Main Page
Forums
New pages
Recent changes
Random page
Help

Glitches
Arbitrary code execution
Pokémon cloning
Pomeg glitch and Glitzer Popping
Tweaking and voiding
Glitches by generation
Glitch categories

References/Resources
Databases
Disassembly projects
The Big HEX List
Pokémon cheat codes
Pokémon glitch terminology
Useful tools
More

Affiliates
Legendary Star Blob 2 (Hakuda) (日本語/Japanese)
Pokémon Speedruns wiki (English)
PRAMA Initiative (Français/French)
MissingNo. Glitch City (Italiano/Italian)
Become an affiliate!

Technical
Site source code

Search Wiki

 

Search Forums

 

Author Topic: Link via script to the Shuckle.asm?  (Read 271 times)

0 Members and 1 Guest are viewing this topic.

Halfshadow

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Link via script to the Shuckle.asm?
« on: July 10, 2019, 07:05:41 am »
Hi. I want to link to an asm part via script. Should be possible, after a givepokemon script command I want to link to these ASM:
 https://github.com/pret/pokecrystal/blob/0ae5e9b3986dbbe64870dc1ad29a63b65b96200e/engine/events/shuckle.asm

starting from the "ld bc, PARTYMON_STRUCT_LENGTH" line, I know the binary address in the rom of that line.

If linked correctly should as example give the Berry to the obtained pokémon and the Mania OT and ID and the nickname.

There is a way to link to that line?

I want to write a similar ASM with a different ID and trainer name, but I don't want to write a new special command, only add the routine to set the ID and the trainer name, is possible?

My target is of give a legit GF Mew that could pass trough the pokétransfer, I need only of own the link to the asm. :)
« Last Edit: July 10, 2019, 07:07:09 am by Halfshadow »

Sherkel

  • Ringsome on the aquaface
  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
    • View Profile
Re: Link via script to the Shuckle.asm?
« Reply #1 on: July 10, 2019, 11:59:08 am »
That's a good idea, given your recent question about the VC... :D

Anyway, much as I'm not a ROM hacker I feel obliged to give some sort of answer, so while it might not be the best one, I would probably write over ManiasHouse.asm with your new text, change the constants directly, and put the warp event to it in whatever map you want the "Mew House" to be in...there's definitely a way to do it without removing the Shuckle event if you're determined to have both, but not that I know offhand.

Sticking to quality control and moderation until I sort some IRL matters out. I check in here almost daily and will answer questions, but not all of them.
I don't have a habit of keeping Discord open, so direct inquiries are preferred through here.

Princess Torchic Owl Lover ☽ ❤

  • Head Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • Aspiring mother. 🦋 ✿
    • View Profile
Re: Link via script to the Shuckle.asm?
« Reply #2 on: July 10, 2019, 02:00:25 pm »
In a nutshell: I'm unsure if linking to the script would be best sorry. It's certainly possible but takes space. as a lot of the registers are set in certain ways; i.e. if you skipped the level 15 Shuckle part it would have the Mania OT and ID or predef TryAddMonToParty may never run so you'd get nothing. If you skipped the Mania OT/ID you'd also have to skip the level 15 Shuckle part.

1. (closer to Shuckle script)
If you want to use the base Shuckle script; maybe you could use the far copy bytes to dump it into RAM where then you could simulate ROM patches by modifying the code in that copy.


2.
You may set your own parameters for TryAddMonToParty predef or directly modify RAM many times etc.

For customization/user friendliness, ACE can be used to fill the TM/HM pockets with x255 (in the competitive Coin Case thread somewhere, this may need to be modified for other methods e.g. wrong pocket TM. Due to the structure being quantity only and reasonably allowing 0-255, you can use the shortest possible codes you can program; with no playing around with dummy opcodes/operands. The operands here will be identifiable by a TM (e.g. Mew is TMX's quantity, ID is TMY (high) and TMZ (low) bytes.

As for the OT, in my name your mum with Coin Case video I set a custom destination; maybe you can adjust that to party pokemon 1's OT so when you finish input on the "x's name" menu it will apply changes there.

ld a,bank ld hl,address rst $08 allows you to call anywhere, like farbankswitch in RB(?? forgot its exact name).

Hope this helps. :)
« Last Edit: July 10, 2019, 02:36:14 pm by Princess Torchic Owl Lover ☽ ❤ »

✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Here have some free flowers on every post ^^
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿



(Images © Sanrio, Nintendo, Pokémon, HAL Laboratory)

✿ Hi, I'm Evie. Sex male, and spiritually doesn't believe 'male'/'female' needs to be defined; lives more stereotypically like a woman. Call me whichever pronouns you like. :)

Feel free to contact me here about anything regarding the site.

Forgiveness. I feel that the more people pray to our greatest source/God/mathematical equality for world peace, the more and more it manifests into reality (until our next spiritual death).

Thank you Nyapon for this lovely artwork. :3

Halfshadow

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Link via script to the Shuckle.asm?
« Reply #3 on: July 11, 2019, 05:08:10 pm »
I added a new routine to add a party pokémon from the Shuckle ASM and I found the script command to use it that is 3callasm.

I have only an issue, I reached to add GF OT name and ID and the all 15 DVS but when obtained the stats are wrong 'til I put it in the PC and come back. However the PkHex mark it as legit GF Mew, I have only the issue that the current stats are wrong when just obtained.

The ASM code I wrote is this:

Quote
GiveMew:
; Adding to the party.
   xor a
   ld [wMonType], a

; Level 5 Mew.
   ld a, MEW
   ld [wCurPartySpecies], a
   ld a, 5
   ld [wCurPartyLevel], a

   predef TryAddMonToParty
   jr nc, .NotGiven

; Caught data.
   ld b, 0
   farcall SetGiftPartyMonCaughtData

; SetDVs.
   ld bc, PARTYMON_STRUCT_LENGTH
   ld a, [wPartyCount]
   dec a
   push af
   push bc
   ld hl, wPartyMon1DVs
   call AddNTimes
   ld [hl], HIGH(DV_MAX_)
   ld [hli], a
   ld [hl], LOW(DV_MAX)
   pop bc
   pop af

; OT ID.
   ld hl, wPartyMon1ID
   call AddNTimes
   ld a, HIGH(GF_OT_ID)
   ld [hli], a
   ld [hl], LOW(GF_OT_ID)

; Nickname.
   ld a, [wPartyCount]
   dec a
   ld hl, wPartyMonNicknames
   call SkipNames
   ld de, SpecialMewNick
   call CopyName2

; OT.
   ld a, [wPartyCount]
   dec a
   ld hl, wPartyMonOT
   call SkipNames
   ld de, SpecialMewOT
   call CopyName2
        ret

.NotGiven:
   xor a
   ld [wScriptVar], a
   ret

SpecialMewOT:
   db "GF@"

SpecialMewNick:
   db "MEW@"

The code is however wrote in binary mode.

To add the DVs I added two FF bytes in the right position and if I save also according to PkHex the DVs are all 15. But seems that when just obtained the current stats aren't updated.

Can I add some code to fix it?

Sherkel

  • Ringsome on the aquaface
  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
    • View Profile
Re: Link via script to the Shuckle.asm?
« Reply #4 on: July 11, 2019, 11:06:08 pm »
If it's like RBY, it could just be that the DVs are correct (FF'd) but the stats when viewing it before putting it in the PC haven't been recalculated to reflect the change that happens after it's already in the party. I doubt anyone playing would notice, especially if it's at level 15.

Sticking to quality control and moderation until I sort some IRL matters out. I check in here almost daily and will answer questions, but not all of them.
I don't have a habit of keeping Discord open, so direct inquiries are preferred through here.

Halfshadow

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Link via script to the Shuckle.asm?
« Reply #5 on: July 12, 2019, 08:06:08 am »
Simply if the Mew DVs aren't updated you can see that it have 25 HP instead of 26 and stats like 15 instead of 16... And this is wrong... there isn't nothing to update immediately the visible stats?

Halfshadow

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Link via script to the Shuckle.asm?
« Reply #6 on: July 16, 2019, 10:03:50 am »
UP nobody know how update the party pokémon stats after the change?

Sherkel

  • Ringsome on the aquaface
  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
    • View Profile
Re: Link via script to the Shuckle.asm?
« Reply #7 on: July 16, 2019, 10:39:16 am »
Wouldn't calling or copying the bit that runs when putting something in the PC or Daycare work?

Sticking to quality control and moderation until I sort some IRL matters out. I check in here almost daily and will answer questions, but not all of them.
I don't have a habit of keeping Discord open, so direct inquiries are preferred through here.

Halfshadow

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Link via script to the Shuckle.asm?
« Reply #8 on: July 17, 2019, 01:38:53 pm »
Nope, didn't work unfortunately... :(

Halfshadow

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Link via script to the Shuckle.asm?
« Reply #9 on: July 17, 2019, 03:00:23 pm »
Ok, I did it, I linked via script to the asm in move_mon.asm, after .room_in_party there is a .okay part, I linked to half sub routine when the 3 calls have to start, "call CopyBytes
   call GetBaseData
   call GetLastPartyMon" and then worked finally.

Sherkel

  • Ringsome on the aquaface
  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
    • View Profile
Re: Link via script to the Shuckle.asm?
« Reply #10 on: July 17, 2019, 04:13:19 pm »
Great! :) It was a bit hard to tell when looking at it which part specifically recalculated the stats.

Sticking to quality control and moderation until I sort some IRL matters out. I check in here almost daily and will answer questions, but not all of them.
I don't have a habit of keeping Discord open, so direct inquiries are preferred through here.

Halfshadow

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Link via script to the Shuckle.asm?
« Reply #11 on: July 17, 2019, 04:15:35 pm »
Yep... But thank you, your idea of look at the daycare was helpful. Now I have to made the same also in G/S. I made a Mew legit event that you can transfer with the bank! :D