The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Fickle Level Script

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old June 1st, 2018 (10:40 AM). Edited June 1st, 2018 by Lunacrest.
Lunacrest Lunacrest is offline
has ninja'd: 2600
 
Join Date: Sep 2010
Location: Sky Pillar
Gender: Male
Nature: Hasty
Posts: 153
Hi, there.

So, I'm doing a Level Script, and it seems to be fickle.

There's a Scientist inside Mt. Moon, who has this script.

Spoiler:

#org 0x8065EE
msgbox @hope 0x2
setvar 0x4064 0x1
end

#org @hope
= I hope to see you on the other side\n of the mountain!

[/SPOILER]

This is meant to avoid having the level script activate early. The script itself is meant to trigger after the Gym Battle against the Cerulean City Gym Leader, who runs off upset at the loss. Her father, the Rocket Grunt in front of the gym, then immediately runs after you, and asks you what happened.

However, after I talk to the man, occasionally what happens is that upon entering Cerulean City, the game freezes and produces the sound that you make when you yank out the cartridge while the game is still playing.

After resetting, however, when I talk to the scientist, and enter the city, everything's fine, and the script runs perfectly. After I beat the Gym Leader, the gym Leader runs off, and the father does his thing, and everything after works perfectly, using the var 4064 for the level script. Sometimes tho, resetting after that freezes the game sometimes.

Initially, I thought it was because I accidentally activated some wild battle, because that's what happened the first time. After resetting and avoiding the grass, it worked perfectly. However, that was quickly disproven by the third reset, where the script failed and the game froze once more.

Any help would be lovely.

Here's the level script itself.
Spoiler:
#org 0x8055CD
lock
applymovement 0x7 0x880560A
waitmovement 0x0
msgbox 0x8805623 MSG_FACE '"What happened? I just saw my\ndaug..."
applymovement 0x7 0x8805615
waitmovement 0x0
msgbox 0x88056DB MSG_NORMAL '"Ashmi, don't you worry! I'm\ncomin..."
applymovement 0x7 0x8805618
waitmovement 0x0
hidesprite 0x7
setflag 0x270
setvar 0x4064 0x1
release
end


'---------
' Strings
'---------
#org 0x805623
= What happened? I just saw my\ndaughter, Ashmi, run out of the\lGym in tears!\p...\n...\pOh, she lost? It makes me sad when\nshe gets like this. It's time for\lme to do my thing as her dad!

#org 0x8056DB
= Ashmi, don't you worry! I'm\ncoming!


'-----------
' Movements
'-----------
#org 0x80560A
#raw 0x3 'Face Right
#raw 0x62 'Exclamation Mark (!)
#raw 0x0 'Face Down
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x1 'Face Up
#raw 0xFE 'End of Movements

#org 0x805615
#raw 0x0 'Face Down
#raw 0xFE 'End of Movements

#org 0x805618
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0xFE 'End of Movements


And here's the Gym Leader's script. Flag 0x271 is meant for the guards blocking Cerulean City (not relevant to the problem I think).

Spoiler:
#org 0x80585B
lock
faceplayer
trainerbattle 0x1 0x19F 0x0 0x880588F 0x8805A80 0x8805872
release
end

'---------------
#org 0x805872
msgbox 0x8805A99 MSG_NORMAL '"No! This isn't fair! My Pokémon\na..."
fadescreen 0x1
hidesprite LASTTALKED
setflag 0x291
fadescreen 0x0
setflag 0x271
setvar 0x4064 0x0
release
end


'---------
' Strings
'---------
#org 0x80588F
= It's good to see a new face in\nhere!\pI'm Ashmi, the Psychic-type Gym\nLeader of Cerulean City.\pThe difference between the rest of\nTeam Rocket and me is that I\ldidn't just join it, as if it were\lsome club.\pI was born into it. My father's\none of the famous bosses of Team\lRocket, and I've been honing my\lskills ever since I was young in\lprotecting the honor to my name.\pNow, my Psychic-type Pokémon are\nboth in peak physical and mental\lcondition.\pHow can you handle such a\ndevastating combination?

#org 0x805A80
= W-What? This can't be!

#org 0x805A99
= No! This isn't fair! My Pokémon\nare far stronger than yours!\pYou don't deserve a badge! You\ndeserve a smackdown!


I hope it's not something like the var, because I thought 0x4064 was safe. If it is, that would be a wonderfully easy fix, but I don't get why it's fickle when it works occasionally.
__________________
Current Challenges

Ultimate Monocolor Red Challenge - Completed - 6/14/2018
Games: Blue, HeartGold , Ruby , Platinum, White


Psychic Monotype Challenge
Games: LeafGreen (Completed), Gold (Completed), Sapphire
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old June 4th, 2018 (2:50 AM).
Thoriére's Avatar
Thoriére Thoriére is offline
If everything's a dream, don't wake me.
 
Join Date: Aug 2014
Location: GMT -8:00
Gender: Male
Nature: Serious
Posts: 121
Quote:
Originally Posted by Lunacrest View Post
I hope it's not something like the var, because I thought 0x4064 was safe. If it is, that would be a wonderfully easy fix, but I don't get why it's fickle when it works occasionally.
If you think there's any chance it's the var, I'd recommend redoing the script with a different one and running a couple of tests with the changed script to see if the issue still presents itself. Like you said, if that's the case the fix would be incredibly easy, so I recommend giving it a shot even if it seems unlikely that that's the cause.
__________________
pokéfarm + tumblr + pinterest + pair
New to ROM hacking? Click here!
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old June 4th, 2018 (2:13 PM).
Le pug's Avatar
Le pug Le pug is offline
Creator of Pokémon: Discovery / Fat Kid
 
Join Date: Aug 2013
Location: Le bed
Age: 30
Gender: Male
Nature: Bold
Posts: 870
Quote:
Originally Posted by Lunacrest View Post
Spoiler:
Hi, there.

So, I'm doing a Level Script, and it seems to be fickle.

There's a Scientist inside Mt. Moon, who has this script.

Spoiler:

#org 0x8065EE
msgbox @hope 0x2
setvar 0x4064 0x1
end

#org @hope
= I hope to see you on the other side\n of the mountain!



This is meant to avoid having the level script activate early. The script itself is meant to trigger after the Gym Battle against the Cerulean City Gym Leader, who runs off upset at the loss. Her father, the Rocket Grunt in front of the gym, then immediately runs after you, and asks you what happened.

However, after I talk to the man, occasionally what happens is that upon entering Cerulean City, the game freezes and produces the sound that you make when you yank out the cartridge while the game is still playing.

After resetting, however, when I talk to the scientist, and enter the city, everything's fine, and the script runs perfectly. After I beat the Gym Leader, the gym Leader runs off, and the father does his thing, and everything after works perfectly, using the var 4064 for the level script. Sometimes tho, resetting after that freezes the game sometimes.

Initially, I thought it was because I accidentally activated some wild battle, because that's what happened the first time. After resetting and avoiding the grass, it worked perfectly. However, that was quickly disproven by the third reset, where the script failed and the game froze once more.

Any help would be lovely.

Here's the level script itself.
Spoiler:
#org 0x8055CD
lock
applymovement 0x7 0x880560A
waitmovement 0x0
msgbox 0x8805623 MSG_FACE '"What happened? I just saw my\ndaug..."
applymovement 0x7 0x8805615
waitmovement 0x0
msgbox 0x88056DB MSG_NORMAL '"Ashmi, don't you worry! I'm\ncomin..."
applymovement 0x7 0x8805618
waitmovement 0x0
hidesprite 0x7
setflag 0x270
setvar 0x4064 0x1
release
end


'---------
' Strings
'---------
#org 0x805623
= What happened? I just saw my\ndaughter, Ashmi, run out of the\lGym in tears!\p...\n...\pOh, she lost? It makes me sad when\nshe gets like this. It's time for\lme to do my thing as her dad!

#org 0x8056DB
= Ashmi, don't you worry! I'm\ncoming!


'-----------
' Movements
'-----------
#org 0x80560A
#raw 0x3 'Face Right
#raw 0x62 'Exclamation Mark (!)
#raw 0x0 'Face Down
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x1 'Face Up
#raw 0xFE 'End of Movements

#org 0x805615
#raw 0x0 'Face Down
#raw 0xFE 'End of Movements

#org 0x805618
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0xFE 'End of Movements


And here's the Gym Leader's script. Flag 0x271 is meant for the guards blocking Cerulean City (not relevant to the problem I think).

Spoiler:
#org 0x80585B
lock
faceplayer
trainerbattle 0x1 0x19F 0x0 0x880588F 0x8805A80 0x8805872
release
end

'---------------
#org 0x805872
msgbox 0x8805A99 MSG_NORMAL '"No! This isn't fair! My Pokémon\na..."
fadescreen 0x1
hidesprite LASTTALKED
setflag 0x291
fadescreen 0x0
setflag 0x271
setvar 0x4064 0x0
release
end


'---------
' Strings
'---------
#org 0x80588F
= It's good to see a new face in\nhere!\pI'm Ashmi, the Psychic-type Gym\nLeader of Cerulean City.\pThe difference between the rest of\nTeam Rocket and me is that I\ldidn't just join it, as if it were\lsome club.\pI was born into it. My father's\none of the famous bosses of Team\lRocket, and I've been honing my\lskills ever since I was young in\lprotecting the honor to my name.\pNow, my Psychic-type Pokémon are\nboth in peak physical and mental\lcondition.\pHow can you handle such a\ndevastating combination?

#org 0x805A80
= W-What? This can't be!

#org 0x805A99
= No! This isn't fair! My Pokémon\nare far stronger than yours!\pYou don't deserve a badge! You\ndeserve a smackdown!


I hope it's not something like the var, because I thought 0x4064 was safe. If it is, that would be a wonderfully easy fix, but I don't get why it's fickle when it works occasionally.[/SPOILER]
IDK if you know this or not, but setting your var 0x4060 0x0 means that the event can reoccur forever. Setting it to 0x4060 0x1 will have it occur only once ... IDK if that is your intention or not but just letting you know.

Also a level script for this is a little excessive. Try combining it like this:

Spoiler:
#org 0x80585B
lock
faceplayer
trainerbattle 0x1 0x19F 0x0 0x880588F 0x8805A80 0x8805872
release
end

'---------------
#org 0x805872
msgbox 0x8805A99 MSG_NORMAL '"No! This isn't fair! My Pokémon\na..."
fadescreen 0x1
hidesprite LASTTALKED
setflag 0x291
fadescreen 0x0
setflag 0x271
pause 0x20
pause 0x20
applymovement 0x7 0x880560A
waitmovement 0x0
msgbox 0x8805623 MSG_FACE '"What happened? I just saw my\ndaug..."
applymovement 0x7 0x8805615
waitmovement 0x0
msgbox 0x88056DB MSG_NORMAL '"Ashmi, don't you worry! I'm\ncomin..."
applymovement 0x7 0x8805618
waitmovement 0x0
hidesprite 0x7
setflag 0x270
release
end


The pauses are to give it a small delay. That way you don't have to waste time doing level scripts and wasting a var on the event.
__________________
Retired. Thank you guys for a wonderful five years.
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:19 AM.