PDA

View Full Version : [Scripting] jonahs XSE tutorial


someone from tk 6D
February 29th, 2012, 10:26 AM
Hi,im someone from TK 6D and i'm here with a XSE tutorial. Please give me some constructive comments and dont be afraid to criticize me.P.S. If you liked my tutorial, you could apply for my new project,pokemon darknos soul.As this tutorial only works with XSE v1.1.1,only use that version of XSE.Onwards!

THE BASICS OF SCRIPTING
in this part of scripting,well learn the basics.click the spoiler to find out more......
okay, a basic text script. this makes a person talk. ill show you a sample,then i'll explain the commands.

CODE:
#dynamic 0x(offset)
#org @start
lock
faceplayer
msgbox @text 0x6
release
end
#org @start
=Hi!/nim TOM DICKHARRY.

EXPLANATION OF COMMANDS::::::

Okay, looks a bit intimidating,but it,s pretty easy.
#dynamic:the starting line of a script.ALL scripts start with this line.
0x(offset):the 0x.... is also compulsory. the offset is basically a number that you put into a script to get unused space in the rom. how to get the offset?

HOW TO GET THE OFFSET:
In XSE, go to tools, then HEX VIEWER. scroll down until you see a whole row of 0000 0000 0000..... yeah,like that. then, on the right side of the 0s, you will see 0x(some random number) remember the number after the 0x...... and copy it.

Now, go back to XSE and in the 0x......... replace the........ with the number in the hex viewer. NOTE: YOU CANT USE EACH NUMBER TWICE.

EXPLANATION OF COMMANDS CONT:
#org @start: also compulsory. @start is a pointer. pointers can be @(whatever word you like.) NOTE: pointers cannot have any spaces, so these wont work : @ hi i suck,@ hi i rock,@ pikachu !

while these will work:@sert @qwerty,@zxcvbnm.
lock:locks the player in place so that he cant move when talked to.
XTRA: a new variation,, LOCKALL locks EVERYONE in place. if you use lockall,releaseall also has to be used.

msgbox @text 0x6: msgbox is basically to call out the text box. textbox 0x6 is a normal textbox. a pointer always follows after msgbox command.

faceplayer: makes the player face the person when being talked to.

release: releases the player.
XTRA: a new variation, RELEASEALL relezases everyone. only use this if lockall was used before.

/n: makes the text move to another line...

end: ends the script.

easy right? now that we know text messages, lets move on to the next section! [/SPOILER ]!!!!!!

Now, youve finished learning text scripts,now lets move on to .....

YES/NO SCRIPTS!
[SPOILER ] alright, the yes or no scripts! these scripts give you a result based on your YES/No answer. i won't explain the commands you already know,just the new ones......

CODE:
#dynamic 0x(offset)
#org @start
lock
faceplayer
msgbox @yesno 0x5
if 0x1 goto @yes
if 0x0 goto @no
release
end
#org @yesno
(equal symbol)yes or no????
#org @yes
msgbox @yipee 0x6
release
end
#org @no
msgbox @bad 0x6
release
end
#org @yipee
(equal symbol)you said yes!
#org @bad
(equal symbol)you said no.

.............................................................
EXPLANATION......
quite a lot to cover here people!

boxtyype:0x5 : this boxtype is basically the command to call out the small yes or no option box.

if 0x1/0x0 goto @yes/@no: if is a very powerful command. it gives the script two possibilities. if you press yes,what will happen, and if you press no, what will happen. 0x0 is NO and 0x1 is yes goto is just a command.
thats all for YES or NO scripts. the nest section tells you about flags.[/SPOILER ]

Okay, you've made it this far, scripter apprentice. now for flags. check it out

FLAGS[SPOILER ]
......................................................................................................................................................
Flags are pretty basic. it's just a way of cheacking events in the game.

CODE:(CREDITs GO TO SHINY QUAGSIRE)


#dynamic 0x(offset)

#org @start
lock
faceplayer
checkflag 0x860(for emerald)/0x828(for FR/LG)
if 0x1 goto @talked
setflag 0x860/0x828
msgbox @msg 0x2
release
end

#org @talked
msgbox @talkd 0x2
release
end

#org @msg
givepokemon 0x1 0xD 0x1 0x0 0x0 0x0

#org @talkd
= You already talked to me !
EXPLANATION
allright people, calm down. i know this script has the long awaited givepokemon command but later......okay? sheesh!
............................................................................
setflag: this command basically checks a flag.
flag 0x828/0x860:this flag basically opens the pokemon menu.there are many more flags that do many more things. check it out!
FLAGS FOR FR/LG:
0x820 - First Badge
0x821 - Second Badge
0x822 - Third Badge
0x823 - Fourth Badge
0x824 - Fifth Badge
0x825 - Sixth Badge
0x826 - Seventh Badge
0x827 - Eighth Badge
0x828 - Pokemon Menu
0x829- Pokedex Menu
0x82F - Running Shoes
EMERALD
0x860 Pokemon Menu
0x861 Pokedex Menu
0x862 Pokenav menu

EXPLANATION OF COMMANDS CONT.
checkflag:checks the flag later
setflag:sets a flag
another command,not in this script, is the command clearflag i'll explain it below.
....................................................................................................................................................
clearflag:clears a flag after you have set it. only use it after you have used the commmand SETFLAG.[/SPOILER ]now we are moving on to the 2 much awaited commands.....GIVEPOKEMON and......GIVEITEM. onwards!!!!!!!
GIVEPOKEMON AND GIVEITEM[SPOILER ] okay, givepokemon command shall be explained forst,followed by the giveitem command.
............................................................................................................

GIVEPOKEMON:

CODE:
........................................................................................................................................................

#dynamic 0x(offset)
#org @start
lock
faceplayer
givepokemon 0x(pokemon number in hex) 0x(pokemon level in hex) 0x(pokemon item in hex)0x0 0x0 0x0
release
end

pretty self explanatory.i've already explained it there.
moving on....
........................................................................................................................................................

GIVEITEM

CODE:
#dynamic 0x(offset)
#org @start
lock
faceplayer
giveitem 0x( item number in hex) 0x(quantity of itemm)
release
end[/SPOILER ]
........................................................................................................................................................
OKAY, thats the end of my XSE tut. i hope you enjoyed and appreciate it. please post!

someone from tk 6D
March 4th, 2012, 10:28 AM
Hi everyone, im jonahtan here with the scripting extreme.these scripts are the hardest to master and make the average and good hack have a difference.

NOTE: THIS TUTORIAL IS MEANT ONLY FOR ADVANCED SCRIPTERS:NOT FOr N00BS OR INTERMEDIATE SCRIPTERS!

table of contents:
Paymoney
Givemoney
Weather Commands
Trainer Battles
Warps
Fadescreen
Items(Advanced)

and more to come in future updates(guaranteed!)
.....................................................................................................

Paymoney:
this is probabaly the worst in any hack,paying money....
part of life......

CODE:
#dynamic 0x(offset)
#org @start
lock
faceplayer
msgbox @payupcash 0x6
paymoney (amount) 0x0
release
end
#org @payupcash
(equal symbol) pay up your debts!
.....................................................................................................

GIVEMONEY:

the opposite of paymoney,the best thing ever,people give YOU money!
........................................................................................................................................................
CODE:

#dynamic 0x(offset)
#org @start
lock
faceplayer
msgbox @getcash 0x6
givemoney (amount) 0x0
release
end
#org @getcash
(equal symbol) here's the cash...
.....................................................................................................

so,you see, thats about it for MONEY!
.......................................................................................................................................................
WARPS:

when you walk into a house of bulidng, the WARP scripts is activated. it transports you between maps. there are many different kinda of warps...


warp:regular
warpwalk: warps with walking effect???
warphole: the falling into a pit effect
warpteleport:???

I'm not really sure how to explain the effects,try them out yourself. the code for every warp is the same,except warphole...
........................................................................................................................................................
NORMAL WARP CODE:

#dynamic 0x(offset)
#org @start
lock
faceplayer
warp/warpwalk/warpteleport 0xMAP 0xBANK 0xEXIT 0xX 0xY
release
end
........................................................................................................................................................

now, the MAP and the BANK can be found in advanced map, e.g, pallet town 0.12. the MAP is 0x0 and the bank is 0x12. the X and Y coordinates can be found in advanced map too.
........................................................................................................................................................

now for warphole:

CODE:

warphole 0xMAP 0xBANK

i personally prefer to use warphole, its scripts are the easiest and the effects are the best. oh well,try it out yourself!
........................................................................................................................................................

WEATHER COMMANDS:

these commands change the weather....

CODE:

#dynamic 0x(offset)
#org @start
lock
faceplayer
setweather 0x(type of weather)
doweather
msgbox @a 0x6
resetweather
msgbox @b 0x6
release
end
#org @a
(equal symbol)its(whatever type of weather)!
#org@b
(equal symbol) it stopped(type of weather)......
........................................................................................................................................................

okay, here's the commands!

setweather 0x(type of weather)- sets the desired weather
doweather- does the weather specified in SETWEATHER
resetweather-defualts back to the original weather

and thats about it for weather. enjoy!
........................................................................................................................................................

pokemorts:

sure, i bet ther's a prgram to edit pokemarts , like a mart,but there are no programs to ever MAKE one... this script will make a mart, so thats when you talk to the person or object, a mart will pop up. this is like applymovement scripts, pretty heavy on #raw's..........

CODE:

#dynamic 0x(offset)
#org @start
lock
faceplayer
pokemart @goods
release
end
#org @goods
#raw 0x( item id) 0x(item id) 0x(item id) 0x(item id) 0x(item id) 0x0
...................................................................................................
i'm not going to provide you the item id's but if you need any resiourced such as item id's or weather commands,please post to inform me.

new commands used:

pokemart-sets a mart
after the item id's , use 0x0 to end it
.......................................................................................................................................................

FADESCREEN

see, this is what i mean earlier about what seperates an average from a good hack this scripts fade the screen not only in a battle,but anywhere!

CODE:

#dynamic 0x(offset)
#org @start
lock
faceplayer
fadescreen 0x(effect)
wildbattle 0x1 0x5 0x5
msgbox @afterfade 0x6
release
end
#org @afterfade
(equal symbol) bulba......
.................................................................................................................................................


there are only 4 fadescreen effects here, so i'll post them below. in my script, i only put one fadescreen command, but it's normal to put over 5-10 fadescreens in a row to stimulate earhquakes,fissures........ E.G from black to white,black to normal..white to black etc.

FADESCREEN CODES:(RESOURCE CREDITS TO SHINY QUAGSIRE)

0x0 - fade from black to normal
0x1 – fade from normal to black
0x2 – fade from white to normal
0x3 – fade from normal to white

There you have it! Pretty simple!
....................................................................................................................................................

what's a pokemon game without a battle?
we shall make one now...

CODE(shiny quagsire,tnx for the code!)

#org @start
lock
faceplayer
trainerbattle 0x0 0x59 0x0@intro @defeat
msgbox @msg 0x2
release
end

#org @intro
= Yo, you must be a new trainer.\nLet's battle !
#org @defeat
(equal symbol) noo...
#org @msg
(equal symbol)
train more.....
...................................................................................................

the format for a tgrainer battle is this:

trainerbattle 0x(0 if reg, 1 is double and 4 is official,like rival or gyms) 0x(trainer id,in a trainer) 0x0

after a trainerbattle,there must always be 2 pointers on the same line(@intro-before battle msg and @defeat-when you win msg)

....................................................................................................

that's it! be sure to check back for more updates!

P.S: you can thank me by posting your thoughts in thsi thread. i'm okay with criticism...

TNX!

Fireworks
March 4th, 2012, 09:50 PM
Honestly this would be a better tutorial if it was readable. You made many spelling and grammar mistakes, your spoiler tags need fixed and instead of typing "(equal symbol)", you should type...an equal symbol. :\
Fix that, it will be much easier to understand.

someone from tk 6D
March 4th, 2012, 10:56 PM
I will do that. P.S. how do you make a WORKING spoiler tag? Am I using the correct format? Tnx

giradialkia
March 4th, 2012, 11:57 PM
There's no real need for two separate threads if both tutorials are on scripting (even if they deal with different kinds of scripting- you can just use the same thread, and divide the post into appropriate sections for different levels of scripting). The two threads have been merged to this one.

LudicoloDude
June 11th, 2012, 08:55 PM
I'm having some trouble with something. I made a script that makes your rival come out of a building and I cant figure out how to keep that sprite hidden until you step on the script tile.

tajaros
June 12th, 2012, 03:24 AM
I'm having some trouble with something. I made a script that makes your rival come out of a building and I cant figure out how to keep that sprite hidden until you step on the script tile.

Try inputing on his person ID 002C or maybe you should have a his flag already set early in the game so when you step on the script you can just use the clearflag but with 002C you can just use the showsprite command... :)

Hope this helps... :D

LudicoloDude
June 14th, 2012, 01:12 PM
I tried both of them and the sprites do disapear, but they don't reappear when I step on the script tile. It still works and everything but I don't see the sprites. what i did was set the flag early and gave that flag to the people ID and cleared the flag on the script tiles, should I do that differently?

tajaros
June 15th, 2012, 09:26 AM
I tried both of them and the sprites do disapear, but they don't reappear when I step on the script tile. It still works and everything but I don't see the sprites. what i did was set the flag early and gave that flag to the people ID and cleared the flag on the script tiles, should I do that differently?

Yes you can do that but I forgot to tell you that you can also you use the showsprite command but you can also do the thing you said.. :D

LudicoloDude
June 15th, 2012, 11:44 AM
I did use showsprite, which I should have mentioned that in my last comment. And like I said before, the script does work but the sprites just dont show and im not sure why. I did everything you said to do. Maybe the scripts should be typed differently?

AtoxGatal
March 22nd, 2013, 02:33 AM
Hey.. I'm currently have problem with warp script..

=====

This is my first try on pokemon hacks, but the warp script won't work on my hack..

This is my script..



#dynamic 0x800000
#org @introre
lock
message @introte
boxset 6
release
applymovement 0xFF @intromo
waitmovement 0x0
message @introte2
boxset 6
applymovement 0xFF @intromo2
waitmovement 0x0
message @introte3
boxset 6
applymovement 0xFF @intromo3
waitmovement 0x0
message @introte4
boxset 6
warpteleport 0x1 0x4 0x1 0x2 0x5
end



Could anybody tell me what went wrong? :)

theRiolvile
March 30th, 2013, 12:51 PM
The applymovement is still not when I tested it the script did not apear