The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Help me learn code Sensei!!!

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old December 24th, 2020 (12:46 PM).
IIIGenPokefreak's Avatar
IIIGenPokefreak IIIGenPokefreak is offline
 
Join Date: Dec 2020
Location: USA
Age: 33
Gender: Male
Nature: Relaxed
Posts: 8
Anyone Who knows code, will know that segments of this code won't work. I know because I placed the segment and tested it. It failed. What did I do wrong? Something I did not add? A definition I failed to mention? A magic word I did'nt know existed? : ) How long can a single instruction be before the rom runs out of space?

What I am trying to do is initiate a "follow along" sequence where the NPC "0x09" takes our player 0xFF on a tour of the town that ends inside a building, once inside I want to then program a pokemon exchange animation.

I realize I have not programmed for 0xFF because my tests on 0x09 haven't worked yet. How do I make one follow the other? how long can the code segment be? Are there any limitations? What is proper code structure? What has to happen first and what can happen later? Thank you for any light you can shed on my problem. From what I know, I think this code can only apply to r/s/e and not Lg/Fr as they are written slightly differently.

Here's my code so far :

---Start-Of-Code---
------ ------
------ ------


#dynamic 0x740000
#org @start
lock
faceplayer
message @talk
callstd MSG_YESNO
compare LASTRESULT YES
if == jump @yes
jump @no


#org @yes
message @speakyes
callstd MSG_NORMAL
applymovement 0x09 @move
release
end

#org @no
message @speakno
callstd MSG_NORMAL
release
end

#org @speakyes
message @speakyes
callstd MSG_NORMAL

#org @talk
= Hey, ya'll from out of town?

#org @speakyes
= Wonderful! Follow me!

#org @speakno
= Dang, been want'n to give a grand ole tour.

#org @move
M raw_53 look_up raw_40 walk_down_slow raw_41 end

------ ------
------ ------
---End-Of-Code---

The code that dosen't work is : "applymovement 0x09 @move" & "#org @move M raw_53 look_up raw_40 walk_down_slow raw_41 end"
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old December 25th, 2020 (2:20 PM).
IIIGenPokefreak's Avatar
IIIGenPokefreak IIIGenPokefreak is offline
 
Join Date: Dec 2020
Location: USA
Age: 33
Gender: Male
Nature: Relaxed
Posts: 8
I'm starting to understand the code structure.

After reading a bunch of Sierra's mega thread I linked PKSV-UI with AdvanceMap and used AdvanceMap to read the scripts to see if I could decipher anything. I looked in the relavent maps looking at the scripts of the different events. like in Oldale town when you enter it and talk to the shop keeper on the right side of the Oldale map. He will ask a question, take you on a walk, and give you an item, the script even plans for a "full inventory" conflict. I delved further, looking at what I think are the npc's scripts themselves. These scripts contain all the events and the pointers and specific hex codes for each event and so on for this particular npc. I still have a few questions but I think I should continue to read and test and experiment. I really can't think of the actual questions I want to ask. But one might be, can these pointers and hex lines be recycled or ammended? Or do I have to create entirely new sets of pointers and hex lines?
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old December 25th, 2020 (10:07 PM).
Asith's Avatar
Asith Asith is offline
Uwao
 
Join Date: Nov 2020
Posts: 204
Quote:
Originally Posted by IIIGenPokefreak View Post
But one might be, can these pointers and hex lines be recycled or ammended? Or do I have to create entirely new sets of pointers and hex lines?
If you're asking whether pointers from one script can be reused in another, then yep! One script is all you need to define the pointer, such as:
#org 0x8000000
= This is my text that I've written!

You can call on that text for a msgbox in any other script by using:
msgbox 0x88000000
(followed by the rest of the regular msgbox code).

Remember that you have to use static pointers like I've done for this, not "@text" .

That'll work for movement data too!
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old December 26th, 2020 (2:12 PM).
IIIGenPokefreak's Avatar
IIIGenPokefreak IIIGenPokefreak is offline
 
Join Date: Dec 2020
Location: USA
Age: 33
Gender: Male
Nature: Relaxed
Posts: 8
Quote:
Originally Posted by Asith View Post
If you're asking whether pointers from one script can be reused in another, then yep! One script is all you need to define the pointer, such as:
#org 0x8000000
= This is my text that I've written!

You can call on that text for a msgbox in any other script by using:
msgbox 0x88000000
(followed by the rest of the regular msgbox code).

Remember that you have to use static pointers like I've done for this, not "@text" .

That'll work for movement data too!
Thank you Asith, I'll really study how this works. I was able to get the player to move along a path, open a door and warp to a new map after talking with an npc. Thank you!
I'll have more questions in the future but I'll study/test some more.
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:16 AM.