The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script script to check the movement and views

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 October 29th, 2018 (10:26 AM).
Dinisk's Avatar
Dinisk Dinisk is offline
DinisK
 
Join Date: Jan 2017
Gender: Male
Posts: 89
I sat and thought where I was making a mistake, but after ten hours my patience could not stand it and I ask for help from you. What I want. Girl, as on the screen, depending on the direction of gaze (there are two options, up and to the left) moves away from the nameplate without touching the main character. At first she speaks (look at the nameplate) and moves away from her. Then, when the dialogue is repeated, she answers (have you read?) and only when you exit the card she again gets up next to the nameplate. Tom girl continues to move again during the dialogue. I want to do all this through variables, no flags and copyvars 4011&800C (sorry my bad google translate)

#dynamic 0x800000

#org @start
compare 0x4011 0x0
if 0x1 call @msg 0x2
copyvar 0x4011 0x800C
compare 0x4011 0x2
if 0x1 call @up
copyvar 0x4011 0x800C
compare 0x4011 0x3
if 0x1 call @left
compare 0x4011 0x2
if 0x4 call @msg2
end

#org @msg
setvar 0x4011 0x1
msgbox @msg1 0x2
end

#org @msg1
= Oh look, look

#org @msg2
= Godspeed!

#org @up
copyvar 0x4011 0x800C
applymovement 0x2 @move
waitmovement 0x2
end

#org @move
#raw 0x3
#raw 0x13
#raw 0x2
#raw 0xfe
end

#org @left
copyvar 0x4011 0x800C
applymovement 0x2 @move1
waitmovement 0x2
end

#org @move1
#raw 0x0
#raw 0x10
#raw 0x1
#raw 0xfe
end
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old October 29th, 2018 (1:23 PM). Edited October 29th, 2018 by DrFuji.
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
Here, this script should be what you're looking for:

Code:
#dynamic 0x800000

#org @start
checkflag 0x1F // Checks if we've already spoken
if 0x1 goto @done // If we have spoken to her, skip to the end
setflag 0x1F // Sets a temporary flag
msgbox @msg1 0x2
compare 0x800C 0x2 // We don't need to copyvar 0x800C to 0x4011, we can read it directly
if 0x1 goto @up // We only need to check 0x800C once and split the script depending on the result
applymovement 0x2 @move1
waitmovement 0x0
movesprite2 0x2 0x2 0x4 // Changes the default position of the OW until you leave the map
spritebehave 0x2 0x7 // Makes the OW face up if you unload them and then return
end

#org @up
applymovement 0x2 @move
waitmovement 0x0
movesprite2 0x2 0x3 0x3 // Changes the default position of the OW until you leave the map
spritebehave 0x2 0x9 // Makes the OW face left if you unload them and then return
end

#org @done
msgbox @msg2 0x2
end

#org @move
#raw 0x13 // The girl doesn't have to face right before moving right
#raw 0x2
#raw 0xFE // Don't put the 'end' command after movement values

#org @move1
#raw 0x10// The girl doesn't have to face down before moving down
#raw 0x1
#raw 0xFE // Don't put the 'end' command after movement values

#org @msg1
= Oh look, look!

#org @msg2
= Godspeed!
You said that you didn't want to use any flags, but flag 0x1F is a bit different than most others. Its a temporary flag, meaning that when you exit the map, it resets to 0x0. Flags 0x11 - 0x1F are usually only used for destructible OWs that reset themselves (Cut trees, Rock Smash rocks etc) but since you want the girl to reset her position when you leave the map I thought it would be appropriate to use in this context.
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old October 29th, 2018 (10:33 PM). Edited October 29th, 2018 by Dinisk.
Dinisk's Avatar
Dinisk Dinisk is offline
DinisK
 
Join Date: Jan 2017
Gender: Male
Posts: 89
Quote:
Originally Posted by DrFuji View Post
Here, this script should be what you're looking for:

Code:
#dynamic 0x800000

#org @start
checkflag 0x1F // Checks if we've already spoken
if 0x1 goto @done // If we have spoken to her, skip to the end
setflag 0x1F // Sets a temporary flag
msgbox @msg1 0x2
compare 0x800C 0x2 // We don't need to copyvar 0x800C to 0x4011, we can read it directly
if 0x1 goto @up // We only need to check 0x800C once and split the script depending on the result
applymovement 0x2 @move1
waitmovement 0x0
movesprite2 0x2 0x2 0x4 // Changes the default position of the OW until you leave the map
spritebehave 0x2 0x7 // Makes the OW face up if you unload them and then return
end

#org @up
applymovement 0x2 @move
waitmovement 0x0
movesprite2 0x2 0x3 0x3 // Changes the default position of the OW until you leave the map
spritebehave 0x2 0x9 // Makes the OW face left if you unload them and then return
end

#org @done
msgbox @msg2 0x2
end

#org @move
#raw 0x13 // The girl doesn't have to face right before moving right
#raw 0x2
#raw 0xFE // Don't put the 'end' command after movement values

#org @move1
#raw 0x10// The girl doesn't have to face down before moving down
#raw 0x1
#raw 0xFE // Don't put the 'end' command after movement values

#org @msg1
= Oh look, look!

#org @msg2
= Godspeed!
You said that you didn't want to use any flags, but flag 0x1F is a bit different than most others. Its a temporary flag, meaning that when you exit the map, it resets to 0x0. Flags 0x11 - 0x1F are usually only used for destructible OWs that reset themselves (Cut trees, Rock Smash rocks etc) but since you want the girl to reset her position when you leave the map I thought it would be appropriate to use in this context.
Amazing, your knowledge is great, this is exactly what I need.// surprising where did you get such information, because it is not in the xse manual (keyboard f2) and in other long guides(or did not quite understand what it means)
thanks again
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old October 30th, 2018 (3:41 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 Dinisk View Post
Amazing, your knowledge is great, this is exactly what I need.// surprising where did you get such information, because it is not in the xse manual (keyboard f2) and in other long guides(or did not quite understand what it means)
thanks again
Ten years on this forum kind of does that, you just pick things up from everywhere :P

One of the best resources to get a more detailed explanation about individual scripting commands is DavidJCobb's document with amendments by Spherical Ice. Asking questions on the forum is also a good way to learn. Other than that, just studying in-game scripts and practicing/ experimenting is probably the best way to directly improve your scripting skills.
__________________
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.