Sierra's MEGA-HUGE XSE Scripting Tutorial Page 24

Started by Sierraffinity December 26th, 2008 6:55 PM
  • 776138 views
  • 1232 replies

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,588 posts
15 Years
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
Male
Seen May 9th, 2015
Posted January 1st, 2013
32 posts
12.8 Years
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 ??

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,588 posts
15 Years
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):

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:

...
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
Seen August 28th, 2022
Posted November 17th, 2014
694 posts
15.8 Years
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.
Male
Seen November 6th, 2016
Posted May 25th, 2011
26 posts
13.3 Years
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.

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,588 posts
15 Years
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
Age 27
Seen April 12th, 2013
Posted May 25th, 2011
53 posts
16.6 Years
'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 :).
Male
North Carolina
Seen December 5th, 2011
Posted November 28th, 2011
1,431 posts
12.9 Years
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

DrFuji

Heiki Hecchara‌‌

Age 30
Male
Aussie
Seen 3 Days Ago
Posted February 12th, 2021
1,693 posts
13.7 Years
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.
Male
North Carolina
Seen December 5th, 2011
Posted November 28th, 2011
1,431 posts
12.9 Years
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

DrFuji

Heiki Hecchara‌‌

Age 30
Male
Aussie
Seen 3 Days Ago
Posted February 12th, 2021
1,693 posts
13.7 Years
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.

DrFuji

Heiki Hecchara‌‌

Age 30
Male
Aussie
Seen 3 Days Ago
Posted February 12th, 2021
1,693 posts
13.7 Years
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'.

aperso

Please feel free to VM random fruit types.

Age 24
I live nowhere
Seen June 22nd, 2022
Posted March 19th, 2012
171 posts
12.3 Years
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