Advertiser Content

Help Thread Script Help Thread Page 42

Started by Spherical Ice November 29th, 2014 12:35 PM
  • 64637 views
  • 1049 replies
Male
Texas
Seen January 13th, 2017
Posted October 25th, 2016
65 posts
3 Years
The dynamic command basically will automatically find free space for every individual section of your script, which gets denoted by an @ sign and a random name of your choosing.

So to repoint your whole script, for example, you'd replace all of the offsets you see with @ and a name, with the dynamic command at the beginning.

So an example of repointing the whole script would be:

Spoiler:

#dynamic 0x800000
#org @script1
lockall
faceplayer
checkflag 0x82c
jumpif 0x1 @script2
loadpointer @script3
callstd 0x4
releaseall
end

#org @script2
setvar 0x8004 0x1
setvar 0x8005 0x0
special 0x173
callstd 0x4
releaseall
end

#org @script3
= Oh God no...\nIt escaped the containment\pbarrier!


When you compile this in XSE, it'll give you offsets for each part, and you want to copy the offset for "scriptone" and paste it in for the character in Advance Map.

Also, just as a side note, if the only thing you changed is the dialogue...the offset for the dialogue (0x18ebe6) would be the only one you need to change. You'd only need to repoint the bigger offsets if you added completely new commands or something. I've never played Creepy Black so I have no clue what you added and what was originally there.
Got it working now, thank you! Right now I'm just modifying what NPC's say, the original game was never finished, so there's a LOT of room to improve where the dialog is concerned. I would like to make changes to the environment at some point, but that's still beyond my skill level. Ideally I would like to add some type of weather overlay with a thick, tinted fog for exterior areas.
Male
Texas
Seen January 13th, 2017
Posted October 25th, 2016
65 posts
3 Years
That feature is actually built into Advance Map. All you have to do is click the Header tab and there's a drop-down menu for weather.
I saw that, but the options don't give the results I'd like. I haven't looked into ways to customize the weather stuff yet.
Male
Seen September 9th, 2018
Posted September 9th, 2018
38 posts
3.8 Years
So... I don't actually have a script to critique, but I do have a question before I try one. What memory addresses are accessible and what addresses are protected? JPAN's thread gives some nice information. What I want to do is access 0x0300500C. This gives a pointer that (in my save at least, though a quick test indicates this might be true of all ROMs) leads to 0x020245B4. From there, a 28 byte offset leads to 0x020245DC, which contains the data for caught Pokemon. I want to be able to -ideally without any ASM needed - access a particular bit to see if a particular species has been caught. Is this possible? Alternatively, can I just check for the species in the party?

I'm not sure where to start. A look at a few scripts for seeing Eevee plus its evolutions and Articuno outside of battle, and their scripts all contain:

setvar 0x8004 0x[species index value]
special 0x163

I must assume that's something to do with setting a seen flag, but I doubt it can work in reverse.

Zervais

Island Kahuna

Age 24
Male
Norfolk, England
Seen December 23rd, 2016
Posted November 15th, 2016
259 posts
3.1 Years
I'm looking to give my player a Shinx but when I attempt to use the script in game, it crashes, the colours/screen glitching up and I can't move. This is the script I'm using:

Spoiler:
'---------------
#org 0x74007F
lock
checkflag 0x250
if 0x1 goto 0x87400B9
setflag 0x828
countpokemon
compare LASTRESULT 0x6
if 0x1 goto 0x87400BB
givepokemon 0x403 0xF 0x62 0x0 0x0 0x0
setflag 0x250
bufferpokemon 0x0 0x403
preparemsg 0x87400EF '"You got a [buffer1]!"
fanfare 0x101
waitmsg
waitfanfare
waitkeypress
release
end

'---------------
#org 0x7400B9
release
end

'---------------
#org 0x7400BB
msgbox 0x87400C5 MSG_KEEPOPEN '"You don't have enough room in your..."
release
end


'---------
' Strings
'---------
#org 0x7400EF
= You got a [buffer1]!

#org 0x7400C5
= You don't have enough room in your party.


The same script will work with any Pokémon up to 386 but I'm using Artificial Red which includes the full 721 Pokémon, which I've tested in battle and they show up fine.

colonelsalt

recovering lurker

Age 21
Male
London
Seen 10 Hours Ago
Posted 1 Week Ago
92 posts
6.9 Years
According to this fellow, the current map and map bank are stored at 0x0203F3A8 and 0x0203F3A9 respectively. A quick check in VBA's memory viewer confirms that this is correct.

Using comparefarbytetobyte against these locations to check if the player is in a specific map does not seem to work, however.

That is, the script below, which is meant to check if the player is in the Rock Tunnel (bank 0x1, map 0x51 and 0x52), always jumps to the @notInCave part.

Spoiler:
#dynamic 0x800000

#org @main
comparefarbytetobyte 0x0203F3A9 0x1
if 0x1 goto @check2
goto @notInCave
end

#org @check2
comparefarbytetobyte 0x0203F3A8 0x51
if 0x1 goto @lightUp
comparefarbytetobyte 0x0203F3A8 0x52
if 0x1 goto @lightUp
goto @notInCave
end

#org @lightUp
sound 0x60
lighten 0x0
darken 0x0
setflag 0x806
checksound
msgbox @lightText MSG_KEEPOPEN
closeonkeypress
end

#org @notInCave
msgbox @noCaveText MSG_KEEPOPEN
closeonkeypress
end

#org @lightText
= The Flashlight lit up the cave!

#org @noCaveText
= [player] switched on the\nflashlight.\p[.]\pBut it was not needed!


Have I simply misunderstood how the comparefarbytetobyte command works? What seems to be the issue here?


EDIT: Hahahaha goody goodness. Seems like the locations are simply switched around; 0x0203F3A8 contains the bank and 0x0203F3A9 the map. Good day!
Male
Seen September 9th, 2018
Posted September 9th, 2018
38 posts
3.8 Years
I'm looking to give my player a Shinx but when I attempt to use the script in game, it crashes, the colours/screen glitching up and I can't move. This is the script I'm using:

Spoiler:
'---------------
#org 0x74007F
lock
checkflag 0x250
if 0x1 goto 0x87400B9
setflag 0x828
countpokemon
compare LASTRESULT 0x6
if 0x1 goto 0x87400BB
givepokemon 0x403 0xF 0x62 0x0 0x0 0x0
setflag 0x250
bufferpokemon 0x0 0x403
preparemsg 0x87400EF '"You got a [buffer1]!"
fanfare 0x101
waitmsg
waitfanfare
waitkeypress
release
end

'---------------
#org 0x7400B9
release
end

'---------------
#org 0x7400BB
msgbox 0x87400C5 MSG_KEEPOPEN '"You don't have enough room in your..."
release
end


'---------
' Strings
'---------
#org 0x7400EF
= You got a [buffer1]!

#org 0x7400C5
= You don't have enough room in your party.


The same script will work with any Pokémon up to 386 but I'm using Artificial Red which includes the full 721 Pokémon, which I've tested in battle and they show up fine.
You're giving the wrong Pokemon. The Pokemon's number needs to be its index value in hexadecimal, not base 10. 403 in hex in that script means the game is giving you the 1027th Pokemon. I'm not actually sure what Artificial Red is doing in terms of index values (there are 25 Missingnos between Celebi and Treecko, and they might have been turned into newer Pokemon or ignored entirely), but Shinx is probably 193 or 1A4 (403 and 403+25, respectively, in hexadecimal). Try 1A4 first and see what happens.

esperance

Age 22
Male
Ohio
Seen 1 Week Ago
Posted June 23rd, 2019
3,827 posts
9.5 Years
Hello there! this is my problem:
In any script i write, every time i use the hidesprite command, the sprite disappears but reappears again after the player moves one step. How can i make a sprite disappear completely?
In order to make the sprite disappear permanently you need to set a flag that is linked with that event.

First select a flag to use, and then set that event's Person ID to the flag as well. When the flag is set that person event will be disabled.
What are you so afraid of?

Anthroyd

Age 21
Male
United States
Seen 7 Hours Ago
Posted 18 Hours Ago
183 posts
3.3 Years
Hello there! this is my problem:
In any script i write, every time i use the hidesprite command, the sprite disappears but reappears again after the player moves one step. How can i make a sprite disappear completely?
Adrift's response is totally correct, but I wanted to jump in and direct you here:
https://www.youtube.com/watch?v=II4_T3MCnLo&index=11&list=PLfI5DBI4tNyLBYGNhf1Ee8cgdmMtiilps

I explain your problem in great detail in the above video, including hidesprite, showsprite, flags, and variables.
Pokémon Generation III ROM Hacking
Video Series

Pokémon Dreary

Discord

loster313

Male
Norway
Seen December 5th, 2016
Posted November 16th, 2016
52 posts
4.5 Years
Hei!
im working on my rom hack on firered, and i have come to the place where the bicycle road are. And i was wondering if there was any possible way to check if the bicycle is acctivated, and then perform an action.

i tried make one lokking like this:
Spoiler:

#dyn 0x740000
#org @start
lock
checkspecial 0x157
if true jump @after
release
end

#org @after
applymovment PLAYER @m
pauseevent 0x0
release
end

#org @m
m run_up run_up end


but ofcourse the 'checkspecial' isnt aceptning by the PSKV console. because there isnt any thinks that is checkspecial. could i got som help, to find a working script that checks if the bicycle is activated. and then perform an action. not a script that checks is the player has the bicycle in the bag.
Thank you in beforehand :D

Regards
Loster31345

BluRose

blu rass

Age 18
Male
rip x
Seen 2 Weeks Ago
Posted July 10th, 2019
763 posts
5.4 Years
Spoiler:
Hei!
im working on my rom hack on firered, and i have come to the place where the bicycle road are. And i was wondering if there was any possible way to check if the bicycle is acctivated, and then perform an action.

i tried make one lokking like this:
Spoiler:

#dyn 0x740000
#org @start
lock
checkspecial 0x157
if true jump @after
release
end

#org @after
applymovment PLAYER @m
pauseevent 0x0
release
end

#org @m
m run_up run_up end


but ofcourse the 'checkspecial' isnt aceptning by the PSKV console. because there isnt any thinks that is checkspecial. could i got som help, to find a working script that checks if the bicycle is activated. and then perform an action. not a script that checks is the player has the bicycle in the bag.
Thank you in beforehand :D

Regards
Loster31345
"checkitem 0x168 0x1"
checks if item index 0x168 (bicycle) is in the bag at quantity 1; returns 0x1 to var 0x800D if it has 1 or more in the bag, 0x0 if it has less in the bag
am i cool yet

loster313

Male
Norway
Seen December 5th, 2016
Posted November 16th, 2016
52 posts
4.5 Years
"checkitem 0x168 0x1"
checks if item index 0x168 (bicycle) is in the bag at quantity 1; returns 0x1 to var 0x800D if it has 1 or more in the bag, 0x0 if it has less in the bag
im sorry, i mentioned it in my request. that i need help that checks if the bicycle is activated.
NOT that its in the bag

regards
Loster31345

BluRose

blu rass

Age 18
Male
rip x
Seen 2 Weeks Ago
Posted July 10th, 2019
763 posts
5.4 Years
im sorry, i mentioned it in my request. that i need help that checks if the bicycle is activated.
NOT that its in the bag

regards
Loster31345
omg, so sorry!
you can use a flag for this, just set it after using special 0x157~
you can probably check a certain bit in the ram/maybe there already is a flag set for this, but i currently do not have access to my computer to check~
am i cool yet

loster313

Male
Norway
Seen December 5th, 2016
Posted November 16th, 2016
52 posts
4.5 Years
omg, so sorry!
you can use a flag for this, just set it after using special 0x157~
you can probably check a certain bit in the ram/maybe there already is a flag set for this, but i currently do not have access to my computer to check~
:D it dosent matter.
i like your idea, but the bicycle can also be activated throught the bag. what sud i do about that?

regards
Loster31345

BluRose

blu rass

Age 18
Male
rip x
Seen 2 Weeks Ago
Posted July 10th, 2019
763 posts
5.4 Years
:D it dosent matter.
i like your idea, but the bicycle can also be activated throught the bag. what sud i do about that?

regards
Loster31345
just a hunch (still in school ToT), but check out the ram bytes at 02037078 - 0203707E in vba's memory viewer.
02037079 has to do with the bike if i remember correctly, see if it gets set to a specific value when biking~
am i cool yet

loster313

Male
Norway
Seen December 5th, 2016
Posted November 16th, 2016
52 posts
4.5 Years
just a hunch (still in school ToT), but check out the ram bytes at 02037078 - 0203707E in vba's memory viewer.
02037079 has to do with the bike if i remember correctly, see if it gets set to a specific value when biking~
ok, but what can i do whit the bytes?

BluRose

blu rass

Age 18
Male
rip x
Seen 2 Weeks Ago
Posted July 10th, 2019
763 posts
5.4 Years
ok, but what can i do whit the bytes?
don't know if pksv has the same stuff but command 0x1F (comparefarbytetobyte) has parameter [address] [byte to be compared to]

comparefarbytetobyte 0x02037079 0x[value set when on bike according to mem viewer]
if 0x5 goto @whateveryourfuncis
am i cool yet

DyingWillFlareon

Burning Candle

Age 20
Female
Under a bucket
Seen December 6th, 2017
Posted December 6th, 2017
4,293 posts
4.8 Years
Edit: nevermind, turned it into two and it works now~
POKECOMMUNITY'S DREAM WORLDDYINGWILLFLAREON

*For you are all children of light, children of the day. We are not of the night nor of the darkness. So then let us not sleep, as others do, but let us keep awake and sober. -1Thessalonians 5:5-6
#TeamTrivia

loster313

Male
Norway
Seen December 5th, 2016
Posted November 16th, 2016
52 posts
4.5 Years
don't know if pksv has the same stuff but command 0x1F (comparefarbytetobyte) has parameter [address] [byte to be compared to]

comparefarbytetobyte 0x02037079 0x[value set when on bike according to mem viewer]
if 0x5 goto @whateveryourfuncis
thanks alot, it worked.

regards
Loster31345

PKMN Trainer Envy

"Time waits for no man."

Male
Texas
Seen July 22nd, 2017
Posted April 3rd, 2017
12 posts
2.9 Years
Hey everyone, I'm hoping you guys could help me figure something out (I hope this is an okay place to post this). I was over halfway done with my first ROM hack/mod when I came across an issue with the starters at the very beginning. Allow me to explain.

First things first, it's a Fire Red ROM. I've viewed all the tutorials on this issue that I can find through this site and Google itself and always fall short of the answer I'm seeking. At the beginning of the game, we all know the infamous introduction where Oak introduces himself and your rival, etc. You eventually get to his lab and he tells you to choose a starter, and when you do, that dialogue box pops up saying:
"You received (insert starter name here) from PROF. OAK."

I literally don't want to change a single thing from the original script besides the darn caps lock on his name (I HATE THAT THEY TALK LIKE THIS IN THE GAMES, MY OCD DRIVES ME INSANE). I'd given the Professor a different name and changed the overall dialogue via Advance Text, but alas, I cannot change that dialogue after you choose your starter as it is within the script of the item.

So, obviously it's a script for the Pokeball item that lies on the table. I've used every tutorial via XSE I can find to change that one dialogue box... All of which require me to make an entire new script. So, how can I copy the original script for the starter Pokeballs and simply change the ending dialogue box?
"Sky above me."

"Earth below me."

"Fire within me."

loster313

Male
Norway
Seen December 5th, 2016
Posted November 16th, 2016
52 posts
4.5 Years
Hey everyone, I'm hoping you guys could help me figure something out (I hope this is an okay place to post this). I was over halfway done with my first ROM hack/mod when I came across an issue with the starters at the very beginning. Allow me to explain.

First things first, it's a Fire Red ROM. I've viewed all the tutorials on this issue that I can find through this site and Google itself and always fall short of the answer I'm seeking. At the beginning of the game, we all know the infamous introduction where Oak introduces himself and your rival, etc. You eventually get to his lab and he tells you to choose a starter, and when you do, that dialogue box pops up saying:
"You received (insert starter name here) from PROF. OAK."

I literally don't want to change a single thing from the original script besides the darn caps lock on his name (I HATE THAT THEY TALK LIKE THIS IN THE GAMES, MY OCD DRIVES ME INSANE). I'd given the Professor a different name and changed the overall dialogue via Advance Text, but alas, I cannot change that dialogue after you choose your starter as it is within the script of the item.

So, obviously it's a script for the Pokeball item that lies on the table. I've used every tutorial via XSE I can find to change that one dialogue box... All of which require me to make an entire new script. So, how can I copy the original script for the starter Pokeballs and simply change the ending dialogue box?
Its vert simple i have done it my self. Just open one of the personevent on the table. In a script tool. At the bottom theres the text. Were its says the name. Just del the text AnD input your own. But remember to have the same lenght of the text as before. And compile it

Regards
Loster31345

PKMN Trainer Envy

"Time waits for no man."

Male
Texas
Seen July 22nd, 2017
Posted April 3rd, 2017
12 posts
2.9 Years
Its vert simple i have done it my self. Just open one of the personevent on the table. In a script tool. At the bottom theres the text. Were its says the name. Just del the text AnD input your own. But remember to have the same lenght of the text as before. And compile it

Regards
Loster31345
Thanks so much for responding so quickly! Would you mind pointing me in the right direction as to what script tool I should use? I only have XSE for scripting, and when I click on the "open script" button, it says I don't have one.
"Sky above me."

"Earth below me."

"Fire within me."

Advertiser Content