Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Reload this Page [Tutorial] [TehTehTehTeh's] XSE Basic/Medium 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.



Closed Thread
 
Thread Tools
  #126    
Old September 16th, 2008 (02:28 PM).
GTAPlayer's Avatar
GTAPlayer GTAPlayer is offline
Six Star Evasion
 
Join Date: Jul 2008
Location: Escobar International
Gender:
Nature: Adamant
Posts: 28
What's wrong with this script?:
#org 0x71A308
lock
faceplayer
startwildbattle 0xF3 0x32 0x0
checksound
cry 0xF3 0x2
pause 0x28
waitcry
setflag 0x305
setflag 0x861
special 0x138
waitstate
clearflag 0x861
release
end
__________________
  #127    
Old September 17th, 2008 (09:53 AM).
HackMew's Avatar
HackMew HackMew is offline
Mewtwo Strikes Back
Crystal Tier
 
Join Date: Jun 2006
Posts: 1,314
Quote originally posted by GTAPlayer:
What's wrong with this script?:
Spoiler:
#org 0x71A308
lock
faceplayer
startwildbattle 0xF3 0x32 0x0
checksound
cry 0xF3 0x2
pause 0x28
waitcry
setflag 0x305
setflag 0x861
special 0x138
waitstate
clearflag 0x861
release
end
You should say what you suppose that script to do. And what the script does instead.
Nex time it would be better asking such questions in the proper thread.
__________________
  #128    
Old September 17th, 2008 (09:57 AM).
Banjora Marxvile's Avatar
Banjora Marxvile Banjora Marxvile is offline
Oui Oui Si Si Ja Ja Da Da
 
Join Date: May 2008
Age: 21
Gender: Male
Nature: Lonely
Posts: 3,444
Um... I need help. I'm not a good scripter, but I put a givepokemon script in my practice hack. Hoe do I end it as it starts again if I talk to the pokeball to get the pokemon? This is the script (I know it's bad, but I don't understand many scripting tutorials, as they don't give advice for what I want...)

#org 0x800000
givepokemon 0xFC 0x28 0x0 0x0 0x0 0x0
movesprite2 0x1 0x0 0x0
hidesprite 0x1
release
end

... I'm not a good scripter (I'm a better mapper) but any help will be very much appreciated!
__________________

Man of Steel
He harbors no shame
Got cut a raw deal
But he holds no blame
Gone and forgot to feel
Numb for pretentious pain
As he spins the wheel
There's no loss nor no gain...


Nerves o
f Steel
He must remain
Even if it kills
To remember my name
A view to a thrill
Like Campari and Champagne
I'm on the rocks
Please tell me, What Is My Name?

  #129    
Old September 17th, 2008 (10:24 AM).
HackMew's Avatar
HackMew HackMew is offline
Mewtwo Strikes Back
Crystal Tier
 
Join Date: Jun 2006
Posts: 1,314
Quote originally posted by Turtwigtoon:
Um... I need help. I'm not a good scripter, but I put a givepokemon script in my practice hack. Hoe do I end it as it starts again if I talk to the pokeball to get the pokemon? This is the script (I know it's bad, but I don't understand many scripting tutorials, as they don't give advice for what I want...)

Spoiler:
#org 0x800000
givepokemon 0xFC 0x28 0x0 0x0 0x0 0x0
movesprite2 0x1 0x0 0x0
hidesprite 0x1
release
end


... I'm not a good scripter (I'm a better mapper) but any help will be very much appreciated!
You simply need to use checkflag/setflag. Check the Script Help thread for further info and examples. I posted something a couple of days ago.
__________________
  #130    
Old September 17th, 2008 (02:10 PM).
GTAPlayer's Avatar
GTAPlayer GTAPlayer is offline
Six Star Evasion
 
Join Date: Jul 2008
Location: Escobar International
Gender:
Nature: Adamant
Posts: 28
Sorry, I meant, how do I put a flag for a legendary to disappear after you caught it?
__________________
  #131    
Old September 19th, 2008 (05:25 AM).
jin14 jin14 is offline
 
Join Date: Sep 2008
Posts: 61
hi boy where is a script guide need to me to do a hack room you can help me?
  #132    
Old September 20th, 2008 (01:28 AM). Edited September 20th, 2008 by -DarK-.
-DarK- -DarK- is offline
Hold Your Colour
 
Join Date: Jun 2007
Location: Belgium
Age: 22
Gender: Male
Nature: Brave
Posts: 185
Send a message via Windows Live Messenger to -DarK-
EDIT: Nvm, found my mistake

Quote originally posted by HackMew:
Well, pretty basic I would say.. :P
Anyway, I'll give you a tip: save bytes whenever possible.

Example:



It doesn't make a lot of sense to compare the LASTRESULT variable two times, indeed. It can be only 0x0 or 0x1 (using callstd/boxset 0x5, of course). So, if it's 0x0 it can't be 0x1 and vice-versa. The optimized version would be:



Since you're using XSE you can even do this, if you want:



Basically it's just the same once compiled, but I think it makes more sense then a simple goto when reading the scipt.
I tried that, with the "else goto" thing, and XSE told me it's an incorrect line. Here's my full script:

Code:
#Dynamic 0x86962E

#ORG @start
lock
faceplayer
msgbox @pokeball
boxset 5
compare LASTRESULT 0x1
if b_true goto @yes
else goto @no
release
end

#org @pokeball
= This POKéBALL is lying on the\nground. Maybe someone left it\lbehind ...\lPick it up?

#org @yes
msgbox @cyndaquil
boxset 6
fanfare  0x13E
givepokemon 0x9B 0x5 0x0 0x0 0x0 0x0
waitfanfare
hidesprite 0x7
release
end

#org #no
msgbox @untouched
boxset 6
release
end

#org @cyndaquil
= [player] received a CYNDAQUIL.

#org @untouched
= You leave the POKéBALL untouched.
What's wrong with it?
  #133    
Old September 20th, 2008 (01:52 AM).
Hiche.. Hiche.. is offline
 
 
Join Date: Apr 2008
Posts: 979
Dark Salamance, try this:

Spoiler:

#Dynamic 0x86962E

#ORG @start
lock
faceplayer
msgbox @pokeball
boxset 5
compare LASTRESULT 0x1
if b_true goto @yes
message @no
boxset 6
release
end

#org @pokeball
= This POKéBALL is lying on the\nground. Maybe someone left it\lbehind ...\lPick it up?

#org @yes
givepokemon 0x9B 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @cyndaquil
boxset 6
waitfanfare
hidesprite 0x7
release
end

#org @no
= You leave the POKéBALL untouched.

#org @cyndaquil
= [player] received a CYNDAQUIL.
  #134    
Old September 20th, 2008 (02:10 AM). Edited September 20th, 2008 by -DarK-.
-DarK- -DarK- is offline
Hold Your Colour
 
Join Date: Jun 2007
Location: Belgium
Age: 22
Gender: Male
Nature: Brave
Posts: 185
Send a message via Windows Live Messenger to -DarK-
EDIT2: I found it! Now I know why the checkflag/setflag didn't work for me!`

Explanation: I never knew you had to insert the hex number you used for setflag in the PersonID thing in A-map, that's why it didn't work.

Here's the final script:
Code:
#Dynamic 0x86981D

#ORG @start
checkflag 0x200
if b_true goto @gone
lock
faceplayer
msgbox @pokeball
boxset 5
compare LASTRESULT 0x1
if b_true goto @yes
else goto @no
boxset 6
release
end

#org @pokeball
= This POKéBALL is lying on the\nground. Maybe someone left it\lbehind ...\lPick it up?

#org @yes
givepokemon 0x9B 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @cyndaquil
boxset 6
waitfanfare
hidesprite 0x7
setflag 0x200
release
end

#org @no
msgbox @untouched
boxset 6
release
end

#org @untouched
= You leave the POKéBALL untouched.

#org @cyndaquil
= [player] received a CYNDAQUIL.

#org @gone
hidesprite 0x7
end
Yay!
__________________
  #135    
Old September 23rd, 2008 (03:10 PM). Edited September 23rd, 2008 by ~Teh Panda~.
~Teh Panda~'s Avatar
~Teh Panda~ ~Teh Panda~ is offline
Sea of Dreams - Redux
Silver Tier
 
Join Date: Aug 2007
Posts: 905
Ok guys, thanks for posting your scripts here, but just in case you don't get an answer here remember about the script help thread ;)

Chapter 4, Flags

Finally the flags tut is here.

Ok lets start off, flags are based off into 3 basics groups

Code:
setflag
checkflag
clearflag
Most of the time you don't see clearflag come up... it is needed sometimes though. You will understand how to use the flags after this!

Lets start with something way simple. Code the normal base to your script from the other parts of the tut.

Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer
Now for the flags. add these lines of code

Code:
checkflag 0x200
if b_true goto @flag
This is to check if the flag 0x200 is set and if so going to @flag
Now enter a simple message line in.. whatever the message may be just add it after this. After that we will add our setflag, before that here is how far we should be in the script...

Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
Now for the setflag... for flags do not use any number but the flags 200 and up and 900 and up.

Add this line of code now!

Code:
setflag 0x200
now we should have


Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
setflag 0x200
Now end this part of the scrip and now add your message for hi.

Time for the @flag part. before this here is what you should have...

Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
setflag 0x200
release
end

#org @hi
= Hello there.
Now after that add the #org @flag part of this part of the script.

Time for what we want the flag to go to.
Lets make it a message

Code:
#org @flag
message @woot
boxset 6
release
end

#org @woot
= What you want????
Now for the finished product!

Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
setflag 0x200
release
end

#org @hi
= Hello there.

#org @flag
message @woot
boxset 6
release
end

#org @woot
= What you want????
__________________




Mystic still in work to let you know...
  #136    
Old September 24th, 2008 (02:32 AM).
-DarK- -DarK- is offline
Hold Your Colour
 
Join Date: Jun 2007
Location: Belgium
Age: 22
Gender: Male
Nature: Brave
Posts: 185
Send a message via Windows Live Messenger to -DarK-
You forgot one thing panda. If you want the checkflag/setflag to work correctly, remember this: When inserting a person event, there's a thing called PersonID on your right (when you clicked at that event). Make sure to insert the numbers you used for setflag, which means 200 in this case. Otherwise, flags wouldn't work correctly.
__________________
  #137    
Old September 24th, 2008 (02:51 AM).
Tropical Sunlight's Avatar
Tropical Sunlight Tropical Sunlight is offline
The Faltine
 
Join Date: Mar 2008
Location: Slovenia
Age: 19
Gender: Male
Posts: 3,578
Send a message via Windows Live Messenger to Tropical Sunlight
Yay! When will the other parts arrive?
__________________
  #138    
Old September 24th, 2008 (03:59 PM).
~Teh Panda~'s Avatar
~Teh Panda~ ~Teh Panda~ is offline
Sea of Dreams - Redux
Silver Tier
 
Join Date: Aug 2007
Posts: 905
Quote originally posted by DarkSalamence:
You forgot one thing panda. If you want the checkflag/setflag to work correctly, remember this: When inserting a person event, there's a thing called PersonID on your right (when you clicked at that event). Make sure to insert the numbers you used for setflag, which means 200 in this case. Otherwise, flags wouldn't work correctly.
I am pretty sure I covered that but i will look it over once again.
__________________




Mystic still in work to let you know...
  #139    
Old September 28th, 2008 (02:53 PM).
Zaptinex's Avatar
Zaptinex Zaptinex is offline
 
Join Date: May 2008
Location: USA
Gender:
Posts: 43
Hey i typed this script and it said error 13 type mismatch on line 8

#dynamic 0x16A7C8

#org @start
lock
faceplayer
message @tutorial
boxset 5
compare LASTRESULT 1
if b_true goto @yes
compare LASTRESULT 0
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!
  #140    
Old September 28th, 2008 (04:31 PM).
~Teh Panda~'s Avatar
~Teh Panda~ ~Teh Panda~ is offline
Sea of Dreams - Redux
Silver Tier
 
Join Date: Aug 2007
Posts: 905
Quote originally posted by Zaptinex:
Hey i typed this script and it said error 13 type mismatch on line 8

#dynamic 0x16A7C8

#org @start
lock
faceplayer
message @tutorial
boxset 5
compare LASTRESULT 1
if b_true goto @yes
compare LASTRESULT 0
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!
Mine compiled fine, try to change the compare LASTRESULT 0 and 1 to or just keep trying is that an open offset?

Code:
Compare LASTRESULT 0x0
Code:
Compare LASTRESULT 0x1
__________________




Mystic still in work to let you know...
  #141    
Old September 28th, 2008 (08:54 PM).
Zaptinex's Avatar
Zaptinex Zaptinex is offline
 
Join Date: May 2008
Location: USA
Gender:
Posts: 43
It works now thanks for the help
  #142    
Old September 29th, 2008 (03:12 PM).
~Teh Panda~'s Avatar
~Teh Panda~ ~Teh Panda~ is offline
Sea of Dreams - Redux
Silver Tier
 
Join Date: Aug 2007
Posts: 905
Quote originally posted by Zaptinex:
It works now thanks for the help
no problem, just ask me if you need anything!
__________________




Mystic still in work to let you know...
  #143    
Old October 2nd, 2008 (07:56 AM).
j_legolas j_legolas is offline
 
Join Date: Sep 2008
Gender:
Posts: 7
i tried putting the script but after everything the script does not work in the game.
(i walk over the supposed script tile but nothing happens)

#dynamic 0x??????

#org @begin
lock
message @stop
boxset 0x6
applymovement 0xFF @move
waitmovement 0
release
end

#org @stop
= I should take my pokemon \non the table first.

#org @move
#raw 0x10 0xFE

and how do i make it so that i cannot pass this script without taking my pokemon?
the take pokemon script is success.

'-----------------------
#org 0x??????
lock
faceplayer
msgbox 0x871AED1 '"Guess I'll use Larvitar today."
callstd 0x6
givepokemon 0xF6 0x5 0xCB 0x0 0x0 0x0
hidesprite 0x1
release
end


'---------
' Strings
'---------
#org 0x71AED1
= Guess I'll use Larvitar today.
  #144    
Old October 2nd, 2008 (02:02 PM).
Makorin's Avatar
Makorin Makorin is offline
Ex-ROM Hacker
 
Join Date: Oct 2007
Location: The World That Never Was
Age: 18
Gender: Male
Nature: Naive
Posts: 337
Quote originally posted by j_legolas:
i tried putting the script but after everything the script does not work in the game.
(i walk over the supposed script tile but nothing happens)

Spoiler:

#dynamic 0x??????

#org @begin
lock
message @stop
boxset 0x6
applymovement 0xFF @move
waitmovement 0
release
end

#org @stop
= I should take my pokemon \non the table first.

#org @move
#raw 0x10 0xFE

and how do i make it so that i cannot pass this script without taking my pokemon?
the take pokemon script is success.

'-----------------------
#org 0x??????
lock
faceplayer
msgbox 0x871AED1 '"Guess I'll use Larvitar today."
callstd 0x6
givepokemon 0xF6 0x5 0xCB 0x0 0x0 0x0
hidesprite 0x1
release
end


'---------
' Strings
'---------
#org 0x71AED1
= Guess I'll use Larvitar today.
Spoiler:



Well its pretty easy 2 say wats wrong
did u compile it with those question marks for the offset? thts wat i goota ask
then if u did go into FSF if u have it or go into AdvanceMap and search for free space (in AdvMap go to the magnifine glass) for this script it would be something like oh probably 500 - 1000 bytes
__________________

Anime-Planet.com - anime | manga | reviews
  #145    
Old October 3rd, 2008 (03:59 AM).
j_legolas j_legolas is offline
 
Join Date: Sep 2008
Gender:
Posts: 7
Well, it's kinda obvious i used an actual offset.

And i just tried using a 500 byte space offset, but my body hangs when i step on the tile while the game music plays as normal.

so it's kinda no diff to all the times i trial and error.
still need help *sobs*

thx anyway
  #146    
Old October 3rd, 2008 (02:34 PM).
dbrown123's Avatar
dbrown123 dbrown123 is offline
 
Join Date: Jul 2008
Location: ny
Gender:
Posts: 35
this is the best tut ever i cant wait till the next 3 parts it taught me how to script easily but it will take me some time to remeber all the stuff haha but yea thanks
__________________
[img]http://www.pokecharms.com/trainercards/cards/482008/7bd87568a001d46e98dfd5d89e3a66b7.png
  #147    
Old October 3rd, 2008 (05:00 PM).
Makorin's Avatar
Makorin Makorin is offline
Ex-ROM Hacker
 
Join Date: Oct 2007
Location: The World That Never Was
Age: 18
Gender: Male
Nature: Naive
Posts: 337
Quote originally posted by j_legolas:
Well, it's kinda obvious i used an actual offset.

And i just tried using a 500 byte space offset, but my body hangs when i step on the tile while the game music plays as normal.

so it's kinda no diff to all the times i trial and error.
still need help *sobs*

thx anyway
well then u have a problem in AdvMap
click on the script tile and you have to fill the variable boxes(i think thts what its called) like if its (Example) in Pallet Town the one where oak gets u to his lab has 4050 in one and 0003 in another (but this would only work in the 3.0 map bank for some reason (thts how it works for me anyway)
__________________

Anime-Planet.com - anime | manga | reviews
  #148    
Old October 4th, 2008 (12:55 AM).
Hiche.. Hiche.. is offline
 
 
Join Date: Apr 2008
Posts: 979
Quote originally posted by j_legolas:
Well, it's kinda obvious i used an actual offset.

And i just tried using a 500 byte space offset, but my body hangs when i step on the tile while the game music plays as normal.

so it's kinda no diff to all the times i trial and error.
still need help *sobs*

thx anyway
Spoiler:


#dynamic 0x8806B0

#org @begin
checkflag 0x828
if 0x1 goto @done

message @stop
callstd 0x6
applymovement 0xFF @move
waitmovement 0x0
release
end

#org @done
release
end


#org @stop
= I should take my pokemon \non the table first.

#org @move
#raw 0x10 0xFE


This worked perfectly on my ROM.
Put the Unknown: 0003
and the varnumber: 5040, 4050, or 7C40.
When you did the givepokemon script, did you put setflag 0x828 before the release command?
Sorry it didn't help.
  #149    
Old October 4th, 2008 (02:02 PM).
0m3GA ARS3NAL's Avatar
0m3GA ARS3NAL 0m3GA ARS3NAL is offline
Im comin' home...
Silver Tier
 
Join Date: Jan 2008
Location: Superjail Penitentiary
Age: 22
Gender: Male
Nature: Gentle
Posts: 1,816
Quote originally posted by Tamerhaidar:
Spoiler:


#dynamic 0x8806B0

#org @begin
checkflag 0x828
if 0x1 goto @done

message @stop
callstd 0x6
applymovement 0xFF @move
waitmovement 0x0
release
end

#org @done
release
end


#org @stop
= I should take my pokemon \non the table first.

#org @move
#raw 0x10 0xFE


This worked perfectly on my ROM.
Put the Unknown: 0003
and the varnumber: 5040, 4050, or 7C40.
When you did the givepokemon script, did you put setflag 0x828 before the release command?
Sorry it didn't help.
Another pointless tidbit of information, when you are scripting a line of movements in XSE (example #raw 0x10 0xFE )
You can get rid of the 0x parts, because anything after #raw, XSE reads as hex.
(#raw 10 FE )
Saves time I think, but try 0300 as the Unknown as well. (If the other one, 0003 doesn't work.
( I know I gave a lot of useless info, but I think removing 0x from movement codes are faster) Lawl
__________________
>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...

>
  #150    
Old October 4th, 2008 (02:18 PM). Edited October 4th, 2008 by duturnocheese.
duturnocheese duturnocheese is offline
 
Join Date: Oct 2008
Posts: 9
Try this for givepokemon:
givepokemon 0x9 0x70 0x0 0x0 0x0 0x0
and then for battle:
wildbattle 0x250 0x70 0x0 0x0 0x0 0x0

Quote originally posted by mattattack:
Hi I'm having a problem scripting every time I click on the guy or pokemon to activate the script it won't active meaning it won't give the the blastoise or I can't fight Ho-oh (note: It was a test run)

#dynamic 0x3B4DF4

#org @emergencygivepokemon
lock
faceplayer
message @give
boxset 6
givepokemon 9 70 0 0 0 0
release
end

#org @give
= Quick!/pTake Blastoise to kill/nHo-oh!

Ho-Oh script:

#dynamic 0x3B4DF5

#org @bossfight
lock
faceplayer
message @Ho-Oh
boxset 6
cry 0xA1 250
nop
nop
wildbattle 250 70 0 0 0 0
fadescreen 0
#raw 53 0F 80
setflag 200
release
end

#org @Ho-Oh
= HO-OH: KYOOOO



and also I can't press the compile button because it won't come up, but the debug thing next to it when I click on it it compiles

also I downloaded this from studio pokemon XSE
I am not sure why this does not work.
I would appreciate it if anyone could help me out.
I am only a beginner at scripting.

#Dynamic 0x9C8E80
#org @start
checkflag 0x860
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 out of (name) town/nwithout a pokemon.
#org @back
#raw 0x00 0xFE
#org @end
release
end
Closed Thread
Quick Reply

Sponsored Links
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 07:58 AM.