• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.
Hmm would there be a way to continue the script after the warp without necessarily changing script?
 
I got it :)

I simply removed the checkflag 0x200 from the second script and rearranged the setvars and it works :)
Thank you everyone for the help ^-^
 
Hmm would there be a way to continue the script after the warp without necessarily changing script?

There isn't, because once you warp the script RAM is cleared and the level scripts for the map you warp to are loaded in. So you'd have to make a level script and have it "continue". This is how Steven takes you to the hall of fame in RS
 
Game: FireRed
Type: LevelScript
Editor: XSE
Script:
Spoiler:


The script works at 100% I just can't seem to get Oak to stay in place, if I exit the lab and come back he goes back to his original position

P.s. thanks for all the help, I'm a little new to the scripting world ^^'
 
Game: FireRed
Type: LevelScript
Editor: XSE
Script:
Spoiler:


The script works at 100% I just can't seem to get Oak to stay in place, if I exit the lab and come back he goes back to his original position

P.s. thanks for all the help, I'm a little new to the scripting world ^^'

What the game is doing is that is reads where you originally placed Professor Oak. To get him to move you'd need to include a level script (the scripts activated in the "Header" tab in AdvanceMap), I'm thinking the 03 or the 05 one. Basically you're gonna want the script to be very basic and check the flag that you set in your previous script so it will move the sprite once the flag is set.

#org @start
checkflag 0x201
if 0x0 goto @notset
movesprite2 0x[Oak's sprite number] 0x[X Coordinate] 0x[Y Coordinate]
end

The flag checking is because the script will activate every time you enter the room and if that wasn't there, Oak would move to the end spot every time. Movesprite2 is used because I believe it's the movesprite command you use in level scripts when you want someone to move permanently. Hope it's explanatory. :P

------------------------------------

My question:
If I use "getplayerpos" and store the variables, can I use the "movesprite" command and instead of using the x and y coordinates I use the variables in their place?
 
What the game is doing is that is reads where you originally placed Professor Oak. To get him to move you'd need to include a level script (the scripts activated in the "Header" tab in AdvanceMap), I'm thinking the 03 or the 05 one. Basically you're gonna want the script to be very basic and check the flag that you set in your previous script so it will move the sprite once the flag is set.



The flag checking is because the script will activate every time you enter the room and if that wasn't there, Oak would move to the end spot every time. Movesprite2 is used because I believe it's the movesprite command you use in level scripts when you want someone to move permanently. Hope it's explanatory. :P

------------------------------------

My question:
If I use "getplayerpos" and store the variables, can I use the "movesprite" command and instead of using the x and y coordinates I use the variables in their place?

Thanks it worked :)


~

Game: FireRed
Editor: XSE
Type: TileScript
Spoiler:


If I try to leave the lab before choosing a Pokémon, the script should stop me and push be back, but instead my character freezes..
 
Thanks it worked :)


~

Game: FireRed
Editor: XSE
Type: TileScript
Spoiler:


If I try to leave the lab before choosing a Pokémon, the script should stop me and push be back, but instead my character freezes..

Well for one you don't even have the "lock" command in there so the player can move freely during your script. :P
Secondly, I think you're approaching this the wrong way, no offense. I'll link you to karatekid's tutorial on script tiles and then explain a little bit.

https://www.pokecommunity.com/threads/302347

And now the most important think you can get from the script tile section is:
The script will run, if and only if, the var in the box is equal to the value

Basically that means you put in a variable in the "var value" box and you put whatever value the variable at that time is in the "var value" box. So usually in the beginning without any kinds of edits, most vars from 4011-40FF are at 0 or you can set them to 0 manually (give or take a few special ones that are explained in the "var" section of karatekid's tut).

So now you can activate a script all fine and dandy, but it'll keep playing since the var doesn't change, right? Haha, wrong. All you have to do is change the variable to something else to essentially turn the script tile off. That way you don't have to use the "checkflag" thing any more since this is a much easier method.

Eventually you'll get the hang of variables and learn that they're very flexible at what they do. You could, say, set a variable in one script to turn another script off or activate another script. Hopefully I didn't drag this on too long. :P
 
Well for one you don't even have the "lock" command in there so the player can move freely during your script. :P
Secondly, I think you're approaching this the wrong way, no offense. I'll link you to karatekid's tutorial on script tiles and then explain a little bit.

https://www.pokecommunity.com/threads/302347

And now the most important think you can get from the script tile section is:


Basically that means you put in a variable in the "var value" box and you put whatever value the variable at that time is in the "var value" box. So usually in the beginning without any kinds of edits, most vars from 4011-40FF are at 0 or you can set them to 0 manually (give or take a few special ones that are explained in the "var" section of karatekid's tut).

So now you can activate a script all fine and dandy, but it'll keep playing since the var doesn't change, right? Haha, wrong. All you have to do is change the variable to something else to essentially turn the script tile off. That way you don't have to use the "checkflag" thing any more since this is a much easier method.

Eventually you'll get the hang of variables and learn that they're very flexible at what they do. You could, say, set a variable in one script to turn another script off or activate another script. Hopefully I didn't drag this on too long. :P

Thank you :D I had completely forgotten about the setvar O.o
 
Le Pugs problem isn't the 0xFFFF bug or command-based.
I looked at your script and got headache from the flags, which are over 0xFFF haha.
Besides from that, as far as I know, levelscripts are disabled as soon as the given variable reached
"var > value", so try using different vars for the 2 scripts, and thats probably solving the issue.
If that doesn't work, I will look closer at it..

I've tried all sorts of vars ... 4000, 4001, 4011, 4012, 4017, 4018, 4050, 4051, 4067, 4068, 4096, 4097, 4099, 4098, 508D, 508C, 5CCC, 5CCD, random numbers and all that jazz and nothing works. i tried instead of getplayerpos using a checkflag instead and still the same problems.
 
Thank you :D I had completely forgotten about the setvar O.o

Haha, no problem. We're always here to help. :P

I've tried all sorts of vars ... 4000, 4001, 4011, 4012, 4017, 4018, 4050, 4051, 4067, 4068, 4096, 4097, 4099, 4098, 508D, 508C, 5CCC, 5CCD, random numbers and all that jazz and nothing works. i tried instead of getplayerpos using a checkflag instead and still the same problems.

I think what she meant was using separate vars for each script so use 5000 for one and, I dunno, 5001 for the other.
 
Thanks it worked :)


~

Game: FireRed
Editor: XSE
Type: TileScript
Spoiler:


If I try to leave the lab before choosing a Pokémon, the script should stop me and push be back, but instead my character freezes..

I also noticed that you have a random tooearly in your script, you forgot the checkflag that goes along with it, or just remove it if you don't need it.
 
Everytime I compile this with Pokescript, it never works. I've tried this in Firered, Emerald and Ruby. When I open the compiled script in XSE in AdvanceMap, the compiled version is garbled nonsense that is nowhere near a battle. What am I missing here?

Code:
[COLOR=White]#org $script[/COLOR]
[COLOR=White]lock
faceplayer
trainerbattle 0x00 0x01 $see $win
$see 1 = Battle me!
$win 1 = I lost!
message $after
$after 1 = You're tough!
boxset 6
release
end[/COLOR]
In XSE it comes out like this...
Code:
[COLOR=White]'-----------------------
#org 0xE3D2DC
virtualcallif 0xD5 0xD9E0E8E8
nop
buffercontestype 0xD9 0xFFAB
cmdC3 0x0
warp8 0xE3 0xE7 0xE8 0xFFAB 0xE3D3[/COLOR]
 
Last edited:
Everytime I compile this with Pokescript, it never works. I've tried this in Firered, Emerald and Ruby. When I open the compiled script in XSE in AdvanceMap, the compiled version is garbled nonsense that is nowhere near a battle. What am I missing here?

Code:
#org $start
trainerbattle 0 0x008 $before $after
message $beaten
boxset 6
release
end

#org $before
$before 1 = Aren't bugs great?

#org $after
$after 1 = Nooo! My bugs!

#org $beaten
$beaten 1 = How could you squash my\npoor bugs?

You should just use XSE instead. You compiled your script from pokescript then you'll open it with XSE? It's really obvious the script will be broken. So here's how it works on XSE:

Code:
#Dynamic 0x[COLOR=Red](Search for free space)[/COLOR]

#org @start
trainerbattle 0 0x008 @before @after
message @beaten 0x6
release
end

#org @before
= Aren't bugs great?

#org @after
= Nooo! My bugs!

#org @beaten
= How could you squash my\npoor bugs?

Make sure you have the XSE 1.1.1 also remember when you put the compiled offset in the A-map 1.95 it gives extra numbers so make sure it's correct. But I suggest you use A-map 1.92 since 1.95 is buggy as hell.
 
Make sure you have the XSE 1.1.1 also remember when you put the compiled offset in the A-map 1.95 it gives extra numbers so make sure it's correct. But I suggest you use A-map 1.92 since 1.95 is buggy as hell.
I set all of that up, now when I try to compile something to a new offset, I get a "Not enough free space found" error. Even if I expand the ROM size and even if I use Free Space Finder.
 
Last edited:
Game: FireRed
editor: XSE
Type: tile script
script:
Spoiler:


The script works but for some reason I get +200 exp when I should only be getting like 50(?) since it's a level 5 Pokémon :/
 
Game: FireRed
editor: XSE
Type: tile script
script:
Spoiler:


The script works but for some reason I get +200 exp when I should only be getting like 50(?) since it's a level 5 Pokémon :/

This isn't an issue with the script. It's the amount of EXP you receive from the pokemon you defeat. This is the "Base EXP"
 
wow that's a fail xD

Thank you :)

~~~

Game: FireRed
Editor: XSE
Type: Script Tile/TrainerBattle
Script:
Spoiler:


How would I make the script continue if I lose the battle? As it is now it blacks out and sends me home
 
Last edited:
I set all of that up, now when I try to compile something to a new offset, I get a "Not enough free space found" error. Even if I expand the ROM size and even if I use Free Space Finder.

I think you should restart everything, I think something has been messed up there :/
 
Okay, this time I am using XSE 1.1.1, and Pokemon Firered, with advancemap.

Script:
Spoiler:

My problem is that when I activate the script in game, the game freezes. Any help?

Edit: This happens with another script too:
Spoiler:
 
Last edited:
Okay, this time I am using XSE 1.1.1, and Pokemon Firered, with advancemap.

Script:
Spoiler:

My problem is that when I activate the script in game, the game freezes. Any help?

Edit: This happens with another script too:
Spoiler:


If you are putting the offset in the script tile (Which is the green 'S')
Change the Var number to 4050 then change the unknown to 0300.
 
Status
Not open for further replies.
Back
Top