• 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.

ℜªℳ

RAM Corporation |\/| ][ |\/|
214
Posts
16
Years
  • Age 29
  • Seen May 11, 2016
I've heard that someone can use XSE to get night and day in Firered adn or leafgreen. Is this possible or is this a rumor? If it is possible has it been dun before?
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
@hockeypanda32 - is the map bank, map number, and warp number in hex?

@KanouKono - You can't, there's no such thing. Day and Night can only be achieved by ASM.
 

/Circa

a face in the clouds.
881
Posts
16
Years
You cant use a normal script to make a day night system in FireRed.
The only way, of which I know, is to use a level script in every single map, which would of worked like thethethethe's weather script, but the day and night would go by too fast, and it would require too much space. People just need to give up on this until someone can figure out a way to input a real time clock into FireRed. Which so far doesnt exist.
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
@hockeypanda32 - is the map bank, map number, and warp number in hex?

@KanouKono - You can't, there's no such thing. Day and Night can only be achieved by ASM.

I am trying to warp to map Route 1 and have it at X: 6 Y:17

its this line

Code:
warp 0x3 0x66 0xFF 0x6 0x17
 

Hardy Har Har

Oh dear, oh my...
258
Posts
15
Years
help here

i tried to compile this script(in the spoiler):
Spoiler:

Then a window pops out, saying:
Error 13 'Type mismatch' on line 10
Missing #define or parameter
Line: wildbattle 130 30 1
 

/Circa

a face in the clouds.
881
Posts
16
Years
Hockeypanda:

You'll need to convert it to hex if you put 0x infront of it.
17 should be 0x11. I think Advance Map has is in decimal, if not, im wrong. Try it anyways though.

Psyduck007:

Why did you add a nop? It doesnt mean anything.
Also, there must be something wrong with your command if it says that.
Try this:

Code:
startwildbattle 0x82 0x1E 0x0

Instead of wildbattle, remember XSE has some differences to other scripting programs.
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
I am trying to warp to map Route 1 and have it at X: 6 Y:17

its this line

and which warp?

but this should work:
warp 0x3 0x13 0xFF 0x6 0x11
remember the values should be in hex, use XSE's built in calculator to find the values.

Line: wildbattle 130 30 1
wildbattle is a construct, why don't you check the database to see what's wrong, but, I think you're trying to use this:
startwildbattle 0xPK 0xLV 0xItem
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
and which warp?

but this should work:

remember the values should be in hex, use XSE's built in calculator to find the values.


wildbattle is a construct, why don't you check the database to see what's wrong, but, I think you're trying to use this:
startwildbattle 0xPK 0xLV 0xItem

Great how do I post pone it til after my message?
 

Charliezard

A wild shroomish appeared!
1,276
Posts
16
Years
My earlier script, that I tried jsut had a girl saying "Hey, how are you?"
Now I tried to make one that gave you a Pikachu then asked how the Pikachu was...
I clicked open script in advance map and opened the old script in XSE
Code:
'-----------------------
#org 0x3B4D84
lock
faceplayer
msgbox2 0x8456734 '"Hey! How are you?"
callstd 0x6
release
end


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

That one works, I had the offset in XSE as 3B4D84 and comiled it into Fire Red

Now my new script is

Code:
'-----------------------
#Dynamic 0x3B4D84

#org @Talk
lock
faceplayer
checkflag 0x910
if b_true goto @Speak
message @message
givepokemon 0x19 0xA 0x0 0x0 0x0 0x0
setflag 0x910
release
end

#org @Speak
message @Pika
boxset 0x6
release
end

#org @message
= Here, this pikachu\nIs lonely.\nYou take it.

#org @Pika
= How is the Pikachu?

I deleted the old script, and wrote this one in. It doesn't have any errors in it that I know of as it gives me this
Code:
Version\1636 - Pokemon - Fire Red Version.gba...
Processing input script...
2 - DYNAMIC
 > lDynamicStart = 0x3B4D84
4 - ORG
 > lNewOffset = 0x47B0E7
5 - (6A) - LOCK
6 - (5A) - FACEPLAYER
7 - (2B) - CHECKFLAG
 > iWord = 0x910
8 - (??) IF (native)
 > bCondition = 0x1
 This is a jumping IF, 0x06.
 > pTarget = 0x847B139
9 - (0F) MSGBOX (native)
 > pText = 0x847B22F
10 - (79) - GIVEPOKEMON
 > iWord = 0x19
 > bByte = 0xA
 > iWord = 0x0
 > lDword = 0x0
 > lDword = 0x0
 > bByte = 0x0
11 - (29) - SETFLAG
 > iWord = 0x910
12 - (6C) - RELEASE
13 - (02) - END
15 - ORG
 > lNewOffset = 0x47B139
16 - (0F) MSGBOX (native)
 > pText = 0x847B4C7
17 - (09) BOXSET (native)
 > bType = 0x6
18 - (6C) - RELEASE
19 - (02) - END
21 - ORG
 > lNewOffset = 0x47B22F
22 - RAW TEXT
 > sText = "Here, this pikachu\nIs lonely.\nYou take it."
24 - ORG
 > lNewOffset = 0x47B4C7
25 - RAW TEXT
 > sText = "How is the Pikachu?"
-------------------------------
DYNAMIC_OFFSET 1
 > sLabel = @Pika
 > lOffset = 0x47B4C7
DYNAMIC_OFFSET 2
 > sLabel = @Speak
 > lOffset = 0x47B139
DYNAMIC_OFFSET 3
 > sLabel = @Talk
 > lOffset = 0x47B0E7
DYNAMIC_OFFSET 4
 > sLabel = @message
 > lOffset = 0x47B22F
-------------------------------
Cleaning up...
Closing output...
Finished processing input in 0.145 seconds.

BUT when I close it and go into advance map and reopen the script it still has the first one...and ingame all she says is "Hey, how are you?"
:/ I get this whenever I use #Dynamic 0xOffset
If I start it with #org 0xOffset it works BUT I can't use stuff like #org @message I have to use other offsets :/
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
My earlier script, that I tried jsut had a girl saying "Hey, how are you?"
Now I tried to make one that gave you a Pikachu then asked how the Pikachu was...
I clicked open script in advance map and opened the old script in XSE
Code:
'-----------------------
#org 0x3B4D84
lock
faceplayer
msgbox2 0x8456734 '"Hey! How are you?"
callstd 0x6
release
end


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

That one works, I had the offset in XSE as 3B4D84 and comiled it into Fire Red

Now my new script is

Code:
'-----------------------
#Dynamic 0x3B4D84

#org @Talk
lock
faceplayer
checkflag 0x910
if b_true goto @Speak
message @message
givepokemon 0x19 0xA 0x0 0x0 0x0 0x0
setflag 0x910
release
end

#org @Speak
message @Pika
boxset 0x6
release
end

#org @message
= Here, this pikachu\nIs lonely.\nYou take it.

#org @Pika
= How is the Pikachu?

I deleted the old script, and wrote this one in. It doesn't have any errors in it that I know of as it gives me this
Code:
Version\1636 - Pokemon - Fire Red Version.gba...
Processing input script...
2 - DYNAMIC
 > lDynamicStart = 0x3B4D84
4 - ORG
 > lNewOffset = 0x47B0E7
5 - (6A) - LOCK
6 - (5A) - FACEPLAYER
7 - (2B) - CHECKFLAG
 > iWord = 0x910
8 - (??) IF (native)
 > bCondition = 0x1
 This is a jumping IF, 0x06.
 > pTarget = 0x847B139
9 - (0F) MSGBOX (native)
 > pText = 0x847B22F
10 - (79) - GIVEPOKEMON
 > iWord = 0x19
 > bByte = 0xA
 > iWord = 0x0
 > lDword = 0x0
 > lDword = 0x0
 > bByte = 0x0
11 - (29) - SETFLAG
 > iWord = 0x910
12 - (6C) - RELEASE
13 - (02) - END
15 - ORG
 > lNewOffset = 0x47B139
16 - (0F) MSGBOX (native)
 > pText = 0x847B4C7
17 - (09) BOXSET (native)
 > bType = 0x6
18 - (6C) - RELEASE
19 - (02) - END
21 - ORG
 > lNewOffset = 0x47B22F
22 - RAW TEXT
 > sText = "Here, this pikachu\nIs lonely.\nYou take it."
24 - ORG
 > lNewOffset = 0x47B4C7
25 - RAW TEXT
 > sText = "How is the Pikachu?"
-------------------------------
DYNAMIC_OFFSET 1
 > sLabel = @Pika
 > lOffset = 0x47B4C7
DYNAMIC_OFFSET 2
 > sLabel = @Speak
 > lOffset = 0x47B139
DYNAMIC_OFFSET 3
 > sLabel = @Talk
 > lOffset = 0x47B0E7
DYNAMIC_OFFSET 4
 > sLabel = @message
 > lOffset = 0x47B22F
-------------------------------
Cleaning up...
Closing output...
Finished processing input in 0.145 seconds.

BUT when I close it and go into advance map and reopen the script it still has the first one...and ingame all she says is "Hey, how are you?"
:/ I get this whenever I use #Dynamic 0xOffset
If I start it with #org 0xOffset it works BUT I can't use stuff like #org @message I have to use other offsets :/

notice the dynamics in each you are using the same hex, use a free space finder and change yours, that is what is happening
 

Charliezard

A wild shroomish appeared!
1,276
Posts
16
Years
Thanks, but what If I'm trying to replace the first script? Which is what I am trying. Why can't it have the same offset, and replace the older one?

Also I found that offset in fsf, and used it in my first script, that was practically the one in the tutorial and it had the same problem until I made it like the first script in my post there.

Oki, I changed the offset of the script, and the offset of the event's script in advance map to 71A794 and it works :)

So how do I replace scripts offsets? :/

Also the with the script, she always says "How's Pikachu?" :/ What'd I do wrong there? :P
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
Thanks, but what If I'm trying to replace the first script? Which is what I am trying. Why can't it have the same offset, and replace the older one?

Also I found that offset in fsf, and used it in my first script, that was practically the one in the tutorial and it had the same problem until I made it like the first script in my post there.

Oki, I changed the offset of the script, and the offset of the event's script in advance map to 71A794 and it works :)

So how do I replace scripts offsets? :/

Also the with the script, she always says "How's Pikachu?" :/ What'd I do wrong there? :P

In a hex editor totally clean up the hex manually then if you want to overwrite it! Close XSE after and reopen, then compile
 

Charliezard

A wild shroomish appeared!
1,276
Posts
16
Years
In a hex editor totally clean up the hex manually then if you want to overwrite it! Close XSE after and reopen, then compile

Thanks :D I had sooooooo much problems with this. Tried rescripting it a bazillion times :P
Now I have another problem
Code:
'-----------------------
#org 0x71A794
lock
faceplayer
checkflag 0x910
if 0x1 goto 0x871A7BA
msgbox 0x871A7C5 '"Here, this pikachu\nIs lonely.\nYou..."
givepokemon 0x19 0xA 0x0 0x0 0x0 0x0
setflag 0x910
release
end

'-----------------------
#org 0x71A7BA
msgbox 0x871A7F3 '"How is the Pikachu?"
callstd 0x6
release
end


'---------
' Strings
'---------
#org 0x71A7C5
= Here, this pikachu\nIs lonely.\nYou take it.

#org 0x71A7F3
= How is the Pikachu?

I think The proglem lies in this part...not sure though.
Code:
#org 0x71A794
lock
faceplayer
checkflag 0x910
if 0x1 goto 0x871A7BA
msgbox 0x871A7C5 '"Here, this pikachu\nIs lonely.\nYou..."
givepokemon 0x19 0xA 0x0 0x0 0x0 0x0
setflag 0x910
release
end
Whether I make the if 0x1 or 0x0 she still says "How's the pikachu?" From the begining and never gives it to you. :(

Code:
#org @Talk
lock
faceplayer
checkflag 0x910
checkflag 0x910
if b_true goto @Speak
message @message
givepokemon 0x19 0xA 0x0 0x0 0x0 0x0
setflag 0x910
release
end

Is the same section not compiled.
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
Thanks, but what If I'm trying to replace the first script? Which is what I am trying. Why can't it have the same offset, and replace the older one?

Also I found that offset in fsf, and used it in my first script, that was practically the one in the tutorial and it had the same problem until I made it like the first script in my post there.

Oki, I changed the offset of the script, and the offset of the event's script in advance map to 71A794 and it works :)

So how do I replace scripts offsets? :/

Also the with the script, she always says "How's Pikachu?" :/ What'd I do wrong there? :P
You can use the Erase Function. It is set out like this:
Code:
#Dynamic 0x800000
#Erase 0x812345 0xFF

Just change "0x812345" to the location where your script starts, and also change "0xFF" to how many bytes you want to erase. Hope that helped.

I will edit later and answer the other questions...
 

Charliezard

A wild shroomish appeared!
1,276
Posts
16
Years
So I just recompile it with erase and the amount of bytes the offsets held? Cool
I'ma go make cheese muffins. Thanks for the help...I think I'm actually learning things :P...sorta lol
 

ℜªℳ

RAM Corporation |\/| ][ |\/|
214
Posts
16
Years
  • Age 29
  • Seen May 11, 2016
I guess I'm in the wrong section. This'll do later as I script more but is it possible for anyone to help me navigate to the ASM hack tool or to a tutorial because I can't find one. All thanks is aprreciated and sorry for the clueless spamming.
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
How many more commands are in here than in Poke script?Also, are they important commands?

@yunghove - check the features, XSE has nearly all included though not all uses have been found, but the fact is pokewitch only had 2-5 new commands while XSE outweighs it. Yes, all commands are important, without which the game won't run proper and you won't be able to script.

I guess I'm in the wrong section. This'll do later as I script more but is it possible for anyone to help me navigate to the ASM hack tool or to a tutorial because I can't find one. All thanks is aprreciated and sorry for the clueless spamming.

@KanouKono - There's no such thing is a specific ASM tool, as ASM itself is unspecific, all you need is a emulator with builtin debugger(VBA-SDL-H), disassembler(VBA has one), assembler(GoldRoad, Devkit Adv, etc) and some knowledge on ASM. Then you fiddle around with it, find stuff amd modifiy it to your desire. There aren't much tutorials on ASM, google it or something, PHO has some.
 

Charliezard

A wild shroomish appeared!
1,276
Posts
16
Years
@yunghove - check the features, XSE has nearly all included though not all uses have been found, but the fact is pokewitch only had 2-5 new commands while XSE outweighs it. Yes, all commands are important, without which the game won't run proper and you won't be able to script.



@KanouKono - There's no such thing is a specific ASM tool, as ASM itself is unspecific, all you need is a emulator with builtin debugger(VBA-SDL-H), disassembler(VBA has one), assembler(GoldRoad, Devkit Adv, etc) and some knowledge on ASM. Then you fiddle around with it, find stuff amd modifiy it to your desire. There aren't much tutorials on ASM, google it or something, PHO has some.

There are a lot of very in-depth tutorials on ASM. It's just up to you to gain a decent enough understanding to apply it to roms. The Dark Alliance is a good place to learn basic ASM, and more complicated...Most people who know ASM well, apply their knowkledge in diffrent areas so yeh. Also Cheat engine and it's tutorial are a good place to start. Cheat engine is a memory scanner, that uses ASM. (Some AV's scan it as a trojan -_-. The site warns you).
It's just up to you to learn the basics, then apply em in roms. Btw ASM is not reccomended for a first language :)
 
Status
Not open for further replies.
Back
Top