Sierra's MEGA-HUGE XSE Scripting Tutorial Page 40

Started by Sierraffinity December 26th, 2008 6:55 PM
  • 776138 views
  • 1232 replies
Male
United States
Seen March 31st, 2019
Posted April 3rd, 2014
2 posts
9.1 Years
I think I have my script set up right, I'm using XSE:
#dynamic 0x800000
#org @start
lock
faceplayer
message @1 0x6
release
end

#org @1
= Script made\nby SoulReturns!
But I believe my problem lies in AdvanceMap; I chose XSE as my script editor, copied the "$000000" code in (mine was $800000), added a new event in the form of a player...

What my AdvanceMap looks like:
Spoiler:

[email protected]@com/[email protected]
Sorry, you'll have to replace the '@' with a . because I'm apparently not allowed to post links until I hit 15 posts.


What my XSE looks like:
Spoiler:

[email protected]@com/[email protected]
Sorry, you'll have to replace the '@' with a . because I'm apparently not allowed to post links until I hit 15 posts.


When I start the game, I get an unaffected Pallet Town. However when I tried changing the behavior of some of the already-existing NPC's, this change was reflected in the game (albeit a bit buggy).

Like I said I think I understand most of the code stuff. Just not sure how to make what I do appear :/ Or I have some fatal mistake and I'm living an illusion that I know how to do this. Lol.

Thanks for the help!
能ある鷹は爪を隠す。
The talented hawk hides its claws.

destinedjagold

You can contact me in PC's discord server...

Age 32
Male
Seen 2 Days Ago
Posted March 24th, 2023
8,579 posts
16 Years
I think I have my script set up right, I'm using XSE:
#dynamic 0x800000
#org @start
lock
faceplayer
message @1 0x6
release
end

#org @1
= Script made\nby SoulReturns!
But I believe my problem lies in AdvanceMap; I chose XSE as my script editor, copied the "$000000" code in (mine was $800000), added a new event in the form of a player...

What my AdvanceMap looks like:
Spoiler:




What my XSE looks like:
Spoiler:




When I start the game, I get an unaffected Pallet Town. However when I tried changing the behavior of some of the already-existing NPC's, this change was reflected in the game (albeit a bit buggy).

Like I said I think I understand most of the code stuff. Just not sure how to make what I do appear :/ Or I have some fatal mistake and I'm living an illusion that I know how to do this. Lol.

Thanks for the help!
Try again with a clean ROM, and use Advance Map 1.92 (download link) instead of 1.95...

Male
Seen June 19th, 2016
Posted May 1st, 2014
3 posts
10.4 Years
Hello and many thanx for the tutorials :)

I have a little problem that I have tried many different ways to solve it but I was unable to do so.

To my problem. I have this normal wildbattle script:

#dynamic 0x800000

#org @start
lock
faceplayer
cry 0x96 0x0
msgbox @talk1 0x6
wildbattle 0x96 0x5 0x0
fadescreen 1
hidesprite 0x800F
fadescreen 0
setflag 0x1201
release
end

#org @talk1
= Prepare for your destiny!



The script works perfectly as it. My problem is that I want to change the music of the battle. The pokemon in the scrip is MewTwo and I want to make a script for a legendary battle. But no matter what I have tried I cant make it to play the legendary music.

I did decompile the original firered MewTwo battlescript n the command for the legendary battle music which is named Encounter 4 if I remember in the rom is: playsong 0x156 0x0. But I cant get it to work. I have tried to put the line after the msgbox, it didnt work. After the wildbattle command, again it didnt work. The music remained to the normal battle. I even tired it as a fanfare but nowthin, all the same. If anyone knows how to do it please reply, I have searched all the tutorials here n on the net I found a couple but they were usin pokescript but ever since I discovered XSE I no longer use pokescript nor I even remember how to use it. Btw here is the full MewTwo battlescrip in case it helps to figure out what I am doin wrong n what I'm supposed to do.


'---------------
#org 0x1624F5
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0
special 0x188
lock
faceplayer
checksound
cry 0x96 0x2
preparemsg 0x8177F9F '"Mew!"
waitmsg
waitcry
pause 0x14
playsong 0x156 0x0
waitkeypress
setwildbattle 0x96 0x46 0x0
setflag 0x807
special 0x138
waitstate
clearflag 0x807
special2 LASTRESULT 0xB4
compare LASTRESULT 0x1
if 0x1 goto 0x8162558
compare LASTRESULT 0x4
if 0x1 goto 0x8162561
compare LASTRESULT 0x5
if 0x1 goto 0x8162561
setflag 0x2BC
release
end

'---------------
#org 0x1A7AE0
release
end

'---------------
#org 0x162558
setflag 0x2BC
goto 0x81A922D

'---------------
#org 0x162561
setvar 0x8004 0x96
goto 0x81A9236

'---------------
#org 0x1A922D
fadescreen 0x1
hidesprite LASTTALKED
fadescreen 0x0
release
end

'---------------
#org 0x1A9236
fadescreen 0x1
hidesprite LASTTALKED
fadescreen 0x0
bufferpokemon 0x0 0x8004
msgbox 0x81A63C4 MSG_KEEPOPEN '"The [buffer1] flew away!"
release
end


'---------
' Strings
'---------
#org 0x177F9F
= Mew!

#org 0x1A63C4
= The [buffer1] flew away!







And thanx in advance to the whole community :)

Sniper

ふゆかい

Male
Philippines
Seen August 9th, 2016
Posted June 5th, 2016
1,412 posts
9.5 Years
Hello and many thanx for the tutorials :)

I have a little problem that I have tried many different ways to solve it but I was unable to do so.

To my problem. I have this normal wildbattle script:

#dynamic 0x800000

#org @start
lock
faceplayer
cry 0x96 0x0
msgbox @talk1 0x6
wildbattle 0x96 0x5 0x0
fadescreen 1
hidesprite 0x800F
fadescreen 0
setflag 0x1201
release
end

#org @talk1
= Prepare for your destiny!



The script works perfectly as it. My problem is that I want to change the music of the battle. The pokemon in the scrip is MewTwo and I want to make a script for a legendary battle. But no matter what I have tried I cant make it to play the legendary music.

I did decompile the original firered MewTwo battlescript n the command for the legendary battle music which is named Encounter 4 if I remember in the rom is: playsong 0x156 0x0. But I cant get it to work. I have tried to put the line after the msgbox, it didnt work. After the wildbattle command, again it didnt work. The music remained to the normal battle. I even tired it as a fanfare but nowthin, all the same. If anyone knows how to do it please reply, I have searched all the tutorials here n on the net I found a couple but they were usin pokescript but ever since I discovered XSE I no longer use pokescript nor I even remember how to use it. Btw here is the full MewTwo battlescrip in case it helps to figure out what I am doin wrong n what I'm supposed to do.


'---------------
#org 0x1624F5
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0
special 0x188
lock
faceplayer
checksound
cry 0x96 0x2
preparemsg 0x8177F9F '"Mew!"
waitmsg
waitcry
pause 0x14
playsong 0x156 0x0
waitkeypress
setwildbattle 0x96 0x46 0x0
setflag 0x807
special 0x138
waitstate
clearflag 0x807
special2 LASTRESULT 0xB4
compare LASTRESULT 0x1
if 0x1 goto 0x8162558
compare LASTRESULT 0x4
if 0x1 goto 0x8162561
compare LASTRESULT 0x5
if 0x1 goto 0x8162561
setflag 0x2BC
release
end

'---------------
#org 0x1A7AE0
release
end

'---------------
#org 0x162558
setflag 0x2BC
goto 0x81A922D

'---------------
#org 0x162561
setvar 0x8004 0x96
goto 0x81A9236

'---------------
#org 0x1A922D
fadescreen 0x1
hidesprite LASTTALKED
fadescreen 0x0
release
end

'---------------
#org 0x1A9236
fadescreen 0x1
hidesprite LASTTALKED
fadescreen 0x0
bufferpokemon 0x0 0x8004
msgbox 0x81A63C4 MSG_KEEPOPEN '"The [buffer1] flew away!"
release
end


'---------
' Strings
'---------
#org 0x177F9F
= Mew!

#org 0x1A63C4
= The [buffer1] flew away!







And thanx in advance to the whole community :)

Use Cyclone instead :) It's easier when it comes to creating wild battles.


Male
Seen June 19th, 2016
Posted May 1st, 2014
3 posts
10.4 Years
Use Cyclone instead :) It's easier when it comes to creating wild battles.
Cyclone is a tile editor n I'm not lookin for that. I just want the wildbattle script that can play the legendary music while in battle. And another question that came to me right now. How can I get the Regi battle music from Emerald to Firered?

Sniper

ふゆかい

Male
Philippines
Seen August 9th, 2016
Posted June 5th, 2016
1,412 posts
9.5 Years
Cyclone is a tile editor n I'm not lookin for that. I just want the wildbattle script that can play the legendary music while in battle. And another question that came to me right now. How can I get the Regi battle music from Emerald to Firered?
Sorry, I meant PokeTronic. You need to export the music from Emerald by using sappy then import it to FireRed.


Male
Seen June 19th, 2016
Posted May 1st, 2014
3 posts
10.4 Years
Sorry, I meant PokeTronic. You need to export the music from Emerald by using sappy then import it to FireRed.
Do u have a good copy of PokeTronic cause the ones that exist on download sites most times dont work plus have viruses. The last time I tried to download it from a couple of sites it was not workin plus I got a virus. So if u have it n u can give it tom me I'd be glad.

machomuu

Stuck in Hot Girl Summer

She/Her
Take a left, turn right at the next stop, bear left for a few mil
Seen March 4th, 2023
Posted April 26th, 2022
10,505 posts
15.1 Years
I can't figure out how to actually get the rom to use the code! NOTHING I CAN FIND WILL TELL ME! I can script a bit but I can never get the script into the ROM! Please help
Watch this rather terrible textless, voiceless tutorial I made in all of 5 minutes. It's bad, but it's to the point and I made it on the spot.

Spoiler:

Tyranitar Killer

Tyranibeast

Male
'STRAYA
Seen April 2nd, 2021
Posted September 28th, 2014
72 posts
9.7 Years
Nice tutorial, Just wondering two things you didn't put in,
1. How to do a script that stops you from passing untill you have done something
Here I want one where a guy stops you from entering a gym as the leader is gone until you have beaten 7 gyms
2. How do you get the Follow-me script
I am making a hack
PM me if you want to help

Sniper

ふゆかい

Male
Philippines
Seen August 9th, 2016
Posted June 5th, 2016
1,412 posts
9.5 Years
Nice tutorial, Just wondering two things you didn't put in,
1. How to do a script that stops you from passing untill you have done something
Here I want one where a guy stops you from entering a gym as the leader is gone until you have beaten 7 gyms
2. How do you get the Follow-me script
1. Use checkflag and
2. Check Research & Development section


Tyranitar Killer

Tyranibeast

Male
'STRAYA
Seen April 2nd, 2021
Posted September 28th, 2014
72 posts
9.7 Years
1. Use checkflag and
2. Check Research & Development section
By Follow-Me I meant you follow a character not vice versa, as in following Wally when he gets his 1st Pokemon
I am making a hack
PM me if you want to help

Tyranitar Killer

Tyranibeast

Male
'STRAYA
Seen April 2nd, 2021
Posted September 28th, 2014
72 posts
9.7 Years
You should've specify earlier, just add the same applymovement.
Is it too much to see a sample script of each,
I'm ok if you can't but if I see it I think I could understand a lot better
Thanks if you do, I understand if you dont
I am making a hack
PM me if you want to help
Male
Seen May 19th, 2014
Posted May 17th, 2014
7 posts
9.1 Years
I'm having trouble fixing my scripts. I would modify my script on a separate .rbc file, then open up the old script from AdvanceMap, then paste the modified script over it, then click compile. When I close XSE and re-open the script from AdvanceMap, it just shows the old script. I've tried it many times, keeping the same offset. I don't want to have to change the offset and take up more space every time I modify the script :(

DaisukE

Just feel it burning ^^

Male
Somewhere in this empty eternity
Seen July 27th, 2017
Posted July 26th, 2017
113 posts
10 Years
0x3
Spoiler:

Description:
Used for signs etc. No lock or faceplayer effect. Only shows the sign textbox when used on an actual sign.

Script:
#dynamic 0x800000


#org @start
msgbox @sign 0x3
end

#org @hello
= You are here
Replace the pointer hello or the first one..
Just a small error in the script...may have been told before...but yah its just an small human error......just saying no offense...
Búrñiñg Émøtiøn§

Sniper

ふゆかい

Male
Philippines
Seen August 9th, 2016
Posted June 5th, 2016
1,412 posts
9.5 Years
I'm having trouble fixing my scripts. I would modify my script on a separate .rbc file, then open up the old script from AdvanceMap, then paste the modified script over it, then click compile. When I close XSE and re-open the script from AdvanceMap, it just shows the old script. I've tried it many times, keeping the same offset. I don't want to have to change the offset and take up more space every time I modify the script :(
That's not good. Rather just put your new script for example:

#dynamic 0x800000

#org @start
msgbox @1 0x6
release
end

= This is my script
Input on XSE 1.1.1 then click the blue gears to compile rather than saving it to .rbc then put the offset in the NPC. I suggest you use A-map 1.92 if something comes up wrong just tell me. Re-read the tutorial to know if what script you would really want to put in.

Replace the pointer hello or the first one..
Just a small error in the script...may have been told before...but yah its just an small human error......just saying no offense...
And no. If you edit a saved script on the rom. It would cause damage to other script causing it to bug. If the number of words is more than the original script, the space will grow bigger and that's why it leads to bug because it saves over to another saved script.


DaisukE

Just feel it burning ^^

Male
Somewhere in this empty eternity
Seen July 27th, 2017
Posted July 26th, 2017
113 posts
10 Years
That's not good. Rather just put your new script for example:

#dynamic 0x800000

#org @start
msgbox @1 0x6
release
end

= This is my script
Input on XSE 1.1.1 then click the blue gears to compile rather than saving it to .rbc then put the offset in the NPC. I suggest you use A-map 1.92 if something comes up wrong just tell me. Re-read the tutorial to know if what script you would really want to put in.



And no. If you edit a saved script on the rom. It would cause damage to other script causing it to bug. If the number of words is more than the original script, the space will grow bigger and that's why it leads to bug because it saves over to another saved script.

Do u even know scripting..no offense but u should have read carrefully what i posted...

I said the pointers are not set properly....and btw its not an compiled script...ugh.....and aif u r talking about editing a script in advance map...it would give u pointers like 0x(offset) but in xse its our made llike @start.....ummmm...kinda sorry if i was rude but please check that my posts spoiler in quotes.....sorry if i was rude..


Looks like it was just a misunderstanding
Búrñiñg Émøtiøn§
Male
Seen September 6th, 2015
Posted May 23rd, 2014
4 posts
9.6 Years
Hello everyone,

I'm having some trouble compiling my scripts...

The script I'm using is:
'---------------
#org 0x527702
checkflag 0x994
if 0x1 goto 0x527703

'---------------
#org 0x527703
lockall
msgbox 0x8527704 MSG_KEEPOPEN '"Hmmm... \pI should beat the\nPokem..."
closeonkeypress
applymovement MOVE_PLAYER 0x8527705
waitmovement 0x0
releaseall
end


'---------
' Strings
'---------
#org 0x527704
= Hmmm... \pI should beat the\nPokemon league first!


'-----------
' Movements
'-----------
#org 0x527705
#raw 0x9 'Step Up (Normal)
#raw 0xFE 'End of Movements
I want to make a certain area where only players who have defeated the league champion can go, I added a script tile in the hall of fame that sets the players flag 994.

When I compiled it and added the offset to the script tile in Advance Map, it works and looks fine, but when I trigger it in game, the script resets into this:
'---------------
#org 0x527702
checkflag 0xC269
callstd 0xFE
buffercontestype 0xAD 0xADAD
nop
(I used free space finder to find a free offset, when I checked it, it was empty/free, but after it resetted to the script above, it stays like that)

I have no idea what causes this :/.

More info:
Advance map version: 1.9.5
XSE version: 1.1.1
Pokemon version: Emerald
Experience: little ;D

Please get back to me a.s.a.p. :0.

Sincerely,
DoC

Mana

Age 31
Male
UK
Seen March 25th, 2023
Posted August 18th, 2021
10,075 posts
14.3 Years
Ignoring the fact that flag 0x994 may not be entirely safe (http://www.pokecommunity.com/showthread.php?t=302347) add in an 8 here ->

if 0x1 goto 0x8527703

You actually don't need to use flags with script tiles, you can use variables to make them work with no checking in-script. Have a look at the link above for more details.

Christos

Male
Seen April 16th, 2020
Posted December 16th, 2019
6,355 posts
17.2 Years
Hello everyone,
I'm having some trouble compiling my scripts...
The script I'm using is:
I want to make a certain area where only players who have defeated the league champion can go, I added a script tile in the hall of fame that sets the players flag 994.
When I compiled it and added the offset to the script tile in Advance Map, it works and looks fine, but when I trigger it in game, the script resets into this:
(I used free space finder to find a free offset, when I checked it, it was empty/free, but after it resetted to the script above, it stays like that)
I have no idea what causes this :/.
More info:
Advance map version: 1.9.5
XSE version: 1.1.1
Pokemon version: Emerald
Experience: little ;D
Mail: [email protected]
Please get back to me a.s.a.p. :0.
Sincerely,
DoC
You did look for free space, but the commands you used at 527702 take up space that is written over 527703 and 527704. For example, the checkflag command needs X bytes and the goto one needs Y bytes, so your next offset should be X+Y bytes after 527702. I suggest simply scripting dynamically, you simply define an offset at the beginning and the script editor compiles everything in free space and returns the offsets used to you. So for example:

#dynamic 0x80000

#org @start
checkflag 0x994
if 0x1 goto @next
end

#org @next
lockall
msgbox @message MSG_KEEPOPEN '"Hmmm[.] \pI should beat the\nPokém..."
closeonkeypress
applymovement MOVE_PLAYER @move
waitmovement 0x0
releaseall
end

#org @message
= Hmmm[.] \pI should beat the\nPokémon league first!

#org @move
#raw 0x9 'Step Up (Normal)
#raw 0xFE 'End of Movements


I put an end command after the checkflag, since if the flag is not set the game will freeze otherwise.
Also, if you're using trigger scripts, I suggest not using flags at all since they're unnecessary. Trigger scripts take a variable value and a number. So for example, if your script's variable value is 52C0 and its variable value is 0, the trigger script will always be executed as long as 52C0's value in the game is 0, which is the default value. So instead of setting a flag, once the setvar 0x52C0 0x1 command is executed in any script, your trigger script would not execute again, unless you set the variable's value to 0 again.

A Pokemon that is discriminated!
Support squirtle and make it everyone's favourite.

Christos

Male
Seen April 16th, 2020
Posted December 16th, 2019
6,355 posts
17.2 Years
Hmm... It works better now, thanks a lot for the dynamic scripting explenation!~

But now when the flag isn't set and I pass the tile, the game freezes (sound still continues to roll). However when the flag is set, it works fine (it lets me pass without stopping or so).

How should I fix this? :o
Can you post the script you compiled? And did you include an "end" command after the "goto" part in the beginning of the script like I said in my post?

A Pokemon that is discriminated!
Support squirtle and make it everyone's favourite.