View Single Post
  #8100    
Old April 4th, 2013 (06:10 PM).
DrFuji's Avatar
DrFuji
Helfen, Wehren, Heilen
Community Supporter
 
Join Date: Sep 2009
Location: Downia-upside
Age: 22
Gender: Male
Nature: Jolly
Quote originally posted by Jbsundown:
Hello, I've been trying to script a small event as a test for something bigger.

The scenario is, once you walk out of professor Oak's lab after getting your pokemon (FireRed) there are 2 grunts (X and Y). They talk a bit and then battle you individually. After being defeated, the screen fades and they are gone. They should not reappear there at all. However, after inserting the script into the ROM, after walking out of Oak's lab, the script doesn't activate. Then, once walking off of the tile then back onto it, the game crashes but the music is still playing normally.

Spoiler:

Image 1:


Image 2:


Image 3:



Here is the script:
Spoiler:
#dynamic 0x71A300

#org @start
lock
applymovement 0x05 @move
msgbox @1 0x6
applymovement 0x04 @move5
msgbox @14 0x6
applymovement 0x05 @move2
msgbox @12 0x6
applymovement 0x04 @move3
msgbox @13 0x6
applymovement 0x04 @move4
trainerbattle 0x1 0x003 0x0 @before @after @later
end

#org @12
=Hey! You!\lWhat are you lokin' at?

#org @13
= Le'me battle 'im Y!\lPlease!\p*sigh*\lFine, go ahead.

#org @1
= X!\nWhat are you doing?

#org @14
= I ain't doin' nothin'.\pHmmm...

#org @move
#raw 0x1

#org @move2
#raw 0x7
#raw 0x62

#org @move3
#raw 0x3
#raw 0x62
#raw 0x0

#org @move4
#raw 0x20

#org @move5
#raw 0x0

#org @before
= Haha! Bring it on, kid.

#org @after
= Y! Help!

#org @later
applymovement 0x04 @move7
msgbox @2 0x6
applymovement 0x05 @move8
trainerbattle 0x1 0x002 0x0 @before1 @after1 @later1

#org @move7
#raw 0x1F
#raw 0x1F
#raw 0x1D
#raw 0x7

#org @move8
#raw 0x13

#org @2
= Hmph.\n You beat X.\lNo hard feat I suppose.\lBut, for that, I will beat\lyou!

#org @before1
= Now I'll show you!

#org @after1
= I went easy on you.

#org @later1
applymovement 0x05 @move9
msgbox @3 0x6
applymovement 0x05 @move10
msgbox @4 0x6
fadescreen 0x1
hidesprite 0x05
hidesprite 0x04
fadescreen 0x0
setflag 0x1200
release
end

#org @move9
#raw 0x12


#org @move10
#raw 0x3


#org @3
= Let's get going, X...

#org @4
= See ya around, kid.



If there is anything else that is required to find the error, please tell me! :)
There are quite a few problems with how you've set this out. If you want a script to activate the instant you enter a map then you will have to make it a level script, rather than a green-S tile script which you walk over - Here's a good tutorial to show you how to make one. For future note, when using green-S tile scripts you need to fill in 'Unknown', 'Var number' and occassionally 'Var Value' boxes otherwise you will experience freezes like you have now - diegoisawesome's XSE tutorial can help explain what to do here (Found under the applymovement section).

Here's your script with some changes in red and an explanation as to why they were changed:

Spoiler:
#dynamic 0x720000 // This is generally considered the best offset to start looking for free space in a FR ROM

#org @start
lock
applymovement 0x05 @move
msgbox @1 0x6
applymovement 0x04 @move5
msgbox @14 0x6
applymovement 0x05 @move2
msgbox @12 0x6
applymovement 0x04 @move3
msgbox @13 0x6
applymovement 0x04 @move4
trainerbattle 0x1 0x003 0x0 @before @after @later
end

#org @12
=Hey! You!\lWhat are you lokin' at?

#org @13
= Le'me battle 'im Y!\lPlease!\p*sigh*\lFine, go ahead.

#org @1
= X!\nWhat are you doing?

#org @14
= I ain't doin' nothin'.\pHmmm...

#org @move
#raw 0x1
#raw 0xFE // You need to end your movement commands with 0xFE, otherwise the game will glitch

#org @move2
#raw 0x7
#raw 0x62
#raw 0xFE

#org @move3
#raw 0x3
#raw 0x62
#raw 0x0
#raw 0xFE

#org @move4
#raw 0x20
#raw 0xFE

#org @move5
#raw 0x0
#raw 0xFE

#org @before
= Haha! Bring it on, kid.

#org @after
= Y! Help!

#org @later
applymovement 0x04 @move7
msgbox @2 0x6
applymovement 0x05 @move8
trainerbattle 0x1 0x002 0x0 @before1 @after1 @later1

#org @move7
#raw 0x1F
#raw 0x1F
#raw 0x1D
#raw 0x7
#raw 0xFE

#org @move8
#raw 0x13
#raw 0xFE

#org @2
= Hmph.\n You beat X.\lNo hard feat I suppose.\lBut, for that, I will beat\lyou!

#org @before1
= Now I'll show you!

#org @after1
= I went easy on you.

#org @later1
applymovement 0x05 @move9
msgbox @3 0x6
applymovement 0x05 @move10
msgbox @4 0x6
fadescreen 0x1
hidesprite 0x05
hidesprite 0x04
fadescreen 0x0
setvar 0xYYYY 0XZZZZ // Variable changing command to prevent the level script from looping
setflag 0x1200
release
end

#org @move9
#raw 0x12
#raw 0xFE

#org @move10
#raw 0x3
#raw 0xFE

#org @3
= Let's get going, X...

#org @4
= See ya around, kid.


You may also have to put some 'waitmovement 0x0' commands here and there but then again you might not, idk :P

Hopefully this helped.
__________________