The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Need some help with this script

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 July 3rd, 2017 (11:22 PM). Edited July 4th, 2017 by viper8890.
viper8890 viper8890 is offline
 
Join Date: Dec 2014
Location: India
Gender: Male
Nature: Jolly
Posts: 434
I've just started working on a hack and guess what, my first ever script isn't working.
Here's the script:
Code:
'---------------
#org 0xE3D0E6
lock
faceplayer
msgbox 0x8E3D10E MSG_NORMAL '"[player], wait."
applymovement 0x5 0x8E3D11A
waitmovement 0x0
checkflag 0x500
if 0x1 goto 0x8E3D135
msgbox 0x8E3D15A MSG_NORMAL '"We have travelled far.\nAnd we hav..."
release
end

'---------------
#org 0xE3D135
msgbox 0x8E3D1AF MSG_NORMAL '"This place wouldn't be safe \nfor ..."
release
hidesprite 0x5
hidesprite 0x0
applymovement 0x4 0x8E3D1EA
pause 0x101
fadescreen 0x1
warp 0x0 0x0 0x0 0x6 0x7
end


'---------
' Strings
'---------
#org 0xE3D10E
= [player], wait.

#org 0xE3D15A
= We have travelled far.\nAnd we have to travel more.\pTake a rest at the rest \nhouse.

#org 0xE3D1AF
= This place wouldn't be safe \nfor long. We better \pleave.


'-----------
' Movements
'-----------
#org 0xE3D11A
#raw 0x18 'Slide Right
#raw 0x18 'Slide Right
#raw 0x18 'Slide Right
#raw 0x18 'Slide Right
#raw 0x18 'Slide Right
#raw 0x18 'Slide Right
#raw 0x18 'Slide Right
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x18 'Slide Right
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x16 'Slide Up
#raw 0x17 'Slide Left
#raw 0xFE 'End of Movements

#org 0xE3D1EA
#raw 0x6 'Step Left (Slow)
#raw 0x6 'Step Left (Slow)
#raw 0x6 'Step Left (Slow)
#raw 0x6 'Step Left (Slow)
#raw 0x6 'Step Left (Slow)
#raw 0x6 'Step Left (Slow)
#raw 0x6 'Step Left (Slow)
#raw 0xFE 'End of Movements
Please tell me where the problem is. The movement isn't taking place. The messages are executed directly without any movement. The hidesprite command isn't working as well.And it would be helpful if anyone can tell the person id of the hero.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old July 4th, 2017 (9:06 AM).
tkim's Avatar
tkim tkim is offline
 
Join Date: May 2011
Posts: 232
I'm going to guess that you're probably using the wrong sprite values for the applymovement and hidesprite. If a sprite number is 0 in Advance Map, you should use applymovement 0x1 for it. Hero ID is 0xFF
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old July 4th, 2017 (10:05 AM).
viper8890 viper8890 is offline
 
Join Date: Dec 2014
Location: India
Gender: Male
Nature: Jolly
Posts: 434
I guess that isn't the problem because the second one is working fine. The first applymovement is the one not working. Sorry to not make it clear in the OP.
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old July 5th, 2017 (8:50 AM).
Bladecraft's Avatar
Bladecraft Bladecraft is offline
It's written "Bladecraft" on my forehead.
 
Join Date: Feb 2017
Gender: Male
Nature: Calm
Posts: 83
Hi, welcome to the Rom Hacking community, I'm a new greenhorn like yourself here but I do have some knowledge :)

First of all, whenever you're sharing a script, make sure for the comfort of everyone to share it uncompiled, which means with the pointers instead of the offsets.

An example of an uncompiled script vs a compiled one.
Spoiler:

#dynamic 0x800000
#org @start
msgbox 0x2 @1
end

#org @1
= Hello, my name is BRENDAN.

`------------------
#org 0x8665AD2
msgbox MSG_FACE 0x8665AF5
end

`------------------
#org 0x665AF5
= Hello, my name is BRENDAN.


In general, uncompiled scripts are much easier to work with, so make sure you're keeping your scripts saved uncompiled in a folder (I have like >50)

Also, please keep scripts in spoilers so nobody has to scroll down walls of texts.

I'm going to assume you're using XSE, and start helping out (hopefully)
Here's your script, which I uncompiled to make it easier to work with
Spoiler:

'---------------
#dynamic 0x[offset of choice here]
#org @start
lock
faceplayer
msgbox @1 0x4
applymovement 0x5 @move1
waitmovement 0x0
checkflag 0x500
if 0x1 goto @warp
msgbox @2 0x4
release
end

'---------------
#org @warp
msgbox @3 0x4
release
hidesprite 0x5
hidesprite 0x0
applymovement 0x4 @move2
pause 0x101
fadescreen 0x1
warp 0x0 0x0 0x0 0x6 0x7
end


'---------
' Strings
'---------
#org @1
= [player], wait.

#org @2
= We have travelled far.\nAnd we have to travel more.\pTake a rest at the rest \nhouse.

#org @3
= This place wouldn't be safe \nfor long. We better \pleave.


'-----------
' Movements
'-----------
#org @move1
#raw 0x18
#raw 0x18
#raw 0x18
#raw 0x18
#raw 0x18
#raw 0x18
#raw 0x18
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x18
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x17
#raw 0xFE

#org @move2
#raw 0x6
#raw 0x6
#raw 0x6
#raw 0x6
#raw 0x6
#raw 0x6
#raw 0x6
#raw 0xFE


Alright, so first, in @warp, you forgot a waitmovement 0x0 command after the applymovement 0x4 @move2 command, so that's something needs to get fixed.

Also, I'd change the flag you're using to be a different one, personally, I don't like using "big" flags, and some flags reset once you leave the room. Worth having that checked out.

The second problem you may have is that you're using a wrong event number.
In advanced map, click the person you want to move.
In the applymovement command, the "people # to use" is the person's event number (see picture).
imgur.com/a/KR0RW
Make sure that's the number you have in the command, e.g in the picture the person event number is 1 so I'd put applymovement 0x1 if I wanted to move it.
Also remember that if you have an event number that's 10 or bigger you need to translate it to hex, XSE has a built in feature for this.
For example - moving the person who's event number is 11 in advanced map:

applymovement 0xB @pointer
waitmovement 0x0

In case my help wasn't good enough please check out deigoisawesome's huge scripting tutorial.
That's where I got about 80% of my knowledge in scripting and probably 100% of my early knowledge in scripting.
Good luck. -Blade
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old July 7th, 2017 (7:47 PM).
viper8890 viper8890 is offline
 
Join Date: Dec 2014
Location: India
Gender: Male
Nature: Jolly
Posts: 434
Quote:
Originally Posted by Bladecraft View Post
Hi, welcome to the Rom Hacking community, I'm a new greenhorn like yourself here but I do have some knowledge :)

First of all, whenever you're sharing a script, make sure for the comfort of everyone to share it uncompiled, which means with the pointers instead of the offsets.

An example of an uncompiled script vs a compiled one.
Spoiler:

#dynamic 0x800000
#org @start
msgbox 0x2 @1
end

#org @1
= Hello, my name is BRENDAN.

`------------------
#org 0x8665AD2
msgbox MSG_FACE 0x8665AF5
end

`------------------
#org 0x665AF5
= Hello, my name is BRENDAN.


In general, uncompiled scripts are much easier to work with, so make sure you're keeping your scripts saved uncompiled in a folder (I have like >50)

Also, please keep scripts in spoilers so nobody has to scroll down walls of texts.

I'm going to assume you're using XSE, and start helping out (hopefully)
Here's your script, which I uncompiled to make it easier to work with
Spoiler:

'---------------
#dynamic 0x[offset of choice here]
#org @start
lock
faceplayer
msgbox @1 0x4
applymovement 0x5 @move1
waitmovement 0x0
checkflag 0x500
if 0x1 goto @warp
msgbox @2 0x4
release
end

'---------------
#org @warp
msgbox @3 0x4
release
hidesprite 0x5
hidesprite 0x0
applymovement 0x4 @move2
pause 0x101
fadescreen 0x1
warp 0x0 0x0 0x0 0x6 0x7
end


'---------
' Strings
'---------
#org @1
= [player], wait.

#org @2
= We have travelled far.\nAnd we have to travel more.\pTake a rest at the rest \nhouse.

#org @3
= This place wouldn't be safe \nfor long. We better \pleave.


'-----------
' Movements
'-----------
#org @move1
#raw 0x18
#raw 0x18
#raw 0x18
#raw 0x18
#raw 0x18
#raw 0x18
#raw 0x18
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x18
#raw 0x16
#raw 0x16
#raw 0x16
#raw 0x17
#raw 0xFE

#org @move2
#raw 0x6
#raw 0x6
#raw 0x6
#raw 0x6
#raw 0x6
#raw 0x6
#raw 0x6
#raw 0xFE


Alright, so first, in @warp, you forgot a waitmovement 0x0 command after the applymovement 0x4 @move2 command, so that's something needs to get fixed.

Also, I'd change the flag you're using to be a different one, personally, I don't like using "big" flags, and some flags reset once you leave the room. Worth having that checked out.

The second problem you may have is that you're using a wrong event number.
In advanced map, click the person you want to move.
In the applymovement command, the "people # to use" is the person's event number (see picture).
imgur.com/a/KR0RW
Make sure that's the number you have in the command, e.g in the picture the person event number is 1 so I'd put applymovement 0x1 if I wanted to move it.
Also remember that if you have an event number that's 10 or bigger you need to translate it to hex, XSE has a built in feature for this.
For example - moving the person who's event number is 11 in advanced map:

applymovement 0xB @pointer
waitmovement 0x0

In case my help wasn't good enough please check out deigoisawesome's huge scripting tutorial.
That's where I got about 80% of my knowledge in scripting and probably 100% of my early knowledge in scripting.
Good luck. -Blade
Thanks for the reply. I have tried what you said, but the sprite doesn't moves at all. So I decided to leave it, I'll make a fresh one. Btw, I myself have got most of my scripting knowledge from diego's tutorial. Can you just help me and let me know if there is a way to hide the player's sprite?
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old July 8th, 2017 (5:50 AM).
Bladecraft's Avatar
Bladecraft Bladecraft is offline
It's written "Bladecraft" on my forehead.
 
Join Date: Feb 2017
Gender: Male
Nature: Calm
Posts: 83
Since you haven't specified your intentions I believe that there will be an easier way for doing what you want.

Try joining the PC Discord and going to the rom hacking channel then I'll try helping better.

Other than that - to hide the player's sprite I'd try either

Spoiler:
applymovement 0xFF @move
waitmovement 0x0

#org @move
#raw 0x54
#raw 0xFE


Or simply

Spoiler:
hidesprite 0xFF
__________________
Rule #0: Always Make a Backup




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:18 AM.