The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Script applymovement permissions problem (https://www.pokecommunity.com/showthread.php?t=392505)

ASDBUDDY May 12th, 2017 3:50 AM

applymovement permissions problem
 
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.


DrFuji May 12th, 2017 4:22 AM

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

ASDBUDDY May 12th, 2017 5:45 AM

Quote:

Originally Posted by DrFuji (Post 9644904)
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 ?

DrFuji May 12th, 2017 6:16 AM

Quote:

Originally Posted by ASDBUDDY (Post 9644937)
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.

ASDBUDDY May 12th, 2017 6:28 AM

Quote:

Originally Posted by DrFuji (Post 9644956)
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!

ASDBUDDY May 12th, 2017 7:19 AM

Quote:

Originally Posted by DrFuji (Post 9644956)
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?


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


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.