Sierra's MEGA-HUGE XSE Scripting Tutorial Page 11

Started by Sierraffinity December 26th, 2008 6:55 PM
  • 776138 views
  • 1232 replies
Age 29
Male
Boise, Idaho
Seen October 6th, 2009
Posted September 26th, 2009
49 posts
13.8 Years
#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done
checkflag 0x828
if 0x0 goto @willgive
end

#org @done
lock
faceplayer
msgbox @already 0x6
release
end

#org @willgive
lock
faceplayer
msgbox @ask 0x5
compare LASTRESULT 0x0
if 0x1 goto @cyndaquil
compare LASTRESULT 0x1
if 0x1 goto @totodile
end

#org @cyndaquil
msgbox @givecynda 0x4
givepokemon 0x9B 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @totodile
msgbox @givetoto 0x4
givepokemon 0x9E 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get2 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @already
= That is Johto pokemon.

#org @ask
= Want a pokemon?

#org @get
= [player] received Cyndaquil from Oak.

#org @get2
= [player] received Totodile from Oak.

#org @givecynda
= But, you need a pokemon.\pThis pokemon for you.

#org @givetoto
= Okay, this is for you.

#org @takecare
= Please take care of your\npokemon.
Before, the script was checking for "if not no, goto @cyndaquil" and "if yes, it's yes, then go to @totodile", but I fixed it.
Thanks a ton man, I refer to this tut like crazy so thanks for helping me out!
I think you should put in your main post about this sort of thing.

Also, I want one space, if stepped on you are checked for a pokemon, if you have one you are allowed through, but if you don't, you are pushed back one space. Would it be just like the script for the Guards in FR, like I would only have to replace the flag and text, or would it be different?
Male
Seen January 4th, 2017
Posted July 9th, 2010
33 posts
13.8 Years
This may be a bit on the off-topic side...But if anyone is pretty experienced with scripting and could help me out.
I would really appreciate it if someone could add me on MSN so we could discuss some of the pointers on scripting.

Thanks in advance,

3n3rGyZ
3n3rGyZ's PokePet

GrandSlam the level 99 Metagross!
Age 29
Male
Boise, Idaho
Seen October 6th, 2009
Posted September 26th, 2009
49 posts
13.8 Years
I tried this script:

Spoiler:
#org 0x8004B9
countpokemon
compare LASTRESULT 0x2
if 0x1 goto 0x88004CC
if 0x0 goto 0x88004ED

#org 0x8004CC
lock
faceplayer
= Okay go on through.
release
end

#org 0x8004ED
lock
faceplayer
= No pokemon? No passage!
#raw 0x2
#raw 0x12
release
end


But it doesn't work. I was trying to have it check pokemon, and if you have one you go onthrough and if you dont you go back one space to the left. Kinda like the cycling road entrances. But with only 2 script squares, But it just freezes you there while the guard stares at you.
I even adjusted the unknown and varnumber to like the picture, but it doesnt work still.
Age 29
Male
Boise, Idaho
Seen October 6th, 2009
Posted September 26th, 2009
49 posts
13.8 Years
I don't really get the yes/no thing, I've tried it and it didn't work :/. Help me get a working one?
Its basically, if they click yes you point them to #org @yes and if they pick no you point them to #org @no, unless you just want it to end when you click yes or no. Its basically all in the MSGBOX Number, you just have to add extra basic stuff depending on what you are planning to do with that particular script.

Fendaril

Novice Mario 64 hacker.

Seen August 20th, 2010
Posted June 18th, 2010
43 posts
15.3 Years
Hello Diego. First before anything your tutorial acts as an excellent reference for me. It's almost as if a professional wrote it.

Now here is my problem. I have a script that suppose to move my player but after its completed my player freezes on the spot without the msgbox function activating.
Below is my code.

Also do you know how to get XSE NOT to autogenerate extra code? It sometimes likes to generate extra unneeded movement commands.

'---------------
#org 0x80050A
checkflag 0x8D4
if 0x1 goto 0x880054C
setflag 0x8D4
lock
applymovement MOVE_PLAYER 0x880052C
waitmovement 0x0
release
msgbox 0x8800534 MSG_NORMAL '"you notice a pokeball"
closeonkeypress
end

'---------------
#org 0x80054C
release
end


'---------
' Strings
'---------
#org 0x800534
= you notice a pokeball


'-----------
' Movements
'-----------
#org 0x80052C
#raw 0x56 'Exclamation Mark (!)
#raw 0x0 'Face Down
#raw 0x1 'Face Up
#raw 0x2 'Face Left
#raw 0x3 'Face Right
#raw 0x2 'Face Left
#raw 0x3 'Face Right
mario.......is back?

Pokepal17

More cowbell~

Age 28
Male
Steeltown
Seen July 7th, 2011
Posted May 22nd, 2011
1,517 posts
14.6 Years
Hello Diego. First before anything your tutorial acts as an excellent reference for me. It's almost as if a professional wrote it.

Now here is my problem. I have a script that suppose to move my player but after its completed my player freezes on the spot without the msgbox function activating.
Below is my code.

Also do you know how to get XSE NOT to autogenerate extra code? It sometimes likes to generate extra unneeded movement commands.

'---------------
#org 0x80050A
checkflag 0x8D4
if 0x1 goto 0x880054C
setflag 0x8D4
lock
applymovement MOVE_PLAYER 0x880052C
waitmovement 0x0
release
msgbox 0x8800534 MSG_NORMAL '"you notice a pokeball"
closeonkeypress
end
 
'---------------
#org 0x80054C
release
end
 
 
'---------
' Strings
'---------
#org 0x800534
= you notice a pokeball
 
 
'-----------
' Movements
'-----------
#org 0x80052C
#raw 0x56 'Exclamation Mark (!)
#raw 0x0 'Face Down
#raw 0x1 'Face Up
#raw 0x2 'Face Left
#raw 0x3 'Face Right
#raw 0x2 'Face Left
#raw 0x3 'Face Right
It only does that when you forget 0xFE at the end of the movements, so it reads the bytes after as movements.
Pokémon Stardrop

Pokepal17

More cowbell~

Age 28
Male
Steeltown
Seen July 7th, 2011
Posted May 22nd, 2011
1,517 posts
14.6 Years
So the extra movement generation was because the compiler was trying to guess the movements after to prevent bugs?
Nope, the byte, to end the movements there wasn't present, so XSE and the ROM believed the bytes after were movements, until it got too an FF or FE. So just remember to put 0xFE at the end of your movements.
Pokémon Stardrop

Pikachu fan

SUSANOOMON IS NOT AMUSED

Age 26
Male
Seen July 11th, 2011
Posted December 16th, 2010
54 posts
13.9 Years
okay, now i'm trying to compile a shaymin wildbattle script to my fir red hack

#dynamic 0x3AE35F

#org @start
lock
faceplayer
msgbox @1 0x6
cry 0x363 0x0
wildbattle 0x363 0x7 0x8B
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @1
= Shay!

that was the script and every time i try to compile it
it says
"Error 13 type mismatch in file ..... on line 8 missing #define or parameter
Line: wildbattle 0x363 0x7 0x8B

and before you say "Shaymin isn't in fire red!" I replaced roselia
with shaymin.

what is wrong with my script?

0m3GA ARS3NAL

Im comin' home...

Age 30
Male
Superjail Penitentiary
Seen February 25th, 2023
Posted September 12th, 2013
1,816 posts
15.3 Years
what would level 7 be in hex?
Seven, or, 7 can be written a few ways...

Decimal: 7
Hexadecimal (HEX): 0x7
Octadecimal (OCT, not used in ROM hacking...) 7
Binary (BIN, also not used OFTEN in ROM hacking...): 0111

Hope I could be of help, lol
>Boot Jailbot
>Pass *****
.
.
Jailbot OS Ver 1.1.2
Greetings Warden
of Superjail Penitentiary
Awaiting user input...

>Display User_Info
╠══User Info══╣
Username:
0m3GA ARS3NAL
Age: 18
Sex: Male ♂
Race: Caucasian
Quote:
"What is this
I don't even..."

M/O: Often acts out to get attention, but recently has changed that. Has been studying up on hacking information and hopes to participate in more advanced hacking discussion.
╠══End of File══╣
Awaiting user input...

>
Seen September 4th, 2009
Posted September 2nd, 2009
1 posts
13.7 Years
If i use an Level script, i'll be frozen.

When I decompile it, and make it an level script, i get this:

'---------------
#org 0x14E924
#raw 0x0
But when ik compile this, i don't get an offset, i get this:

eXtreme Script Editor v1.1.1
-------------------------------------
09-02-2009 12:02:10
-------------------------------------
Output wordt geopent: C:\Users\FSC\Downloads\Sunshine\1Pokémon Sunshine Hack2.gba...
Verwerken van input script...
2 - #ORG
 > lNewOffset = 0x14E924
3 - #RAW
 > bOut = 0x0
-------------------------------------
Bezig met opruimen...
Output sluiten...
Verwerking van input voltooid in 0,014 seconden.
(It's in dutch)

I copied this offset: > lNewOffset = 0x14E924
But then i get frozen.

DestinyBender

Mana du vortes, aeria gloris.

Age 24
Male
Currently playing Pokémon Brown.
Seen March 19th, 2010
Posted March 19th, 2010
443 posts
13.7 Years
I use PKSUV, & I have no idea how to work it. I have read guides on it, but still can't nut it out. I am going to download XSE, so it will be much easier, special thanks to your guide. :) Good job.
Love you <3


PC Family
Misty-loving sis
Evil, evil, brother
Rock-loving cousin
Uncle, King of Mafia-ness
Beauty Pair

Looking for pair -hinthint-

Also, a rival. Anyone?

Quotes from movies:
Superhero Movie
The House Bunny

BlitŻ

guahh my dog is so cute

Age 28
Male
Bay Area, Califronia.
Seen October 1st, 2015
Posted January 22nd, 2013
472 posts
14.2 Years
hey deigo, for some reason, when I do a mssgboxbox the text comes out like this

Hi(press A)

This is pissing me off(press A)

I want to fix this(press A)

instead of going

Hi(press A)
This is pissing me off (A)
I want to fix this (A)

and Im phrasing it like this in XSE
Hi\nThis is pissing me off\lI want to fix this

So any tips?