Hmm would there be a way to continue the script after the warp without necessarily changing script?
Game: FireRed
Type: LevelScript
Editor: XSE
Script:
Spoiler:#dynamic 0x71A9AA
#org @start
checkflag 0x201
if 0x1 goto @done
setvar 0x4050 0x0
applymovement 0xFF @move1
waitmovement 0xFF
msgbox @talk1 0x6
applymovement 0x1 @move2
waitmovement 0x1
msgbox @talk2 0x6
applymovement 0x1 @move3
applymovement 0xFF @move3
waitmovement 0x1
waitmovement 0xFF
applymovement 0x1 @move4
waitmovement 0x1
msgbox @talk3 0x6
setflag 0x201
release
end
#org @done
release
end
#org @move1
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x2
#raw 0x1C
#raw 0x3
#raw 0x1C
#raw 0x63
#raw 0x1
#raw 0x1
#raw 0xFE
#org @talk1
= Prof. Oak: Sorry I'm late \v\h01
#org @move2
#raw 0x12
#raw 0x12
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x12
#raw 0x11
#raw 0x11
#raw 0x13
#raw 0x0
#raw 0xFE
#org @talk2
= Prof. Oak: Follow me.
#org @move3
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE
#org @move4
#raw 0x0
#raw 0xFE
#org @talk3
= Prof Oak: On the table are three\nPokémon: Jolteon, Flareon and\lVaporeon.\lYou may only choose one so choose\lwisely.
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 ^^'
#org @start
checkflag 0x201
if 0x0 goto @notset
movesprite2 0x[Oak's sprite number] 0x[X Coordinate] 0x[Y Coordinate]
end
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:#dynamic 0x71F75D
#org @start
checkflag 0x201
if 0x1 goto @continue
release
end
#org @stop
= \v\h01 please choose a Pokémon\nbefore leaving.
#org @done
release
end
#org @tooearly
release
end
#org @move
#raw 0x9
#raw 0xFE
#org @continue
checkflag 0x202
if 0x1 goto @done
msgbox @stop 0x6
applymovement 0xFF @move
waitmovement 0xFF
release
end
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..
The script will run, if and only if, the var in the box is equal to the value
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
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..
Thank you :D I had completely forgotten about the setvar O.o
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.
Thanks it worked :)
~
Game: FireRed
Editor: XSE
Type: TileScript
Spoiler:#dynamic 0x71F75D
#org @start
checkflag 0x201
if 0x1 goto @continue
release
end
#org @stop
= \v\h01 please choose a Pokémon\nbefore leaving.
#org @done
release
end
#org @tooearly
release
end
#org @move
#raw 0x9
#raw 0xFE
#org @continue
checkflag 0x202
if 0x1 goto @done
msgbox @stop 0x6
applymovement 0xFF @move
waitmovement 0xFF
release
end
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..
[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]
[COLOR=White]'-----------------------
#org 0xE3D2DC
virtualcallif 0xD5 0xD9E0E8E8
nop
buffercontestype 0xD9 0xFFAB
cmdC3 0x0
warp8 0xE3 0xE7 0xE8 0xFFAB 0xE3D3[/COLOR]
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?
#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?
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.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.
Game: FireRed
editor: XSE
Type: tile script
script:
Spoiler:#dynamic 0x7238FF
#org @start
checkflag 0x203
if 0x1 goto @vaporeon
release
end
#org @vaporeon
setvar 0x4052 0x0
applymovement 0x5 @walk1
waitmovement 0x5
applymovement 0xFF @walk2
waitmovement 0xFF
msgbox @talk1 0x6
applymovement 0x5 @walk3
waitmovement 0x5
msgbox @talk3 0x6
trainerbattle 0x9 0x03B 0x0 @win @lose
applymovement 0x5 @walk5
waitmovement 0x5
applymovement 0x6 @walk4
waitmovement 0x6
msgbox @talk4 0x6
trainerbattle 0x9 0x03E 0x0 @gagne @pasgagne
applymovement 0x6 @walk6
waitmovement 0x6
release
end
#org @talk4
= Emily: It's my turn now!
#org @talk3
= Ethan: Let's have a Pokémon\nbattle!
#org @walk6
#raw 0x2
#raw 0xFE
#org @walk5
#raw 0x12
#raw 0x3
#raw 0xFE
#org @pasgagne
= Emily: Yay! I won!
#org @gagne
= Emily: Awwn, I lost..
#org @walk4
#raw 0x10
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE
#org @lose
= Ethan: Better luck next time
#org @win
= Ethan: You're really good \v\h01!
#org @walk3
#raw 0x10
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0xFE
#org @walk1
#raw 0x0
#raw 0xFE
#org @walk2
#raw 0x1
#raw 0xFE
#org @talk1
= Ethan: Wait \v\h01!
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 :/
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.
Okay, this time I am using XSE 1.1.1, and Pokemon Firered, with advancemap.
Script:Spoiler:#dynamic 0x801400
#org @start
lock
checkflag 0x7482
if 0x1 goto @true
setflag 0x7482
msgbox @mom 0x6
checkgender
compare 0x800D 0x0
giveitem 0x348 0x1 MSG_OBTAIN
if 2 @boy
goto @girl
release
end
#org @mom
= Mom: \v\h01, it is your sister. Last night\nshe was kidnapped by Team\lWaxing Darkness. Take your phone\nif someone calls.
giveitem 348 1 MSG_OBTAIN
#org @boy
msgbox @boypke 0x6
givepokemon 0x52 0x7 0x217 0x0 0x0 0x0
release
end
#org @girl
message @girlpke 0x6
givepokemon 0x37 0x7 0x215 0x0 0x0 0x0
release
end
#org @boypke
= Here \v\h01 take your Meowth and go\nfind your sister.
#org @girlpke
= Here \v\h01 take your Vulpix and go\nfind your sister.
#org @true
release
end
My problem is that when I activate the script in game, the game freezes. Any help?
Edit: This happens with another script too:
Spoiler:#dynamic 0x800000
#org @start
Lock
checkflag 0x7492
if 1 goto @true
msgbox @door 0x6
applymovement 0xFF @move
waitmovement 0x0
release
end
#org @move
#raw 0x2
#raw 0x9
#raw 0xFE
#org @door
= The door won't budge.
#org @true
release
end