Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2012-06-27 14:19:16

Gallego13
Member
Registered: 2011-12-11
Post 36/94

Problem with a script

I need help.
I'm trying to script a trainer, but everytime I fight him, all text and graphics in the battle screen mess up.
When the battle is over, the game crashes. It also happens with wild pokémon battles. It doesn't fix by refreshing or warping. What did I do wrong? What could it be?
Thanks :3
This is the script:

#org 0x128DCE
'-----------------------------------
playmusic 0x39
spriteface 0x2 0x1
showemote 0x0 0x2 0xF
applymovement 0x2 0x4EBF ' 0x128EBF
spriteface 0x0 0x2
setbit1 0x41
loadfont
2writetext 0x4F0A ' 0x128F0A
closetext
loadmovesprites
refreshscreen 0x0
winlosstext 0x5097 0x0 ' 0x129097,0xFFFFFFFF
setlasttalked 0x2
loadtrainer 0x1F 0x14
startbattle
returnafterbattle
spriteface 0x2 0x1
loadfont
2writetext 0x5104 ' 0x129104
closetext
loadmovesprites
applymovement 0x2 0x4ECC ' 0x128ECC
dotrigger 0x0
setbit1 0x42
loadfont
2writetext 0x4FC2 ' 0x128FC2
closetext
special 0x2E
waitbutton
warp 0x18 0x4 0xD 0x6
end


#org 0x128F0A
= Eh! que haces\nahi? Crio\pdel demonio...\ndevuelveme ese\p[POKé]MON o te lo \ntendre que quitar\la a la fuerza.\e


#org 0x129097
= Nooooooo! Los\nejecutivos me\pmataran cuando\nse enteren\e


#org 0x129104
= Grrr... me las\npagaras por\pesto...\nMe piro!.\e


#org 0x128FC2
= Genial! ahora\nde vuelta al\llaboratorio\e


#org 0x128EBF
M step_down step_down step_down step_down step_right end

#org 0x128ECC
M step_up step_up step_up step_up step_left step_left end

Texts are in spanish :P

Last edited by Gallego13 (2012-06-27 14:30:55)

Offline

#2 2012-06-27 15:23:20

Miksy91
Member
Registered: 2010-10-16
Post 941/2,306

Re: Problem with a script

It's not about the script; the script is 100% fine as far as I can tell although I've no idea what purpose you're going to have with the following commands:
refreshscreen 0x0
setlasttalked 0x2

Also, it's unlikely you need to set both bits 0x41 and 0x42 from bittable 1 during the script unless you know what you're doing with them.

Then again, the problem seems to be with some of the loaded assembly routines that you've modified (whether you wanted to do so or not). If you've got a backup file without the bug, create an ips-patch between these two files and see what's wrong with it.

Offline

#3 2012-06-28 08:29:00

Gallego13
Member
Registered: 2011-12-11
Post 37/94

Re: Problem with a script

Miksy91 wrote:

It's not about the script; the script is 100% fine as far as I can tell although I've no idea what purpose you're going to have with the following commands:
refreshscreen 0x0
setlasttalked 0x2

Also, it's unlikely you need to set both bits 0x41 and 0x42 from bittable 1 during the script unless you know what you're doing with them.

Then again, the problem seems to be with some of the loaded assembly routines that you've modified (whether you wanted to do so or not). If you've got a backup file without the bug, create an ips-patch between these two files and see what's wrong with it.

Oops! Looks like I've accidentally destroyed some Assembly. I have a backup file, so I'll try repointing to a larger blank space. Thanks, I was going crazy looking at the script over and over again and thinking what could be wrong.

Offline

#4 2012-06-29 08:25:26

Gallego13
Member
Registered: 2011-12-11
Post 38/94

Re: Problem with a script

Sorry about the double post, it's only to say that the bug is fixed.
I found the assembly that I had accidentally overwritten and fixed it.
All of this was because I inserted a tileset in a space I thought that was blank and it wasn't :P
Damn trolling TLP...

Offline

Board footer

Powered by FluxBB