Script Help Thread (DO NOT REQUEST SCRIPTS) Page 112

Started by HackMew December 20th, 2008 5:10 AM
  • 625740 views
  • 9682 replies

Omega Zero

Is back...

Age 25
Male
I'm always living aren't I?
Seen December 4th, 2016
Posted October 6th, 2013
444 posts
13.4 Years
Sorry, should have said- the only way I script is through AdvanceMap (ie, set XSE as my script editor, add the event to the map, and say "Open Script"). So I definately didn't open or compile it wrong- unless.. When I compile them, I hit "copy", and paste the new offset in the "script offset" box in AdvanceMap. I think that's correct, though, isn't it? Here's what I mean-
 #dynamic 0x(generic)
#org @start
When I click Compile, the offset for "#org @start" is highlighted, I copy and paste it. Is that the correct way, yeah?
And to Quickster, I've tried that multiple times, I'm stumped, it does the same each time. Thanks to you both for trying, though.
Hmm that's strange :S what else have you tryed?
Age 29
Male
Ireland
Seen 1 Week Ago
Posted April 6th, 2023
1,655 posts
14.1 Years
Hmm that's strange :S what else have you tryed?
Well, if you mean what other scripts have I tried, only the ones named, ie, Signposts, People and Yes/No boxes. I didn't even add my own text, I copied the examples.
However, it did work when I just edited a signpost (because I knew you had to keep the text shorter than the original if you were just editing, so I did, and it worked).
If you meant what other solutions have I tried... Well, trying different Dynamic offsets and redoing the scripts, I guess. I think my problem could be the dynamic offset? I mean, I do find it with a free space finder, but the script only seems to work if I edit one's text. So the dynamic could be it?

- - - - - - - - - -
Age 30
Male
Seen July 22nd, 2012
Posted June 10th, 2012
516 posts
13.8 Years
Wow, it's been awhile since I was last here, which could be a good or bad thing, I suppose...
Anyway, question: I'm using the changemaptile command for the first time, do I need to do anything special to make the change permanent? I'm assuming I'll at least have to change the flag...
Oh, and I'm using the warp command again, do I need to convert the map/map bank numbers to hex, or can I just use the normal decimal numbers?
These are, of course, done in XSE.

Oh, and one more thing. What's wrong with this level script? I know that there's no setvar, but that's because I want it to repeat every time you enter the map. At the moment it's not doing anything though.

Spoiler:

#dynamic 0x800000
#org @automated
lockall
msgbox @welcome 0x6
releaseall
end
#org @welcome
= Welcome to the Utopia Project\nAutomated Pok\h1bmon center.\pPlease step up to the counter\nand speak to the billboard.\pHave a nice day!


Ok, so I'm hacking Emerald. I've read some tutorials, and I've got the basics down, such as simple message scripts, signs, and Yes/no choiceboxes. I was able to do these no problem before (as in a few weeks ago) but now that I've tried again, none of them work. Today, I even followed diegoisawesome's tutorial exactly (or thethethethe, whoever did one on XSE). I tried copying in the example scripts, typing them exactly, and yet when I press "A" on any sign or person the script is assigned to, all I get is an endless string of these characters:
qÀF
A space is also present, after the F. They just continue until I'm forced to reset. I really don't know what goes wrong, as I definately copy exactly what the example scripts say. For my dynamic offsets, I use the free space finder in AdvanceMap, click "OK" and use the first offset shown. Does anyone have any idea as to what I'm doing wrong? (because I really could get it to work before. Really. *rocks back and forth*). If you can solve this, you get a cookie :P
Now, as for your problem, have you tried just going with 800000+ offsets, instead of using the FSF? That's probably not the issue, but the problem really makes no sense... I don't get why it would do that.
A few more questions...
What script were you using, exactly?
Are you positive that the rom is clean?
If you decompile the script after compiling it, is the decompiled script any different from the original?
I'll try to help, but it sounds like this is out of my league, and I've never actually hacked Emerald before, just FR.
Credit for my avatar goes to the Lego company. :)
Male
Woodbridge, ON
Seen September 22nd, 2013
Posted October 27th, 2012
36 posts
15.2 Years
Hey everyone, I'm new to scripting so please don't laugh at my inability to script.
Game: Pokemon Fire Red Hack
Type: Trigger
Editor: XSE
Script:
Spoiler:

'---------------
#org 0x34EB8C
lock
textcolor 0x0
msgbox 0x834EB9C MSG_KEEPOPEN '"[player]: Woah!\nWhere am I?"
closeonkeypress
applymovement MOVE_PLAYER 0x834EBAC
releaseall
end

'---------
' Strings
'---------
#org 0x34EB9C
= [player]: Woah!\nWhere am I?

'---------
' Movement
'---------
#org 0x34EBAC
#raw 0x62 'Exclamation Mark (!)
#raw 0x2F 'Face Left (Delayed)
#raw 0x30 'Face Right (Delayed)
#raw 0x2E 'Face Up (Delayed)
#raw 0x2D 'Face Down (Delayed)
#raw 0xFE 'End of Movements

Screenshots and/or Videos: Can't add links because of post count.
So this is my script. The problem is that I want it to activate after your intro with Oak. Also when I step on the trigger it just freezes everything.

NarutoActor

The rocks cry out to me

Age 29
Female
Brooklyn/Marlboro
Seen April 2nd, 2016
Posted March 22nd, 2016
1,974 posts
14.4 Years
are the setting set right? Like unknown 0003 and a var number. also if you want that applymovement to work you need to add a waitmovement 0x0
~There are those people who understand hex, F the rest
Male
Seen July 26th, 2010
Posted June 2nd, 2010
25 posts
14.4 Years
Game: FireRed
Event Type: Person
Editor: XSE

Whenever I compile this into XSE...
Spoiler:
'---------------
#org 0x71D888
checkflag 0x888
if 0x1 goto 0x871D8D0
setflag 0x888
msgbox 0x871D9FC MSG_FACE '"Hmm?\pHello, my name is LANCE. Peo..."
setvar 0x8003 0x1
setvar 0x4001 0x93
givepokemon 0x93 0x19 0xD8 0x0 0x0 0x0
fanfare 0x101
preparemsg 0x87B0000 '"[black_fr][player] obtained a DRAT..."
waitmsg
waitfanfare
bufferpokemon 0x0 0x93
bufferboxname 0x0 0x4037
bufferpokemon 0x1 0x4001
msgbox 0x87B012C MSG_KEEPOPEN '"[black_fr][buffer2] was transferre..."
fadescreen 0x1

closeonkeypress
hidesprite 0xF
fadescreen 0x0
release
end

'---------------
#org 0x71D8D0
fadescreen 0x1
closeonkeypress
hidesprite 0xF
fadescreen 0x0
release
end


'---------
' Strings
'---------
#org 0x71D9FC
= Hmm?\pHello, my name is LANCE. People\nrefer to me as ["]the Dragon Master".\pIt seems you have found my\nsecret place.\pThis is where I buried my\nDRAGONITE when it died.\pIt was my first POKéMON.\pYou deserve something for coming\nhere. Take this POKéMON.

#org 0x7B0000
= [black_fr][player] obtained a DRATINI!

#org 0x7B012C
= [black_fr][buffer2] was transferred to\nBILL'S PC.\pIt was placed in \nBOX ["][buffer1]."\p[blue_fr]Take care of that POKéMON.\pI have feeling we will meet\nagain sometime in the future.

...the game changes it to this...
Spoiler:
'---------------
#org 0x71D888
checkflag 0x888
if 0x1 goto 0x871D8D0
setflag 0x888
msgbox 0x871D9FC MSG_FACE '"Hmm?\pHello, my name is LANCE. Peo..."
setvar 0x8003 0x1
setvar 0x4001 0x93
givepokemon 0x93 0x19 0xD8 0x0 0x0 0x0
fanfare 0x101
preparemsg 0x87B0000 '"[black_fr][player] obtained a DRAT..."
waitmsg
waitfanfare
bufferpokemon 0x0 0x93
bufferboxname 0x0 0x4037
bufferpokemon 0x1 0x4001
loadpointer 0x0 0x977B012C
nop1

closeonkeypress
hidesprite 0xF
fadescreen 0x0
release
end

'---------------
#org 0x71D8D0
fadescreen 0x1
closeonkeypress
hidesprite 0xF
fadescreen 0x0
release
end


'---------
' Strings
'---------
#org 0x71D9FC
= Hmm?\pHello, my name is LANCE. People\nrefer to me as ["]the Dragon Master".\pIt seems you have found my\nsecret place.\pThis is where I buried my\nDRAGONITE when it died.\pIt was my first POKéMON.\pYou deserve something for coming\nhere. Take this POKéMON.

#org 0x7B0000
= [black_fr][player] obtained a DRATINI!

What's wrong? And this is a totally different thing than my last script I posted here. Here's hoping someone will help this time...

NarutoActor

The rocks cry out to me

Age 29
Female
Brooklyn/Marlboro
Seen April 2nd, 2016
Posted March 22nd, 2016
1,974 posts
14.4 Years
make sure your using the most up-to-date xse. Also try re pointing the offsets with the original script.
~There are those people who understand hex, F the rest
Male
Seen July 26th, 2010
Posted June 2nd, 2010
25 posts
14.4 Years
make sure your using the most up-to-date xse. Also try re pointing the offsets with the original script.
I have the newest version, and I changed the offset of that message box, but no dice. Is there a different way of writing that that I can try?
Age 30
Male
Seen July 22nd, 2012
Posted June 10th, 2012
516 posts
13.8 Years
...hm, no help for me it seems. Ah well, I'll just stick around here and act pitiful until someone shows me some mercy.
@Shadow_Knux, have you checked to see if the script works in-game? Might be worth a try. Also, I'm sure that flag 0x888 is used in the game (if this is an FR hack), and you might want to check your variables too. It may be that those are messing this up somehow.
...frankly, I have no clue what's wrong.
Credit for my avatar goes to the Lego company. :)
Male
Seen July 26th, 2010
Posted June 2nd, 2010
25 posts
14.4 Years
...hm, no help for me it seems. Ah well, I'll just stick around here and act pitiful until someone shows me some mercy.
@Shadow_Knux, have you checked to see if the script works in-game? Might be worth a try. Also, I'm sure that flag 0x888 is used in the game (if this is an FR hack), and you might want to check your variables too. It may be that those are messing this up somehow.
...frankly, I have no clue what's wrong.
Yeah, I tried and it doesn't work. But thanks for the heads-up on the flag, I'll try it. But, the variables worked fine before I added in the final msgbox and fadescreen/hidesprite that screwed everything up...
Age 30
Male
Seen July 22nd, 2012
Posted June 10th, 2012
516 posts
13.8 Years
msgbox 0x87B012C MSG_KEEPOPEN '"[black_fr][buffer2] was transferre..."
fadescreen 0x1
closeonkeypress
Ooh! I think this might be your problem, here. closeonkeypress needs to come before fadescreen, otherwise it gets mixed up in the MSG command, I think.
Maybe not, anyway, let me know if it works.
...
Actually, this is kind of funny. I made a script that's pretty the same sort of event.
Credit for my avatar goes to the Lego company. :)

Yusshin

♪ Yggdrasil ♪

Age 30
Quebec, Canada
Seen May 13th, 2013
Posted May 13th, 2013
2,414 posts
13.8 Years
I changed the Mom script but it doesn't actually update even after I recompile. I use XSE; I'm also a nub. This is the script (probably filled with errors) that I wanted to replace it with to see what would happen:

#dynamic 0x800000

#org @start
lock
faceplayer
textcolor 0x01
checkflag 0x200
if 0x1 goto @violaiswaiting
msgbox @1 0x6
applymovement 0x01 @move
waitmovement 0x0
applymovement 0xFF @move2
pause 0x30
release
end

#org @1
= Mom: Oh \v\h01! You're finally awake!\pProfessor Viola came by earlier;\n she wanted to talk to you but\n you were asleep.\pYou should go visit her.\n It appeared urgent.
setflag 0x200

#org @violaiswaiting
= Mom: You should go visit Viola;\n she should be in her laboratory.

#org @move
#raw 0x01
#raw 0xFE

#org @move2
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0xFE
but it doesn't even make it in-game, or it appears that it doesn't; ever since I tried recompiling it, launching the ROM in Visual Boy Advance produces an error (something about some sub-[blargh] not being installed).

:<


Polaret | Fourette | Ecuret | Axew | Zorua | Nanette [Shiny]
"My scar makes me sassy, child!"
The Big Bang Theory Fan Club - Click To Join!
The French Club

Satoshi Ookami

Memento Mori

Age 30
Male
Abyss of Time, Great Seal
Seen August 5th, 2018
Posted July 3rd, 2018
14,253 posts
14.8 Years
The setflag command must not be in string part of script ;)
You have to put it before end command :)
ROM hacking FAQ - Read before asking how to play a hack.

Anime List | PSN Trophy List
Age 30
Male
Seen July 22nd, 2012
Posted June 10th, 2012
516 posts
13.8 Years
@Yusshin, also, recompiling is a bad idea. Try just compiling it normally for best results.
...
Erm, can someone please look at my question a few posts back? The main thing I need to know is whether I need to do anything special in order to make a changemaptile command permanent.
Credit for my avatar goes to the Lego company. :)

Sierraffinity

Retiring from Pokémon ROM hacking

Age 26
she/her
Somewhere the rains of Africa can be blessed
Seen January 8th, 2023
Posted December 26th, 2022
1,071 posts
15.4 Years
The main thing I need to know is whether I need to do anything special in order to make a changemaptile command permanent.
You need to make a level script in your map that has setmaptile in it. Read my XSE tutorial (with the level script tut in a link at the top) or cooley's tutorial to make a level script.
Restarted and revamped.

Public alpha out now!
Age 30
Male
Seen July 22nd, 2012
Posted June 10th, 2012
516 posts
13.8 Years
You need to make a level script in your map that has setmaptile in it. Read my XSE tutorial (with the level script tut in a link at the top) or cooley's tutorial to make a level script.
Thanks, I'll do that. Your tut is awesome btw, I've had it open for so long that my computer would probably crash or something if I tried to close it :P.
...wait, one more question about that. So am I just going to do this,
checkflag (whichever I used for the changemaptile event)
if 0x1 got @blabla

#org @blabla
changemaptile (etcetera)
release
end
??
And yes, I realize that script was retarded, but it's just for example purposes.
Oh, and also I'll put in the setvar and everything of course.
Credit for my avatar goes to the Lego company. :)
Male
Seen July 26th, 2010
Posted June 2nd, 2010
25 posts
14.4 Years
Ooh! I think this might be your problem, here. closeonkeypress needs to come before fadescreen, otherwise it gets mixed up in the MSG command, I think.
Maybe not, anyway, let me know if it works.
...
Actually, this is kind of funny. I made a script that's pretty the same sort of event.
Nope. Still being autocorrected. At this point, I'd be fine with just leaving the sprite visible, but having him not be there if you come back. Would you happen to know how to do that?
Age 30
Male
Seen July 22nd, 2012
Posted June 10th, 2012
516 posts
13.8 Years
Nope. Still being autocorrected. At this point, I'd be fine with just leaving the sprite visible, but having him not be there if you come back. Would you happen to know how to do that?
Darn. Oh well, just remove the fadescreens and he should be gone when you come back, or at least, that's what I inadvertantly did to myself in one of my scripts :P. Of course, it might just make him vanish without the fadescreen, if it works properly.
Credit for my avatar goes to the Lego company. :)
Male
Seen July 26th, 2010
Posted June 2nd, 2010
25 posts
14.4 Years
Darn. Oh well, just remove the fadescreens and he should be gone when you come back, or at least, that's what I inadvertantly did to myself in one of my scripts :P. Of course, it might just make him vanish without the fadescreen, if it works properly.
I removed the fadescreen and such, but I still get my msgbox changed to loadpointer. This is becoming quite annoying, as that HAD worked before.

Thank you for being so helpful though.
Age 30
Male
Seen July 22nd, 2012
Posted June 10th, 2012
516 posts
13.8 Years
I removed the fadescreen and such, but I still get my msgbox changed to loadpointer. This is becoming quite annoying, as that HAD worked before.

Thank you for being so helpful though.
...
That's it, I am never, ever, hacking Emerald. That rom sounds absolutely demonic...
Anyhoo, can someone show me the basic structure of a changemaptile level script? The level script tuts don't really say much on cmt.
Basically, I've got an event in the map that has a changemaptile, and sets flag 0x1011 right afterwards. I need the changemaptile to be permanent, so that if I leave the map and re-enter it will still be there. So, for the level script, do I need to basically put "checkflag 0x1011, if 0x1 goto @keepthetreethere?"
Credit for my avatar goes to the Lego company. :)

Yusshin

♪ Yggdrasil ♪

Age 30
Quebec, Canada
Seen May 13th, 2013
Posted May 13th, 2013
2,414 posts
13.8 Years
I changed the Mom script but it doesn't actually update even after I recompile. I use XSE; I'm also a nub. This is the script (probably filled with errors) that I wanted to replace it with to see what would happen:

#dynamic 0x800000

#org @start
lock
faceplayer
textcolor 0x01
checkflag 0x200
if 0x1 goto @violaiswaiting
msgbox @1 0x6
applymovement 0x01 @move
waitmovement 0x0
applymovement 0xFF @move2
pause 0x30
release
end

#org @1
= Mom: Oh \v\h01! You're finally awake!\pProfessor Viola came by earlier;\n she wanted to talk to you but\n you were asleep.\pYou should go visit her.\n It appeared urgent.
setflag 0x200

#org @violaiswaiting
= Mom: You should go visit Viola;\n she should be in her laboratory.

#org @move
#raw 0x01
#raw 0xFE

#org @move2
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0xFE
but it doesn't even make it in-game, or it appears that it doesn't; ever since I tried recompiling it, launching the ROM in Visual Boy Advance produces an error (something about some sub-[blargh] not being installed).

:<
Where do I put the "setflag x200"? and how do I test what it does (and if correctly) in-game?


Polaret | Fourette | Ecuret | Axew | Zorua | Nanette [Shiny]
"My scar makes me sassy, child!"
The Big Bang Theory Fan Club - Click To Join!
The French Club
Age 30
Male
Seen July 22nd, 2012
Posted June 10th, 2012
516 posts
13.8 Years
Okay, so ignore the sub-blargh error when you start the rom, that's just a clock issue that won't affect your script. Your setflag needs to come right before the end of your script, after the pause 0x30 would be great. However, 0x200 isn't a good flag to use, are you aiming for a specific event flag? 0x1000 is a lot safer, as it isn't used by the game.
Credit for my avatar goes to the Lego company. :)

KotovSyndrome_

Consumer of many asparagus.

Male
Wales
Seen July 8th, 2012
Posted August 20th, 2010
57 posts
14.9 Years
Game: LG
Type: Person script
Editor: XSE
Script:
Spoiler:
#dynamic 0x800000

#org @main
lock
faceplayer
checkflag 0x828
if 0x1 goto @Given
msgbox @textdata 0x5
compare LASTRESULT 0x1
if 0x1 goto @Yes
msgbox @No 0x2
setflag 0x828
release
end

#org @Yes
msgbox @Yes2 0x2
copyvarifnotzero 0x8000 0x106
copyvarifnotzero 0x8001 0x1
callstd 0x0
release
end

#org @textdata
= Hello!\pDo you like fishing?

#org @No
= Well, you obviously haven't\ntried it then!

#org @Yes2
= Great! I've got a spare rod you\ncan have!\pHere you go.

#org @Given
msgbox @given1 0x06
release
end

#org @given1
= To fish, just go to the water's\nedge, pull out your rod, and fish\l'til your heart's content![/b]


The script is meant to make the guy give you an old rod if you say yes, and then when you speak to him after you've got the rod, he says "To fish..."
Thanks

Time out, let's stop and think this through,
We've all got better things to do,
Than talk in circles, run in place,
Answers inches from our face.