Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Reload this Page [Tutorial] diegoisawesome's MEGA-HUGE XSE Scripting Tutorial

Notices
For all updates, view the main page.

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.



Reply
 
Thread Tools
  #576    
Old April 26th, 2011 (09:19 AM).
pabioxxx pabioxxx is offline
 
Join Date: Aug 2010
Gender: Male
Posts: 32
How can I make a "check happines" script? Is it possible?
Reply With Quote
  #577    
Old April 26th, 2011 (07:32 PM).
colcolstyles's Avatar
colcolstyles colcolstyles is offline
Yours truly
Crystal Tier
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Posts: 1,592
Quote originally posted by pabioxxx:
How can I make a "check happines" script? Is it possible?
In most (if not all) of the Gen. III games there is a person who will tell the player how happy their lead pokémon is. If you can find that script (Google it or something), then you can decompile the script for that person, examine the code, and make your own.
__________________

Brother of Vrai
Reply With Quote
  #578    
Old April 27th, 2011 (12:50 AM).
pabioxxx pabioxxx is offline
 
Join Date: Aug 2010
Gender: Male
Posts: 32
Ok i have compared those scripts in different game, and main line of this script is:

special2 LASTRESULT 0xE6

Ok. But now i want to know how to use special 2 in different situations, becouse it is used in scripts like check happines or check catched pokemons (pokedex status). Is there any description of bytes using with special 2 ??
Reply With Quote
  #579    
Old April 27th, 2011 (01:29 PM).
colcolstyles's Avatar
colcolstyles colcolstyles is offline
Yours truly
Crystal Tier
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Posts: 1,592
Quote originally posted by pabioxxx:
Ok i have compared those scripts in different game, and main line of this script is:

special2 LASTRESULT 0xE6

Ok. But now i want to know how to use special 2 in different situations, becouse it is used in scripts like check happines or check catched pokemons (pokedex status). Is there any description of bytes using with special 2 ??
Yeah, that seems to be the key line. It seems that the happiness of the first pokémon is stored in LASTRESULT. The commands after the 'special2' branch off to different scripts based on how happy the pokémon is. Here's a table linking each value to each level of happiness (source: Psypokes):

Code:
Value:	Happiness:
0	0
1	1-49
2	50-99
3	100-149
4	150-199
5	200-249
6	250-255
So, for example, if you want to give the player an item if their lead pokémon has at least 200 happiness, the script would look like this:

Code:
...
special LASTRESULT 0xE6
copyvar 0x8000 LASTRESULT    // The game does this so you should do it too
compare 0x8000 0x5
if B_>= goto @happy
...

#org @happy
giveitem blah blah blah
__________________

Brother of Vrai
Reply With Quote
  #580    
Old April 28th, 2011 (12:37 AM).
pabioxxx pabioxxx is offline
 
Join Date: Aug 2010
Gender: Male
Posts: 32
Thanks for answer, It's very helpfull...
Reply With Quote
  #581    
Old April 30th, 2011 (06:09 AM).
TheZerox9's Avatar
TheZerox9 TheZerox9 is offline
That's Right
 
Join Date: Dec 2010
Location: NO ONE SHALL STALK ME!!!
Gender: Male
Nature: Relaxed
Posts: 9
hey is it possible to script a wildbattle that is inescapable cause i need it 4 my game.
basically, the fact that you cannot proceed until a wild pokemon in your way is beaten.
NO RUNNING AWAY
Reply With Quote
  #582    
Old May 1st, 2011 (04:39 PM).
Ziddia Ziddia is offline
 
Join Date: Apr 2011
Gender: Male
Posts: 6
What about creating a legendary poemon battle? I would guess that it uses something similar to a gym battle, but formatted for Pokemon...

If anyone knows this please PM me, I don't know if I can keep track of this
Reply With Quote
  #583    
Old May 2nd, 2011 (01:57 PM).
Quilava's Master's Avatar
Quilava's Master Quilava's Master is offline
Shattered Dreams '13
 
Join Date: Jul 2007
Nature: Adamant
Posts: 694
Quote originally posted by TheZerox9:
hey is it possible to script a wildbattle that is inescapable cause i need it 4 my game.
basically, the fact that you cannot proceed until a wild pokemon in your way is beaten.
NO RUNNING AWAY
Use
"special2 LASTRESULT 0xB4
compare LASTRESULT 0x[insert number here]
if 0x1 goto @pointer"
after the wildbattle command. The special 0xB4 checks for the result of the battle then sets a value to the variable.

comparing 0x1 checks if the pokemon fainted
comparing 0x4 checks if you ran away
comparing 0x7 checks if you caught the Pokemon.
__________________
The return of Pokemon Shattered Dreams! Click the screenshot to visit the thread, you know you want to.
Reply With Quote
  #584    
Old May 13th, 2011 (11:29 PM).
bcrobert's Avatar
bcrobert bcrobert is offline
Lazy Antagonist
 
Join Date: Apr 2011
Gender: Male
Nature: Quirky
Posts: 65
Great tutorial.

Is the list of flags that have been used in the Emerald ROM complete or partial? I've been adding flags from 0x900 to 0x920 since they look unused, but I just want to make sure I'm not screwing myself over for later.
__________________
Reply With Quote
  #585    
Old May 14th, 2011 (07:04 AM). Edited May 14th, 2011 by inuside21.
inuside21 inuside21 is offline
 
Join Date: Feb 2010
Gender: Male
Posts: 25
hi, im getting stucked in scripting in emerald than fire red,

'---------------
#org 0x827D52
lock
applymovement 0x9 0x8827D68
waitmovement 0x9
msgbox 0x8827DAD 0x6 '"yoh!"
release
end


'---------
' Strings
'---------
#org 0x827DAD
= yoh!


'-----------
' Movements
'-----------
#org 0x827D68
#raw 0x8 'Step Down (Normal)
#raw 0xFE 'End of Movements


i putted that code (just a example), when i put the offset above and put the 4050 in var num and 0300 (i tried 0003) brendad dont walk and try to talk, its not freezing, but my char just step and, darn! nothing happen, i tried to 4051 to 5000 but nothing work, i tried 0000 to 0003 nothing work, do all combination, nothing work,, what should i put in var number and unknown in emerald, but i tried in fire red, RED walks and talk. but in emerald, nothing happens.

hi, im getting stucked in scripting in emerald than fire red,

'---------------
#org 0x827D52
lock
applymovement 0x9 0x8827D68
waitmovement 0x9
msgbox 0x8827DAD 0x6 '"yoh!"
release
end


'---------
' Strings
'---------
#org 0x827DAD
= yoh!


'-----------
' Movements
'-----------
#org 0x827D68
#raw 0x8 'Step Down (Normal)
#raw 0xFE 'End of Movements


i putted that code (just a example), when i put the offset above and put the 4050 in var num and 0300 (i tried 0003) brendad dont walk and try to talk, its not freezing, but my char just step and, darn! nothing happen, i tried to 4051 to 5000 but nothing work, i tried 0000 to 0003 nothing work, do all combination, nothing work,, what should i put in var number and unknown in emerald, but i tried in fire red, RED walks and talk. but in emerald, nothing happens.
Reply With Quote
  #586    
Old May 25th, 2011 (09:32 AM).
peirau's Avatar
peirau peirau is offline
........
 
Join Date: Oct 2006
Age: 20
Nature: Naive
Posts: 53
When I put boxset 5 in my Script it keeps giving me "unknown keyword" -_-....
Anyone a solution?
Thanks,
Reply With Quote
  #587    
Old May 25th, 2011 (10:47 AM).
colcolstyles's Avatar
colcolstyles colcolstyles is offline
Yours truly
Crystal Tier
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Posts: 1,592
Quote originally posted by peirau:
When I put boxset 5 in my Script it keeps giving me "unknown keyword" -_-....
Anyone a solution?
Thanks,
'callstd' is the XSE equivalent of 'boxset'. However, if you're using it with a 'msgbox' command, you should be appending the number (0x2, 0x6, etc.) to the end of the 'msgbox' construct instead.
__________________

Brother of Vrai
Reply With Quote
  #588    
Old May 25th, 2011 (10:51 AM).
peirau's Avatar
peirau peirau is offline
........
 
Join Date: Oct 2006
Age: 20
Nature: Naive
Posts: 53
Quote originally posted by colcolstyles:
'callstd' is the XSE equivalent of 'boxset'. However, if you're using it with a 'msgbox' command, you should be appending the number (0x2, 0x6, etc.) to the end of the 'msgbox' construct instead.
Thank you very much brother I will test it :).
Reply With Quote
  #589    
Old June 6th, 2011 (07:14 PM).
Weavile05's Avatar
Weavile05 Weavile05 is offline
Currently Hacking BW
 
Join Date: Jun 2010
Location: North Carolina
Gender: Male
Nature: Lax
Posts: 1,431
Okay, I would just like to clarify something. I haven't gotten very far in the tutorial yet, but I want to see if I can impress myself with my awesome inference skills.

So I made a givepokemon script. Long story short, your Mom gives you a Houndoom because it is your birthday. After that, she tells you to go see Professor Oak (unless i decide to change the Prof.). What I plan on doing is having the Prof. give you a Pokedex when he sees you have a Pokemon. So in order to do this, would you do something like this?

#org @start
msgbox @1 0x6
checkflag 0x828
if 0x1 goto @pokedex
msgbox @2 0x6
release
end

#org @pokedex
checkflag 0x(pokedex flag, I think it's 829)
if 0x0 goto...

And I'm not sure from there, but it would be whatever code gives you the pokedex. Right? I mean I'm pretty sure that's not exactly right, but am I at least on the right track?
__________________
In progress

Hoenn, 1 Badge
My Youtube Channel: Check out my Pokemon Red Walkthrough
Pokemon White FC: 2322 5491 2643
Reply With Quote
  #590    
Old June 6th, 2011 (07:42 PM).
DrFuji's Avatar
DrFuji DrFuji is offline
Helfen, Wehren, Heilen
Crystal Tier
 
Join Date: Sep 2009
Location: Downia-upside
Age: 22
Gender: Male
Nature: Jolly
Posts: 1,322
Quote originally posted by Weavile05:
Okay, I would just like to clarify something. I haven't gotten very far in the tutorial yet, but I want to see if I can impress myself with my awesome inference skills.

So I made a givepokemon script. Long story short, your Mom gives you a Houndoom because it is your birthday. After that, she tells you to go see Professor Oak (unless i decide to change the Prof.). What I plan on doing is having the Prof. give you a Pokedex when he sees you have a Pokemon. So in order to do this, would you do something like this?

#org @start
msgbox @1 0x6
checkflag 0x828
if 0x1 goto @pokedex
msgbox @2 0x6
release
end

#org @pokedex
checkflag 0x(pokedex flag, I think it's 829)
if 0x0 goto...

And I'm not sure from there, but it would be whatever code gives you the pokedex. Right? I mean I'm pretty sure that's not exactly right, but am I at least on the right track?
Yes, the Pokedex is activated with flag 0x829.

You're heading in the right direction from what I can see from your script fragment. I can't see any errors and (at this point) it looks like it will be doing what you stated above.
__________________
Reply With Quote
  #591    
Old June 6th, 2011 (08:03 PM).
Weavile05's Avatar
Weavile05 Weavile05 is offline
Currently Hacking BW
 
Join Date: Jun 2010
Location: North Carolina
Gender: Male
Nature: Lax
Posts: 1,431
Quote originally posted by DrFuji:
Yes, the Pokedex is activated with flag 0x829.

You're heading in the right direction from what I can see from your script fragment. I can't see any errors and (at this point) it looks like it will be doing what you stated above.
Awesome. Now I've just gotta figure out how to actually give the pokedex... I'm sure that's explained later in the tut though.
__________________
In progress

Hoenn, 1 Badge
My Youtube Channel: Check out my Pokemon Red Walkthrough
Pokemon White FC: 2322 5491 2643
Reply With Quote
  #592    
Old June 7th, 2011 (12:25 AM).
ZxC Mirai's Avatar
ZxC Mirai ZxC Mirai is offline
Huh?
 
Join Date: Jun 2011
Location: Pampanga Philippines
Gender: Male
Nature: Timid
Posts: 267
T_T why it doesn't COMPILES???

i cant click the Compile Button

SORRY I AM NEBIE IN SCRIPTING

Look at my screenshot
Reply With Quote
  #593    
Old June 7th, 2011 (12:29 AM).
ZxC Mirai's Avatar
ZxC Mirai ZxC Mirai is offline
Huh?
 
Join Date: Jun 2011
Location: Pampanga Philippines
Gender: Male
Nature: Timid
Posts: 267
T_T why it doesn't COMPILES???

i cant click the Compile Button

SORRY I AM NEBIE IN SCRIPTING

Look at my screenshot

Soory for Double Posting :D
Attached Images
File Type: jpg Compiler.JPG‎ (88.4 KB, 6 views) (Save to Dropbox)
Reply With Quote
  #594    
Old June 7th, 2011 (12:47 AM). Edited June 7th, 2011 by DrFuji.
DrFuji's Avatar
DrFuji DrFuji is offline
Helfen, Wehren, Heilen
Crystal Tier
 
Join Date: Sep 2009
Location: Downia-upside
Age: 22
Gender: Male
Nature: Jolly
Posts: 1,322
Quote originally posted by UnForgiven*:
T_T why it doesn't COMPILES???

i cant click the Compile Button

SORRY I AM NEBIE IN SCRIPTING

Look at my screenshot

Soory for Double Posting :D
You also need to open your ROM in XSE. Use the folder icon to select the ROM you want to insert the script in and then you should be able to compile the script.

You should also put in a viable offset at the top of your script.
__________________
Reply With Quote
  #595    
Old June 8th, 2011 (12:41 AM). Edited June 8th, 2011 by colcolstyles.
ZxC Mirai's Avatar
ZxC Mirai ZxC Mirai is offline
Huh?
 
Join Date: Jun 2011
Location: Pampanga Philippines
Gender: Male
Nature: Timid
Posts: 267
Okay got it!! thanks............

ummm when i compile it what do i COPY???
Reply With Quote
  #596    
Old June 8th, 2011 (01:02 AM).
DrFuji's Avatar
DrFuji DrFuji is offline
Helfen, Wehren, Heilen
Crystal Tier
 
Join Date: Sep 2009
Location: Downia-upside
Age: 22
Gender: Male
Nature: Jolly
Posts: 1,322
Quote originally posted by UnForgiven*:
ummm when i compile it what do i COPY???
You need to do it for the offset which correlates to the start of your script. Copy the offset for 'start'.
__________________
Reply With Quote
  #597    
Old June 8th, 2011 (07:54 PM).
ZxC Mirai's Avatar
ZxC Mirai ZxC Mirai is offline
Huh?
 
Join Date: Jun 2011
Location: Pampanga Philippines
Gender: Male
Nature: Timid
Posts: 267
Ok.... THANKS..................
Reply With Quote
  #598    
Old June 9th, 2011 (09:52 AM).
pabioxxx pabioxxx is offline
 
Join Date: Aug 2010
Gender: Male
Posts: 32
Heh I have another problem...How can I delete scripts which was compiled to ROM by me...Well, there're too many problems witch overwrite it in hex, (ROM is unstable after it...)...So how can I do that ??
Reply With Quote
  #599    
Old June 9th, 2011 (09:07 PM). Edited June 10th, 2011 by ZxC Mirai.
ZxC Mirai's Avatar
ZxC Mirai ZxC Mirai is offline
Huh?
 
Join Date: Jun 2011
Location: Pampanga Philippines
Gender: Male
Nature: Timid
Posts: 267
what will i gonna do copy the Start offset and then Paste the
offset in a Person in AM????

please Help ME!!

can anyone answer my question PLEASE!!!

Reply With Quote
  #600    
Old June 10th, 2011 (04:23 PM).
aperso's Avatar
aperso aperso is offline
Please feel free to VM rndom fruit types.
 
Join Date: Feb 2011
Location: I live nowhere
Age: 16
Nature: Brave
Posts: 170
Quote originally posted by UnForgiven*:
what will i gonna do copy the Start offset and then Paste the
offset in a Person in AM????

please Help ME!!

can anyone answer my question PLEASE!!!

yes that is what you do if you don't do that the script won't appear was that helpful enough
__________________
Visit ROM Hackers Online, the next best thing in ROM Hacking covering all video games with research, guides and tutorials to help you become a better hacker.

Reply With Quote
Reply
Quick Reply

Sponsored Links

You may also like.. (Beta)
Thread Tools

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 UTC -8. The time now is 08:51 PM.