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 Help Thread (DO NOT REQUEST SCRIPTS) (https://www.pokecommunity.com/showthread.php?t=163576)

HackMew December 20th, 2008 5:10 AM

Script Help Thread (DO NOT REQUEST SCRIPTS)
 

A brief intro about the new script help concept

I've been following the Script Help thread since it began and after months of posts the conclusion I came was only one: there needs to be stricter and better rules. I'm not saying it will be really easy at first, but it's something it needs to be done.

Rules, what about them?

I'll post them in an unsorted order because any of them must be followed and all of them have the same importance. Of course, all forum rules apply.

General Rules

  • Always search before asking: someone may have gotten the same problem before you, therefore you would get the answer in no time.
  • Whenever you need a particular script example, just decompile some similar scripts and try messing around with them.
  • If you need help, ask for it nicely and never demand it.
  • If you don't get an answer soon, just wait patiently. If someone knows the answer, you'll get it posted eventually.
  • Do not ask the same questions over and over again.
  • If you want to say thanks, do it via VM/PM instead of spamming the thread.
  • This is not a script request thread, so you have to post your scripts, clearly explaining what they're supposed to do and what happens instead.

Posting Rules


  • Make sure you took a close look at the scripting tutorials before posting.
  • Always include all your scripts inside spoilers. This way people don't need to waste time scrolling the thread instead of trying to help.
  • Whenever you're posting your script, a couple of screenshoots or a video are useful to understand the problem. If you can, always use at least one of them.
  • Don't forget to include what ROM you're using. Flags and movements are different from game to game, for example.
  • While posting, always include the script type.

    Available types are:
    • Person event - those scripts that get executed when you talk to someone
    • Signpost
    • Trigger - walkable, green "S" on AM
    • Level script ¹

    So, for example, if someone needs help with a level script someone that doesn't know anything about them wouldn't even try helping.

  • Don't forget to specify what's the script editor you are using.
  • Whenever you see someone is missing some data from his post, report it rather then giving a generic answer.
  • Avoid answering if you're not truly sure about what you're saying. Wrong answers won't help anyone: even worser, someone may really think what you said is true. It's not about discouraging people from trying to help: it's about discouraging wrong knowledge.
The code below shows you the structure to use when asking for help here. You're not forced to follow it exactly as that, as long as you include all needed information.

Code:

[b]Game: [/b]
[b]Type: [/b]
[b]Editor: [/b]
[b]Script: [/b]
[spoiler]Script goes here[/spoiler]
[b]Screenshots and/or videos: [/b]


¹ To view the full level script, do the following:

Spoiler:
  • Open AM and load your ROM.
  • Enable the Professional Header View from the View menu.
  • Go to the Header tab and copy the Map Script Offset.
  • Open XSE and load the same ROM.
  • Paste in the offset you just copied.
  • Enable the Level Script option (the button on the very right on the toolbar) and decompile it.

Note: the rules listed above are subject to change without further notice.

Useful Links


Of course, if you're using XSE, reading the guide is a must ;)

Change Log

This is the place where the updates to this post will be stored.

Spoiler:

20/12/2008 - Thread started -- HackMew
21/12/2008 - Adjusted rules a little -- HackMew
25/12/2008 - Introducing the [SOLVED] tag -- HackMew
29/12/2008 - Updated the useful stuff -- HackMew
22/09/2009 - Removed the [SOLVED] part of the rules as no one ever cared -- HackMew
19/11/2009 - Restyled a little -- HackMew


shane2243 December 20th, 2008 2:15 PM

i just wanna know how i'd go about including a a script that means i cannot open a door untill i've spoken to birch after i beat may/brenden?

i want to basically lock the door till after birch has given me the pokedex, and the character's mom has given him/her the running shoes?


[edit]would i have to put a person script on the door, but with no player icon, and make it so the person script disappears after i have said item?[/edit]

пзо December 20th, 2008 3:16 PM

Quote:

Originally Posted by shane2243 (Post 4210193)
i just wanna know how i'd go about including a a script that means i cannot open a door untill i've spoken to birch after i beat may/brenden?

i want to basically lock the door till after birch has given me the pokedex, and the character's mom has given him/her the running shoes?


[edit]would i have to put a person script on the door, but with no player icon, and make it so the person script disappears after i have said item?[/edit]

What we would do here is:

#Org @Start

Setflag 0x1000

For the battle script, you know, the battle with brendan/may.
To keep the door locked we would

#Org @Start
Checkflag 0x1000 -

This cheks if the Setflag 0x1000 is Done yet. Make sure you dont use the same flags twice..

That was the battle..
Now the Running shoes:

#Org @Start
Setflag 0x82F

Now that should activate the running shoes..

#Org @start
Checkflag 82F

That checks if you have the running shoes activated..

Now the Pokedex.

#Org @start
Setflag 0x829

That Sets the Pokedex, you now have the pokedex in your menu.

#Org @start
Checkflag 0x829

Checks if the Pokedex is activated..

So here we are.

---
Pokedex Script

#Dynamic 0xoffset

#org @start
checkflag 0x829
if 0x0 goto @hey!
if 0x1 goto @end
end

#org @hey!
lock
msgbox @icant
boxset 0x6
applymovement 0xFF @back
waitmovement 0x0
release
end

#org @icant
= I can't go in there without\nmy pokedex

#org @back
#raw 0x00 0xFE

#org @end
release
end


---
Running shoes Script


#Dynamic 0xoffset

#org @start
checkflag 0x82F
if 0x0 goto @hey!
if 0x1 goto @end
end

#org @hey!
lock
msgbox @icant
boxset 0x6
applymovement 0xFF @back
waitmovement 0x0
release
end

#org @icant
= I can't go in there/nwithout my running shoes.

#org @back
#raw 0x00 0xFE

#org @end
release
end


putting them together is your job. [Its sooo easy]
And I never included the Battle with May/Brendan.. that would go into too much detail.
--
You should inderstand it now, if you dont, just read a tutorial.
This is the best one in my opinion:
http://www.pokecommunity.com/showthread.php?t=146174
Its called "Seth The Rom masters XSE scripting Tutorial"

Hope you Exel!
And good luck Scripting!

Chimchar 9 December 20th, 2008 3:31 PM

note:i want the mum to go to you and then the text but it does the text before the movement.

Game: fire red
Script Type: person script

Script:
Spoiler:

#org 0x8000AB
checkflag 0x828
if 0x0 goto 0x88000BC
if 0x1 goto 0x8800154
end


#org 0x8000BC
lock
msgbox 0x88000D2 '"Hey [player] how are you ? yes i kn..."
callstd 0x6
applymovement 0x1 0x880014F
waitmovement 0x0
release
end

#org 0x800154
release
end


#org 0x80014F
#raw 13 'Step Right (Normal)
#raw 11 'Step Up (Normal)
#raw 3 'Face Right
#raw FE 'End of Movements


#org 0x8000D2
= Hey [player] how are you ? yes i know\nit's cold in the dempsi region.\poh yeah pro.oak wants to see you\n about something.

Thrace December 20th, 2008 3:44 PM

Quote:

Originally Posted by shane2243 (Post 4210193)
i just wanna know how i'd go about including a a script that means i cannot open a door untill i've spoken to birch after i beat may/brenden?

i want to basically lock the door till after birch has given me the pokedex, and the character's mom has given him/her the running shoes?


[edit]would i have to put a person script on the door, but with no player icon, and make it so the person script disappears after i have said item?[/edit]

Theres a reason that this new thread was made. Its to avoid posts like this that don't provide enough information. Please use the form in the first post before you post. It'll make it easier for everyone.

Surf December 20th, 2008 3:45 PM

Quote:

Originally Posted by Lucario 9 (Post 4210404)
note:i want the mum to go to you and then the text but it does the text before the movement.

Game: fire red
Script Type: applymovement script

Script:
Spoiler:

#org 0x8000AB
checkflag 0x828
if 0x0 goto 0x88000BC
if 0x1 goto 0x8800154
end


#org 0x8000BC
lock
msgbox 0x88000D2 '"Hey [player] how are you ? yes i kn..."
callstd 0x6
applymovement 0x1 0x880014F
waitmovement 0x0
release
end

#org 0x800154
release
end


#org 0x80014F
#raw 13 'Step Right (Normal)
#raw 11 'Step Up (Normal)
#raw 3 'Face Right
#raw FE 'End of Movements


#org 0x8000D2
= Hey [player] how are you ? yes i know\nit's cold in the dempsi region.\poh yeah pro.oak wants to see you\n about something.

Ok i'll put th wrong things in bold
#dynamic 0x800000
#org @start
checkflag 0x900
if 0x0 goto @go
end


#org @go
lockapplymovement 0x1 @move
waitmovement 0x0
msgbox @talk'"Hey [player] how are you ? yes i kn..."
callstd 0x6
setflag 0x900
release
end



#org @move
#raw 13 'Step Right (Normal)
#raw 11 'Step Up (Normal)
#raw 3 'Face Right
#raw FE 'End of Movements


#org @talk
[I]= Hey [player] how are you ? yes i know\nit's cold in the dempsi region.\poh yeah pro.oak wants to see you\n about something.

That should work as you want it to and it should save bytes
also if your mums not giving you a pokemo you shouldn't use flag 828

HackMew December 20th, 2008 4:00 PM

Quote:

Originally Posted by Mac_Mini (Post 4210434)
Ok i'll put th wrong things in bold
Spoiler:
#dynamic 0x800000
#org @start
checkflag 0x900
if 0x0 goto @go
end


#org @go
lockapplymovement 0x1 @move
waitmovement 0x0
msgbox @talk'"Hey [player] how are you ? yes i kn..."
callstd 0x6
setflag 0x900
release
end



#org @move
#raw 13 'Step Right (Normal)
#raw 11 'Step Up (Normal)
#raw 3 'Face Right
#raw FE 'End of Movements


#org @talk
[I]= Hey [player] how are you ? yes i know\nit's cold in the dempsi region.\poh yeah pro.oak wants to see you\n about something.

That should work as you want it to and it should save bytes
also if your mums not giving you a pokemo you shouldn't use flag 828

Nothing is wrong there but it's always safer to use flags from 0x1000 onwards.
Also, usually flags are used to skip something that got executed already, like you can see in the script below:

Spoiler:
#dynamic 0x800000

#org @start
checkflag 0x1000
if 0x1 goto @nothing
lock
applymovement 0x1 @move
waitmovement 0x0
msgbox @talk
callstd 0x6
setflag 0x1000
release
end

#org @nothing
release
end

#org @move
#raw 13 'Step Right (Normal)
#raw 11 'Step Up (Normal)
#raw 3 'Face Right
#raw FE 'End of Movements

#org @talk
= Hey [player] how are you ? yes i know\nit's cold in the dempsi region.\poh yeah pro.oak wants to see you\n about something.

Ninja Caterpie December 20th, 2008 4:07 PM

Hackmew, we need a new rule. No requesting scripts, sire!
'nyway, this thread's a great idea an' all.

HackMew December 20th, 2008 4:09 PM

Quote:

Originally Posted by Ninja Caterpie (Post 4210484)
HackMew, we need a new rule. No requesting scripts, sire!
'nyway, this thread's a great idea an' all.

Oh, well. Just check the first post. That rule is already there.

treecko99 December 20th, 2008 9:04 PM

I am trying out a yes/no script I found in a tutorial, but I am having some trouble. Originally it said I was missing #define or parameter tags so I added them to the places that needed them and then complied. When I tested out in the rom "Yes or No?" appeared and so did the box. When I answered the rest of the text didn't appear but I was able to walk around.

Game: Fire Red
System: XSE
Type: Yes/No Script

Script:



Spoiler:
#dynamic 0x71A3F3

#org @start
lock
faceplayer
message @tutorial
boxset 5
#define Compare LASTRESULT 0x1
#define b_true goto @yes
#define Compare LASTRESULT 0x0
#define if b_true goto @no
release
end

#org @tutorial
= Yes or no?

#org @yes
message @pressyes
boxset 6
release
end

#org @no
message @pressno
boxset 6
release
end

#org @pressyes
= You pressed YES!

#org @pressno
= You pressed NO!

Ninja Caterpie December 20th, 2008 9:23 PM

Quote:

Originally Posted by treecko99 (Post 4211179)
I am trying out a yes/no script I found in a tutorial, but I am having some trouble. Originally it said I was missing #define or parameter tags so I added them to the places that needed them and then complied. When I tested out in the rom "Yes or No?" appeared and so did the box. When I answered the rest of the text didn't appear but I was able to walk around.

Game: Fire Red
System: XSE
Type: Yes/No Script

Script:



Spoiler:
#dynamic 0x71A3F3

#org @start
lock
faceplayer
message @tutorial
boxset 5
compare LASTRESULT 0x1
if b_true goto @yes
message @pressno
boxset 6
release
end

#org @tutorial
= Yes or no?

#org @yes
message @pressyes
boxset 6
release
end

#org @pressyes
= You pressed YES!

#org @pressno
= You pressed NO!

Lolwut? What are the define for? Anyway, I've optimised the script to save time. It should work now.

Spoiler:
#dynamic 0x71A3F3

#org @start
lock
faceplayer
message @tutorial
boxset 5
compare LASTRESULT 0x1
if b_true goto @yes
message @pressno
boxset 6

release
end

#org @tutorial
= Yes or no?

#org @yes
message @pressyes
boxset 6
release
end

#org @pressyes
= You pressed YES!

#org @pressno
= You pressed NO!

treecko99 December 20th, 2008 9:35 PM

Quote:

Originally Posted by Ninja Caterpie (Post 4211216)
Lolwut? What are the define for? Anyway, I've optimised the script to save time. It should work now.

Spoiler:
#dynamic 0x71A3F3

#org @start
lock
faceplayer
message @tutorial
boxset 5
compare LASTRESULT 0x1
if b_true goto @yes
message @pressno
boxset 6

release
end

#org @tutorial
= Yes or no?

#org @yes
message @pressyes
boxset 6
release
end

#org @pressyes
= You pressed YES!

#org @pressno
= You pressed NO!

Thanks for the help, but now I am back to my original problem.
It won't let me compile because "Error 13 'type mismatch' on line 8
Missing #define or parameter.
Line: compare LASTRESULT 0x1" pops up.

Ninja Caterpie December 20th, 2008 9:50 PM

Quote:

Originally Posted by treecko99 (Post 4211247)
Thanks for the help, but now I am back to my original problem.
It won't let me compile because "Error 13 'type mismatch' on line 8
Missing #define or parameter.
Line: compare LASTRESULT 0x1" pops up.

Strange - it compiles for me...And when I test it in-game, it works perfectly too!

treecko99 December 20th, 2008 9:56 PM

Quote:

Originally Posted by Ninja Caterpie (Post 4211283)
Strange - it compiles for me...And when I test it in-game, it works perfectly too!

Okay I added #define to the script you gave me and now it is working. Just one problem. No matter what I pick it says I picked no.

Spoiler:
#org @start
lock
faceplayer
message @tutorial
boxset 5
#define compare LASTRESULT 0x1
#define if b_true goto @yes
message @pressno
boxset 6
release
end

#org @tutorial
= Yes or no?

#org @yes
message @pressyes
boxset 6
release
end

#org @pressyes
= You pressed YES!

#org @pressno
= You pressed NO!

Ninja Caterpie December 20th, 2008 10:18 PM

Quote:

Originally Posted by treecko99 (Post 4211297)
Okay I added #define to the script you gave me and now it is working. Just one problem. No matter what I pick it says I picked no.

Spoiler:
#org @start
lock
faceplayer
message @tutorial
boxset 5
#define compare LASTRESULT 0x1
#define if b_true goto @yes
message @pressno
boxset 6
release
end

#org @tutorial
= Yes or no?

#org @yes
message @pressyes
boxset 6
release
end

#org @pressyes
= You pressed YES!

#org @pressno
= You pressed NO!

Then try compare lastresult 0x0 instead of 0x1...Initiative, much?

treecko99 December 20th, 2008 10:38 PM

Quote:

Originally Posted by Ninja Caterpie (Post 4211349)
Then try compare lastresult 0x0 instead of 0x1...Initiative, much?

Gosh Darn it. That still won't work.

Ninja Caterpie December 20th, 2008 10:45 PM

Try "if 0x1 goto".

:\ I'm really stuffed over this. It works perfectly on my ROM.

Hey, remember to take the start offset from the compiled script and put THAT into the person's script offset in A-Map.

treecko99 December 20th, 2008 10:56 PM

Quote:

Originally Posted by Ninja Caterpie (Post 4211408)
Try "if 0x1 goto".

:\ I'm really stuffed over this. It works perfectly on my ROM.

Hey, remember to take the start offset from the compiled script and put THAT into the person's script offset in A-Map.

Unfortunately that failed aswell. It just game me the same thing...with the additional messed up text.

Thanks for your help anyway. Hopefully I'll figure out what is wrong sooner or later.

Hiche.. December 20th, 2008 11:22 PM

Quote:

Originally Posted by treecko99 (Post 4211297)
Okay I added #define to the script you gave me and now it is working. Just one problem. No matter what I pick it says I picked no.

Spoiler:
#dynamic 0x800000

#org @start
lock
faceplayer
message @tutorial
boxset 5
compare LASTRESULT 0x1
if b_true goto @yes
message @pressno
boxset 6
release
end

#org @tutorial
= Yes or no?

#org @yes
message @pressyes
boxset 6
release
end

#org @pressyes
= You pressed YES!

#org @pressno
= You pressed NO!

The #define before the two commands is useless, and won't do anything. It also compiled perfectly with me. :\

Pokepal17 December 21st, 2008 4:00 AM

I need a bit of help with a trainerbattle.
The script works fine, so does the battle but when I am in the trainer's sight, the trainer doesn't move towards me so I have to talk to him to battle.
What is wrong?

Trainer's settings in A-map

Spoiler:

Movement Type = Look Right
Movement = 11
Trainer Box = Ticked


Trainerbattle Script

Spoiler:

#dynamic 0x800000

#org @start
trainerbattle 0x0 0x001 0x0 @before @after
message @beaten
boxset 0x6
release
end

#org @before
= DIE!!!

#org @after
= NOOOOO!!!

#org @beaten
= WHY!!!


Thanks in advance

HackMew December 21st, 2008 4:34 AM

Quote:

Originally Posted by treecko99 (Post 4211247)
Thanks for the help, but now I am back to my original problem.
It won't let me compile because "Error 13 'type mismatch' on line 8
Missing #define or parameter.
Line: compare LASTRESULT 0x1" pops up.

As XSE told you, a #define is missing. And on line 8 we have LASTRESULT.
So make sure you extract all files from the zipped archive.
LASTRESULT is defined in the std.rbh file indeed.

Anyway, remember the script type isn't "Yes/No script" and the like. See the first post for further details.


Quote:

Originally Posted by Pokepal17 (Post 4211841)
I need a bit of help with a trainerbattle.
The script works fine, so does the battle but when I am in the trainer's sight, the trainer doesn't move towards me so I have to talk to him to battle.
What is wrong?

Trainer's settings in A-map

Spoiler:

Movement Type = Look Right
Movement = 11
Trainer Box = Ticked


Thanks in advance

Well, I guess you just forgot to set the View radius value properly:

http://i40.*.com/2mk86x.jpg

Anyway, next time please provide all info okay?

Pokepal17 December 21st, 2008 5:29 AM

Thanks HackMew.:classic:

treecko99 December 21st, 2008 10:45 AM

Thanks Hack Mew, it turned out I forgot to extract the extra files.

Hiche.. December 21st, 2008 11:06 AM

Can someone show me an example of the trainerbattle 0x6 and 0x7? Thanks in advance.

Likewise December 21st, 2008 11:27 AM

Quote:

#Dynamic 0x71A270

#org @start
checkflag 0x1002
if 0x1 goto @done
lock
faceplayer
giveitem 0x29 0x1
msgbox @text
boxset 0x6
msgbox @Howmuch?
boxset 0x6
applymovement 0x1 @movey
waitmovement 0x0
msgbox @text2
boxset 0x6
msgbox @text3
boxset 0x6
applymovement 0x1 @movey1
waitmovement 0x0
applymovement 0x1 @movey2
waitmovement 0x0
setflag 0x1002
clearflag 0x1004
setflag 0x1003
release
end

#org @text
= Hi, could I have some milk?\pClerk:Certainly!

#org @Howmuch?
= You got some moomoo milk!\pThanks, how much do I owe you?\lClerc:Don't worry, it's on the\nhouse!\pThank you!

#org @movey
#raw 0x62 0x02 0xFE

#org text2
= Boss:What?!\nAnother freebie?!\lThat's it, you're fired!

#org @text3
= Clerk:What?!\n..........\pFine!

#org @movey2
#raw 0x11 0x11 0x60 0xFE

#org @done
release
end
It keeps saying Type Mismatch on line 8, but I checked the tutorials and that's how give item is supposed to go right?


All times are GMT -8. The time now is 2:55 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.