The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Camera movement

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 November 1st, 2020 (10:00 AM).
MaxiDuck MaxiDuck is offline
 
Join Date: Nov 2017
Posts: 22
Hi I made script that will made camera move but when I stand on script tile game freeze :(
Here is script:

#dynamic 0x800000

#org @start
lock
special 0x113
applymovement 0x7F @camera1
waitmovement 0x0
applymovement 0x7F @camera2
waitmovement 0x0
special 0x114
release
end

#org @camera1
#raw 0x11
#raw 0x11
#raw 0xFE

#org @camera2
#raw 0x10
#raw 0x10
#raw 0xFE
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old November 1st, 2020 (10:23 AM).
kalarie kalarie is offline
 
Join Date: Jun 2008
Posts: 760
@MaxiDuck

Looks like there is not much wrong with the script. Make sure you set up the script tile correctly in AdvanceMap.

If you want to know how, I'd advise to check Antroyd's Gen III ROM Hacking video series on Youtube.
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old November 1st, 2020 (10:37 AM).
mcferaligatr's Avatar
mcferaligatr mcferaligatr is offline
 
Join Date: Nov 2018
Posts: 120
This sounds like an issue with the script tile itself. Depending on the game, you should make sure that an appropriate variable number is assigned to the script box in Advance Map. Also, you can check out whether the compiled offset is correct.
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old November 1st, 2020 (10:52 AM).
MaxiDuck MaxiDuck is offline
 
Join Date: Nov 2017
Posts: 22
when I click on script box in advance map I think all is good. Script offset is correct (I check it when double click on script) I dont know what means box unknown but I have here 00 00
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old November 1st, 2020 (11:01 AM).
mcferaligatr's Avatar
mcferaligatr mcferaligatr is offline
 
Join Date: Nov 2018
Posts: 120
I just tried this in Fire Red, used variable number 4011 and pasted your code and it worked. Try using some other variable for variable number and make sure that variable value is 0000. Also, what game and variable number are you using? This is probably causing issues. If anything, you could try the same script on a different map to see if it makes a difference.
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old November 1st, 2020 (11:26 PM).
MaxiDuck MaxiDuck is offline
 
Join Date: Nov 2017
Posts: 22
What is variable number? Im new with scripting so can you explain it?
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old November 2nd, 2020 (12:50 AM).
mcferaligatr's Avatar
mcferaligatr mcferaligatr is offline
 
Join Date: Nov 2018
Posts: 120
A variable number is required for a script tile to work, and if you're hacking Fire Red, the list of safe variable numbers are from 4011 to 40FF with some exceptions like:

'---------------------------------
0x4020 - 0x4024 are all pedometers, the first of them controlling REPEL expiration.
0x4036 is used for Selphy's Pokemon-fetching game. (She's the woman at Resort Gorgeous). I don't know what modifies this var -- possibly the game engine itself?
0x403A is used in elevator scripts and is directly modified when special 0xD8 is called. Don't store anything that you want to be permanent in this variable.
Vars 0x4064 through 0x4066 are used as part of the boulder puzzles in Victory Road. They're also cleared upon entering Route 23, along with 0x4067.
0x4069 sets which fossil is being revived in Cinnabar Island, and 0x406A sets the progress (1 = active, 2 = complete).
'---------------------------------

This thread covers this topic very well and could be useful: https://www.pokecommunity.com/showthread.php?t=302347

But essentially, your script is correct (I tested it out), but you have to put a variable number (note the exceptions above) in "Var number" box in Advance Map.

If you want to have your event repeat every time, you'd leave your script as it is, but if you only want it to happen once, you need to use a "setvar" command like so:

#dynamic 0x800000

#org @start
lock
special 0x113
applymovement 0x7F @camera1
waitmovement 0x0
applymovement 0x7F @camera2
waitmovement 0x0
special 0x114

setvar 0x4025 0x1 '--------- Here I used var 0x4025, you can use any from the safe range (don't use exceptions mentioned earlier). This sets variable
value to 0x1, meaning it will no longer activate. You can see by default that the "Var Value" box in Advance Map is 0000, and if
you put variable number" 4025 in "Var Number" box, the event will always activate unless you change the "Var Value" by
script to any value other than 0000.

release
end

#org @camera1
#raw 0x11
#raw 0x11
#raw 0xFE

#org @camera2
#raw 0x10
#raw 0x10
#raw 0xFE

'-------------------------
To sum it up, it seems like you either don't have a variable number in the "Var Number" box, or you are using a wrong variable. You can try using one from the safe range (4011 - 40FF while noting exceptions mentioned earlier).
Reply With Quote
  #8   Link to this post, but load the entire thread.  
Old November 2nd, 2020 (4:00 AM).
MaxiDuck MaxiDuck is offline
 
Join Date: Nov 2017
Posts: 22
I think I make somethink wrong but I dont see what.
I literally copy and paste your script, in var number I have 4025, in var value I have 0000,
In other clean rom it doesnt work too.

(now game not freezing but script isnt read and nothing happens)
Reply With Quote
  #9   Link to this post, but load the entire thread.  
Old November 2nd, 2020 (4:05 AM).
MaxiDuck MaxiDuck is offline
 
Join Date: Nov 2017
Posts: 22
here's image
Reply With Quote
  #10   Link to this post, but load the entire thread.  
Old November 2nd, 2020 (4:26 AM).
mcferaligatr's Avatar
mcferaligatr mcferaligatr is offline
 
Join Date: Nov 2018
Posts: 120
My bad, out of all variables, variable 4025 seemed to not do anything (I re-tested the script). Try using variable 4026 this time and the script should work. As far as the setup in Advance Map goes, seems like everything is correc (just change 4025 to 4026 and see if it works now).
Reply With Quote
  #11   Link to this post, but load the entire thread.  
Old November 2nd, 2020 (4:34 AM).
MaxiDuck MaxiDuck is offline
 
Join Date: Nov 2017
Posts: 22
WORK!!! thanks a lot man, but...

Do you know how to set gym doors close as long as player do some quest?
Reply With Quote
  #12   Link to this post, but load the entire thread.  
Old November 2nd, 2020 (5:21 AM).
mcferaligatr's Avatar
mcferaligatr mcferaligatr is offline
 
Join Date: Nov 2018
Posts: 120
I made a little example where the player cannot enter the house before picking up a Pokeball. For the script I used variable number 4027 and for the Pokeball person ID (or a flag) I used 210.

First the script for the Pokeball:

#dynamic 0x800000
#org @start

hidesprite 0xd
setflag 0x210

fanfare 0x13f
givepokemon 0x1 0x5 0x0 0x0 0x0 0x0

msgbox @obtain 0x6
release
end

#org @obtain
= Obtained a Bulbasaur!

'-------------------------------------------
This script will give us a level 5 Bulbasaur and we can then enter the house.
'-------------------------------------------

Now the script that checks whether or not we picked up the Pokeball:

#dynamic 0x800000
#org @start
lock
spriteface 0xff face_up '------ player faces upwards

checkflag 0x210 '------ checks if we picked the Pokeball
if 0x1 goto @pass

msgbox @t1 0x6

applymovement 0xff @m1 '----- moves the player downwards if we didn't pick the Pokeball
waitmovement 0x0
release
end

'-----------

#org @m1
#raw 0x10
#raw 0xfe

'-----------

#org @pass
msgbox @done 0x6
setvar 0x4027 0x1 '------------ If we have picked the Pokeball, the event no longer happens (we set variable value to 0x1)
release
end

'-----------

#org @t1
= I can't enter the\nhouse without taking the\lPokeball first.

#org @done
= I can now enter the house.

'--------------------------------
Reply With Quote
  #13   Link to this post, but load the entire thread.  
Old November 2nd, 2020 (6:17 AM).
MaxiDuck MaxiDuck is offline
 
Join Date: Nov 2017
Posts: 22
Ok but when I want to change the pick up pokeball to talk to person I must only change first script?
Reply With Quote
  #14   Link to this post, but load the entire thread.  
Old November 2nd, 2020 (6:38 AM).
MaxiDuck MaxiDuck is offline
 
Join Date: Nov 2017
Posts: 22
WORK! thats magic thank you again
Reply With Quote
  #15   Link to this post, but load the entire thread.  
Old November 2nd, 2020 (6:38 AM).
mcferaligatr's Avatar
mcferaligatr mcferaligatr is offline
 
Join Date: Nov 2018
Posts: 120
Yes, if you want to change the Pokeball event to a NPC talking event, you could run a script like this:

#dynamic 0x800000
#org @start
lock
faceplayer
checkflag 0x210
if 0x1 goto @alreadytalked
msgbox @t1 0x6
setflag 0x210
release
end

'-----------

#org @alreadytalked
msgbox @t2 0x6
release
end

'-----------

#org @t1
= Now you can enter the house.

#org @t2
= You already talked to me.

'----------

Note that here we are using setflag 0x210 so that the NPC knows that we talked to it, and once you talk to the NPC (set flag 210), you can enter the house. If you don't want the NPC do disappear, do not put the flag 210 as the "person ID" in Advance map.

If you wanted to make the NPC disappear however, you could use the command hidesprite 0x(person event number) with setflag (person ID)
Reply With Quote
  #16   Link to this post, but load the entire thread.  
Old November 2nd, 2020 (7:04 AM).
MaxiDuck MaxiDuck is offline
 
Join Date: Nov 2017
Posts: 22
ok I made people script thx
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.