The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script applymovement permissions problem

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 May 12th, 2017 (3:50 AM). Edited May 25th, 2017 by ASDBUDDY.
ASDBUDDY's Avatar
ASDBUDDY ASDBUDDY is offline
The Derp
 
Join Date: Apr 2017
Location: aint gonna tell ya
Age: 22
Gender: Male
Nature: Docile
Posts: 347
hi, so I was making this script and no surprise at all it didn't work exactly how i wanted it to
the flag and all work fine but its the movement that doesn't occur, can anybody help me with that?
Code:
Spoiler:
#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x203
if 0x1 goto @rib
checkflag 0x204
if 0x1 goto @done
msgbox @tl 0x6
release
end

#org @tl
= There are lots of Rebels and kids\n like you are joining them.\pWhy don't you go to the \nPolice Academy to get some sense of\l Justice.

#org @rib
msgbox @prib 0x6
closeonkeypress
lock
applymovement 0x3 @m1
waitmovement 0x0
setflag 0x204
release
end

#org @m1
#raw 0x01
#raw 0x05
#raw 0x00
#raw 0xFE
release
end

#org @prib
= Ah! The Police Aspirant Ribbon.\pGood, now don't cause any trouble!

#org @done
msgbox @tld 0x6
release
end

#org @tld
= I want to see Kanto Crime free!\pThats why I encourage youngsters\n on the right path.

__________________
https://discord.gg/bEwyPd7
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old May 12th, 2017 (4:22 AM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
You've added some commands to your movements that don't need to be there. By putting the 'end' command after your movements it is prematurely finishing your script before the waitmovement command can take place. Here's a revised script with a few other changes to make it run better/ more efficiently. Changes are in red:

Code:
#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x204
if 0x1 goto @done // This should be ahead of your 'checkflag 0x203' command. You are setting flag 0x204 in this script but it would never proceed to @done since you're checking 0x203 first which is still set
checkflag 0x203
if 0x1 goto @rib
msgbox @tl 0x6
release
end

#org @tl
= There are lots of Rebels and kids\nlike you are joining them.\pWhy don't you go to the \nPolice Academy to get some sense of\lJustice.

#org @rib
msgbox @prib 0x6
closeonkeypress // This can be deleted as msgbox type 0x6 already incorporates the effects of closeonkeypress. This separate command is mainly used for msgbox 0x4
lock // This can be deleted as you already locked the NPC at the start of the script 
applymovement 0x3 @m1
waitmovement 0x0
setflag 0x204
release
end

#org @m1
#raw 0x01
#raw 0x05 // #raw 0x1 and 0x5 are the same movement except 0x5 is (slightly?) faster so you can delete one of them. I'd also suggest adding a delay between the NPC looking up and down as in this script it will take place over a single frame which is way to quick 
#raw 0x00
#raw 0xFE
release
end // Delete these to have your movements play out properly

#org @prib
= Ah! The Police Aspirant Ribbon.\pGood, now don't cause any trouble!

#org @done
msgbox @tld 0x6
release
end

#org @tld
= I want to see Kanto Crime free!\pThats why I encourage youngsters\non the right path.
In addition, when you're making a character talk ensure that there you're not leaving a space between '\n' and the next letter. It makes the text become unaligned and a bit weird :D
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old May 12th, 2017 (5:45 AM). Edited May 12th, 2017 by ASDBUDDY.
ASDBUDDY's Avatar
ASDBUDDY ASDBUDDY is offline
The Derp
 
Join Date: Apr 2017
Location: aint gonna tell ya
Age: 22
Gender: Male
Nature: Docile
Posts: 347
Quote:
Originally Posted by DrFuji View Post
You've added some commands to your movements that don't need to be there. By putting the 'end' command after your movements it is prematurely finishing your script before the waitmovement command can take place. Here's a revised script with a few other changes to make it run better/ more efficiently. Changes are in red:

Code:
#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x204
if 0x1 goto @done // This should be ahead of your 'checkflag 0x203' command. You are setting flag 0x204 in this script but it would never proceed to @done since you're checking 0x203 first which is still set
checkflag 0x203
if 0x1 goto @rib
msgbox @tl 0x6
release
end

#org @tl
= There are lots of Rebels and kids\nlike you are joining them.\pWhy don't you go to the \nPolice Academy to get some sense of\lJustice.

#org @rib
msgbox @prib 0x6
closeonkeypress // This can be deleted as msgbox type 0x6 already incorporates the effects of closeonkeypress. This separate command is mainly used for msgbox 0x4
lock // This can be deleted as you already locked the NPC at the start of the script 
applymovement 0x3 @m1
waitmovement 0x0
setflag 0x204
release
end

#org @m1
#raw 0x01
#raw 0x05 // #raw 0x1 and 0x5 are the same movement except 0x5 is (slightly?) faster so you can delete one of them. I'd also suggest adding a delay between the NPC looking up and down as in this script it will take place over a single frame which is way to quick 
#raw 0x00
#raw 0xFE
release
end // Delete these to have your movements play out properly

#org @prib
= Ah! The Police Aspirant Ribbon.\pGood, now don't cause any trouble!

#org @done
msgbox @tld 0x6
release
end

#org @tld
= I want to see Kanto Crime free!\pThats why I encourage youngsters\non the right path.
In addition, when you're making a character talk ensure that there you're not leaving a space between '\n' and the next letter. It makes the text become unaligned and a bit weird :D
Oh ok got it, Thanks a lot this has really helped me and yeah i'll keep the\n in mind XD
uh quick question if the person event no is say 3 (if the first is 0) do i type applymovement 0x3 or 0x4 ?
__________________
https://discord.gg/bEwyPd7
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old May 12th, 2017 (6:16 AM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
Quote:
Originally Posted by ASDBUDDY View Post
Oh ok got it, Thanks a lot this has really helped me and yeah i'll keep the\n in mind XD
uh quick question if the person event no is say 3 (if the first is 0) do i type applymovement 0x3 or 0x4 ?
No worries.

0x3 sounds right in that case. Be sure to use the 'Person Event no' under the 'Delete Event' button to determine which NPCs you're moving in your scripts.
__________________
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old May 12th, 2017 (6:28 AM).
ASDBUDDY's Avatar
ASDBUDDY ASDBUDDY is offline
The Derp
 
Join Date: Apr 2017
Location: aint gonna tell ya
Age: 22
Gender: Male
Nature: Docile
Posts: 347
Quote:
Originally Posted by DrFuji View Post
No worries.

0x3 sounds right in that case. Be sure to use the 'Person Event no' under the 'Delete Event' button to determine which NPCs you're moving in your scripts.
Yup got it! it's working smooth like butter!
Thanks a ton!
__________________
https://discord.gg/bEwyPd7
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old May 12th, 2017 (7:19 AM).
ASDBUDDY's Avatar
ASDBUDDY ASDBUDDY is offline
The Derp
 
Join Date: Apr 2017
Location: aint gonna tell ya
Age: 22
Gender: Male
Nature: Docile
Posts: 347
Quote:
Originally Posted by DrFuji View Post
No worries.

0x3 sounds right in that case. Be sure to use the 'Person Event no' under the 'Delete Event' button to determine which NPCs you're moving in your scripts.
um sorry to disturb you but can I post another code it's the same one but im having problems since I added some more code?
__________________
https://discord.gg/bEwyPd7
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
Thread Tools

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