• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

XSE Scripting Tutorial

Status
Not open for further replies.

Darthatron

巨大なトロール。
1,152
Posts
18
Years
So according to you Zodiac something like this would work!

Code:
#Dynamic 0x800000

#ORG @Main
Lock
FacePlayer
checkflag 0x200
if b_true goto @gotit
GivePokemon 25 5 4 0 0 0
message @recieved
setflag 0x200
Release
End

#ORG @gotit
message @howis
Release
End

#ORG @recieved
=Here is pikachu!

#ORG @howis
=How is pikachu doing?

That will work fine. Except I think you need a space after the "=" in Text Scripts.
Code:
#ORG @recieved
=Here is pikachu!

#ORG @howis
=How is pikachu doing?
Should be
Code:
#ORG @recieved
= Here is pikachu!

#ORG @howis
= How is pikachu doing?

Oh, I'm using a script test Rom for Fire Red.
Oh, well... If it can wait a few days the new version of XSE will have color codes included. :) Otherwise, PM me, and I'll explain.
 
Last edited:

Master_Track

ROM Reaverz Scripter
916
Posts
16
Years
I'm quite sure I used colour codes with XSE O.o
I'll try it out again, but I'm sure it was with XSE......
just wrote \c\h01\h04 (code for red).
 

Jamiras843

Dee-dee-dee
18
Posts
15
Years
  • Seen Oct 19, 2013
I need halp with a script I made... To get your first pokemon you talk to this guy, he just says "test blah blah blah" then you get a Houndour and music plays and a txt box pops up saying "[PLAYER] recieved a HOUNDOUR!" but after that box the "test blah blah blah" box comes back and so does the "[PLAYER] recieved a HOUNDOUR!" then it just stops. How do I make it not repeat the second time? this is the script its not fully complete but the whole repeat thing bugs me...

#dynamic 800109

#org @starterpkm
lock
faceplayer
checkflag 0x200
if 0x1 goto @father1
msgbox @houndour
callstd 0x6
goto @houndourget
release
end

#org @father1
lock
faceplayer
msgbox @well
callstd 0x6
release
end

#org @houndour
= test blah blah blah

#org @houndourget
lock
fanfare 0x13E
msgbox2 @houndourget2
waitmsgbox
waitfanfare
callstd 0x6
givepokemon 0xE4 0x5 0x0 0x0 0x0 0x000000 0x00
setflag 0x200
setflag 0x828
release
end

#org @houndourget2
= \v\h01 received a HOUNDOUR!

#org @well
= You already have a pokemon
 

Dr.Razor

Yellow Remaker
101
Posts
16
Years
I show my method tu use XSE:
-Insert script with Poketscript
-Then decompile the script with XSE
-Edit it
-Compile it.

I use this way because i don't like very much dynamic system
and i can edit the script easily with XSE

Hope it will help someone^^

Ps:Sorry for my english.
 
77
Posts
16
Years
  • Seen Feb 16, 2017
Well, why do you have two setflags, try giving the 0x828 just away. I am not a XSE-Pro, I am also only learning right now, but I know some stuff about PokeScript..so yeah..
 

Jamiras843

Dee-dee-dee
18
Posts
15
Years
  • Seen Oct 19, 2013
Well, why do you have two setflags, try giving the 0x828 just away. I am not a XSE-Pro, I am also only learning right now, but I know some stuff about PokeScript..so yeah..

The 0x828 flag is the flag that enables you to view your pokemon status, this flag is enabled when you choose your starter pokemon. Since this is your starter pokemon I need to enable that flag, or else you just get the pokemon and can't check its status.
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
That will work fine. Except I think you need a space after the "=" in Text Scripts.
Code:
#ORG @recieved
=Here is pikachu!

#ORG @howis
=How is pikachu doing?
Should be
Code:
#ORG @recieved
= Here is pikachu!

#ORG @howis
= How is pikachu doing?


Oh, well... If it can wait a few days the new version of XSE will have color codes included. :) Otherwise, PM me, and I'll explain.

My script glitches, when I talk to the person assigned with this it shows no text but gives the poke, then when I go to bag, you change your character to the giver of the pokemon! What did I do wrong, here is my improved script

Spoiler:
 

Jamiras843

Dee-dee-dee
18
Posts
15
Years
  • Seen Oct 19, 2013
My script glitches, when I talk to the person assigned with this it shows no text but gives the poke, then when I go to bag, you change your character to the giver of the pokemon! What did I do wrong, here is my improved script

Spoiler:

This happened to me, If you change maps before going to the bag it shouldnt switch characters. I wish I could tell you how to fix it, but if you do let me know I would like to fix that on mine too :)
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
This happened to me, If you change maps before going to the bag it shouldnt switch characters. I wish I could tell you how to fix it, but if you do let me know I would like to fix that on mine too :)

Ya I fixed the change character thing by making it say if b_false goto @recieved instead of message @recieved after the givepokemon but placed it before the givepokemon! Now I am giong to try to move the givepokemon script to one of the subscripts and see if any positive results happen.
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
#Dynamic 0x71A2EC

#ORG @Main
Lock
FacePlayer
checkflag 0x200
if b_true goto @gotit
GivePokemon 0x25 0x5 0x4 0x0 0x0 0x0
message @recieved
boxset 0x2
setflag 0x200
Release
End

#ORG @gotit
message @howis
boxset 0x2
End

#ORG @recieved
= Here is pikachu!

#ORG @howis
= How is pikachu doing?
here, its a bit improved, I did it in a rush, tell me if there's errors. Um, you've forgot to put boxset under message. There's no need to use CAPs(Uppercase) but thats upto you.
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
here, its a bit improved, I did it in a rush, tell me if there's errors. Um, you've forgot to put boxset under message. There's no need to use CAPs(Uppercase) but thats upto you.

Thanks, it worked, time to add my movement script, this is gonna be the beginning of new hack!

My Movement script is like this and when I compile and open it adds every movement so it confuses itself while moving and freezes, why is it doing this!
Code:
#dynamic 0x71A2E0

#org @beginning
lockall
checkflag 0x200
if b_true goto @gotit
applymovement 0x2 0x71A2E0
applymovement MOVE_PLAYER 0x71A41C
waitmovement 0x0
call 0x71A41C
boxset 0x2
releaseall
end

'-----------
' Movements
'-----------
#org 0x71A2E0
#raw 12 'Step Left (Normal)
#raw 4A 'Face player
#raw FE 'End of Movements

#org @gotit
release
end
 
Last edited:

Darthatron

巨大なトロール。
1,152
Posts
18
Years
Thanks, it worked, time to add my movement script, this is gonna be the beginning of new hack!

My Movement script is like this and when I compile and open it adds every movement so it confuses itself while moving and freezes, why is it doing this!
Code:
#dynamic 0x71A2E0

#org @beginning
lockall
checkflag 0x200
if b_true goto @gotit
applymovement 0x2 0x71A2E0
applymovement MOVE_PLAYER 0x71A41C
waitmovement 0x0
call 0x71A41C
boxset 0x2
releaseall
end

'-----------
' Movements
'-----------
#org 0x71A2E0
#raw 12 'Step Left (Normal)
#raw 4A 'Face player
#raw FE 'End of Movements

#org @gotit
release
end
First off, you really shouldn't be using a mix of Dynamic and Static Offsets in your script. This makes it kind of difficult to read...

If possible could you show me the fully non-compiled script? Unless you don't have one... In which case please PM me with exactly what you want the script to do and I'll write you up a script and show you exactly what each command does. :)
 

Charliezard

A wild shroomish appeared!
1,276
Posts
16
Years
Code:
#Dynamic 0x3B4D84

#org @Main
Lock
FacePlayer
Message @Speak
BoxSet 0x06
release
end
#org @Speak
= "Hey!"

That's my script. :)
On Advance Map I create a person, Their Offset is 71A284
Their script offset is 3B4D84.
I click "Open script" in advance map and XSE opens up with FireRed as file and 3B4D84 as the offset.
That's when I put this in
Code:
#Dynamic 0x3B4D84

#org @Main
Lock
FacePlayer
Message @Speak
BoxSet 0x06
release
end
#org @Speak
= "Hey!"
Same code again :P
And hit Compile. It says it worked but it doesn't...Whenever I re open the script offset 3B4D84 It gives me a blank page...almost
Code:
'-----------------------
#org 0x3B4D84

And the person doesn't talk to me ingame. What am I doing wrong?
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
And the person doesn't talk to me ingame. What am I doing wrong?

lol, you're not supposed to use offsets anyhow, try looking for lot of FF's(byte 0xFF), FF means free space, other than that it means its used. Try to optimise your script also:

#Dynamic 0x3B4D84

#org @Main
Lock
FacePlayer
Message @Speak
BoxSet 0x06
release
end
#org @Speak
= "Hey!"
to:
#dynamic 0xYour Free Space Offset
#org @Main
message @speak
boxset 0x2 ' 0x2 contains a builtin faceplayer and lock
end

#org @speak
= "Hey!"
 

Tré

Raised by the bastards of 1969
1,591
Posts
16
Years
Spoiler:


uhhh...what's wrong with these it says....
"unknown keyword "@poke" at line 9"
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
uhhh...what's wrong with these it says....
"unknown keyword "@poke" at line 9"
of course there's something wrong, you've completely mistaken XSE as pokewitch, XSE uses the original method for msgbox scripts. Here's the code
#dynamic 0x800000
#org @Start
msgbox @msg
boxset 0x2
end

#org @msg
= ....
Once again, this here's XSE, not pokewitch. Plus there's command help, just press F1 if you don't understand any command or if it says unknown keyword-honestly do anyone ever bother reading the command database before scripting?
 

Charliezard

A wild shroomish appeared!
1,276
Posts
16
Years
lol, you're not supposed to use offsets anyhow, try looking for lot of FF's(byte 0xFF), FF means free space, other than that it means its used. Try to optimise your script also:


to:

Thanks, but I already had an offset in the top part that I found uses FsF. I got it to work by looking at other scripts already in Pokemon.
Made it like this
Code:
'-----------------------
#org 0x3B4D84
lock
faceplayer
msgbox2 0x8456734 '""
callstd 0x6
release
end


'---------
' Strings
'---------
#org 0x456734
= Hey! How are you?

XSE gave me a hand and put thre strings part in automatically :D Hazzam lol
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
Lol my warp goes to nowhere, well to a black map where I cant see anything not even the character! i got everything else to work how I wanted it too!

here is my code

Code:
#dynamic 0x71A5F8

#org @start
lock
faceplayer
checkflag 0x829
checkflag 0x828
if b_true goto @letin
message @message
callstd 0x6
release
end

#org @letin
message @open
boxset 0x6
warp 0x3 0x66 0xFF 0x6 0x17
release
end

#org @message
= I cannot let you pass\nGet your pokemon from\pJesse outside and your\npokedex from that\ptable.

#org @open
= You may proceed.
 
Status
Not open for further replies.
Back
Top