Script Help Thread (DO NOT REQUEST SCRIPTS) Page 128

Started by HackMew December 20th, 2008 5:10 AM
  • 625760 views
  • 9682 replies
Male
Seen December 7th, 2010
Posted November 30th, 2010
60 posts
13.6 Years
Can anybody tell why in the world the first badge keeps getting set whenever I use this script?

I'm not using that flag at all, but no matter how much i change the script it still sets the first badge. I've deleted and remade the scripts spots and everything.

Spoiler:
#dynamic 800000

#org @start
checkflag 0x64
if 0x0 goto @beginscript
release
end

//---------------
#org @beginscript
setflag 0x64
applymovement 0x1 @moverival
msgbox @rivalsay 0x06
trainerbattle 0x1 0x1 0x0 @challenge @defeat @afterwards
end

//---------------
#org @afterwards
msgbox @afterfight 0x06
fadescreen 0x1
hidesprite 0x1
fadescreen 0x0
release
end


//---------
// Strings
//---------
#org @rivalsay
= [black_fr][rival]: [green_fr]Hey, [player].\p[black_fr][rival]: [green_fr]How about we test out our new\nPokémon and see whose is better?

#org @challenge
= [black_fr][rival]: [green_fr]Show me what ya got [player]!

#org @defeat
= Holy crap...

#org @afterfight
= [black_fr][rival]: [green_fr]I can't believe I lost to you.



//-----------
// Movements
//-----------
#org @moverival
#raw 0x10 //Step Down (Normal)
#raw 0x10 //Step Down (Normal)
#raw 0x10 //Step Down (Normal)
#raw 0x10 //Step Down (Normal)
#raw 0x10 //Step Down (Normal)
#raw 0xFE //End of Movements


HackMew

Mewtwo Strikes Back

Seen October 26th, 2011
Posted October 15th, 2010
1,314 posts
16.9 Years
8001? That's kinda high number =)
If I'm right then 7FFF is maximum value for flag with expanded ROM and 3FFF with the normal one.
No... Flags area 0x1 - 0x3FFF. No matter if the ROM is expanded or not, obviously.


Can anybody tell why in the world the first badge keeps getting set whenever I use this script?

I'm not using that flag at all, but no matter how much i change the script it still sets the first badge. I've deleted and remade the scripts spots and everything.

Spoiler:
#dynamic 800000

#org @start
checkflag 0x64
if 0x0 goto @beginscript
release
end

//---------------
#org @beginscript
setflag 0x64
applymovement 0x1 @moverival
msgbox @rivalsay 0x06
trainerbattle 0x1 0x1 0x0 @challenge @defeat @afterwards
end

//---------------
#org @afterwards
msgbox @afterfight 0x06
fadescreen 0x1
hidesprite 0x1
fadescreen 0x0
release
end


//---------
// Strings
//---------
#org @rivalsay
= [black_fr][rival]: [green_fr]Hey, [player].\p[black_fr][rival]: [green_fr]How about we test out our new\nPokémon and see whose is better?

#org @challenge
= [black_fr][rival]: [green_fr]Show me what ya got [player]!

#org @defeat
= Holy crap...

#org @afterfight
= [black_fr][rival]: [green_fr]I can't believe I lost to you.



//-----------
// Movements
//-----------
#org @moverival
#raw 0x10 //Step Down (Normal)
#raw 0x10 //Step Down (Normal)
#raw 0x10 //Step Down (Normal)
#raw 0x10 //Step Down (Normal)
#raw 0x10 //Step Down (Normal)
#raw 0xFE //End of Movements
You know, trainerbattle 0x1 is meant for gym leaders.
Age 31
Seen September 22nd, 2016
Posted August 27th, 2016
79 posts
15.8 Years
Ok this is a problem I have never seen before... I have this simple battle script:
#dynamic 0x802FDE

#org @start
trainerbattle 0x0 0x21 0x0 @before @after
msgbox @later 6
end

#org @before
= You're almost there!\nBut first, you have to face my\lalmight dragon POKéMON!

#org @after
= It looks like my dragon wasn't\nenough...

#org @later
= You're so close to the GYM LEADER now!\nJust find the way and hope you\ldon't lose!
But when the battle is over, I have control over some other person event on the screen. I don't think it's a script error but I sure as hell don't know how to fix it... Can somebody tell me whats wrong?

+====================Supports====================+


+====================Supports====================+

destinedjagold

You can contact me in PC's discord server...

Age 32
Male
Seen 3 Days Ago
Posted March 24th, 2023
8,579 posts
16 Years
Ok this is a problem I have never seen before... I have this simple battle script:
Spoiler:
#dynamic 0x802FDE

#org @start
trainerbattle 0x0 0x21 0x0 @before @after
msgbox @later 6
end

#org @before
= You're almost there!\nBut first, you have to face my\lalmight dragon POKéMON!

#org @after
= It looks like my dragon wasn't\nenough...

#org @later
= You're so close to the GYM LEADER now!\nJust find the way and hope you\ldon't lose!


But when the battle is over, I have control over some other person event on the screen. I don't think it's a script error but I sure as hell don't know how to fix it... Can somebody tell me whats wrong?
indeed it's not caused by your script. It's a very well-known annoying error/bug that happens when you changed the position/direction of where an NPC is...
Try and change the unknown values(in A-Map) of the person that you control, and if it still doesn't fix it, then change the direction of where that NPC is facing...

HackMew

Mewtwo Strikes Back

Seen October 26th, 2011
Posted October 15th, 2010
1,314 posts
16.9 Years


indeed it's not caused by your script. It's a very well-known annoying error/bug that happens when you changed the position/direction of where an NPC is...
Try and change the unknown values(in A-Map) of the person that you control, and if it still doesn't fix it, then change the direction of where that NPC is facing...
Nope. It happens because when AM creates a new NPC, all its values are set to zero. And if you don't set them correctly, that problem could happen.
So, how did you set the trainer up, exactly?
Male
Sweden
Seen February 28th, 2023
Posted March 5th, 2010
28 posts
14.2 Years
haha yes, I think you're right. I was just throwing out a 4 digit number out there. I start my flags at 0x1200.
Okay, thanks. ^^


Gah, problem again. xD Okay, this Gym-script is all messed up. The leader doesn't say anything, and I don't get the badge, just the TM...
#dynamic 0x805799

#org @start
lock
faceplayer
checkflag 0x820
if 0x1 goto @done
trainerbattle 0x1 0x00B 0x0 @before @after @later
end

#org @before
= Welcome to BALEMORE CITY GYM!\nMy name is MAXI, and I am a \nNormal type leader!\nYou want to challenge me?

#org @after
= What!?

#org @later
msgbox @3 0x6
fanfare 0x13E
msgbox @4 0x4
waitfanfare
closeonkeypress
msgbox @5 0x6
giveitem 0x131 0x1 0x0
setflag 0x820
release
end

#org @done
msgbox @1 0x6
release
end

#org @1
= You should travel to CELINIA CITY\nto get your next badge.

#org @3
= Congratulations!\pFor beating me, you get\nthis badge!

#org @4
= \v\h01 recieved a badge!

#org @5
= Oh, and please take this.

And another problem...This Rocket grunt is meant to say ''Hey, kids are not allowed here'' if you haven't got the first badge, but he don't say anything, and if you have the badge, he's messed up too...:
#dynamic 0x80566A

#org @start
lock
faceplayer
checkflag 0x820
if 0x0 goto @end
if 0x1 goto @done
release
end

#org @done
trainerbattle 0x1 0x15F 0x0 @1 @2 @after
end

#org @after
msgbox @4 0x6
applymovement 0x1 @move
waitmovement 0x0
setflag 0x0661
end

#org @1
= Hey, what are you\ndoing here kid?\nWe're doing private\nTEAM ROCKET stuff...so scram!\nHuh? What, you want to battle? Okay!

#org @2
= You little...!

#org @end
msgbox @3 0x6
release
end

#org @3
= Hey, kids are not allowed here!

#org @4
= Argh! Well, you can't\nstop our evil plan, though!

#org @move
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0x60
#raw 0xFE


Age 31
Seen September 22nd, 2016
Posted August 27th, 2016
79 posts
15.8 Years
Nope. It happens because when AM creates a new NPC, all its values are set to zero. And if you don't set them correctly, that problem could happen.
So, how did you set the trainer up, exactly?
Same way I set up most of my other trainers...

+====================Supports====================+


+====================Supports====================+

HackMew

Mewtwo Strikes Back

Seen October 26th, 2011
Posted October 15th, 2010
1,314 posts
16.9 Years
Same way I set up most of my other trainers...
Spoiler:
What if you set the second Unknown value to 03? The rest seems okay.
Age 31
Seen September 22nd, 2016
Posted August 27th, 2016
79 posts
15.8 Years
What if you set the second Unknown value to 03? The rest seems okay.
I've tried that and I just tried it again. It still does the same thing... This trainer isn't the only one either. I have 4 trainers and a GYM Leader in there. 2 of the trainers and the leader do this. But all of them are set up the same.

Okay, thanks. ^^


Gah, problem again. xD Okay, this Gym-script is all messed up. The leader doesn't say anything, and I don't get the badge, just the TM...


And another problem...This Rocket grunt is meant to say ''Hey, kids are not allowed here'' if you haven't got the first badge, but he don't say anything, and if you have the badge, he's messed up too...:
GYM Leader:
Spoiler:

#dynamic 0x805799

#org @start
lock
faceplayer
trainerbattle 0x1 0x00B 0x0 @before @after @later
msgbox @6 0x6 <---What he says when you talk to him after you beat him
release
end

#org @before
= Welcome to BALEMORE CITY GYM!\nMy name is MAXI, and I am a \lNormal type leader!\nYou want to challenge me?
^^^^This is wrong. Changed it for you. You can't use \n every time. Look at the xse help file for msgbox help.
#org @after
= What!?

#org @later
setflag 0x820<---Moved it for no reason =\
msgbox @3 0x6
fanfare 0x13E
msgbox @4 0x6<--- 0x4 Not needed...
waitfanfare
msgbox @5 0x6
giveitem 0x131 0x1 0x0
release
end

#org @done
msgbox @1 0x6
release
end

#org @1
= You should travel to CELINIA CITY\nto get your next badge.

#org @3
= Congratulations!\pFor beating me, you get\nthis badge!

#org @4
= \v\h01 recieved a badge!

#org @5
= Oh, and please take this.

#org @6
= Put here what he says when you talk to him after you beat him. Maybe some words of encouragement? =]


Rocket:
Spoiler:
#dynamic 0x80566A

#org @start
lock
faceplayer
checkflag 0x820<----if 0x0 goto @end not needed
if 0x1 goto @done
msgbox @3 0x6<----He says this if you don't have the badge
release
end

#org @done
trainerbattle 0x1 0x15F 0x0 @1 @2 @after
release
end

#org @after
msgbox @4 0x6
applymovement 0x1 @move
waitmovement 0x0
setflag 0x0661
release
end

#org @1
= Hey, what are you\ndoing here kid?\pWe're doing private\nTEAM ROCKET stuff...so scram!\pHuh? What, you want to battle?\nOkay!
^^^^Look in the xse help file for help with \p, \n, and \l
#org @2
= You little...!

<[email protected] not needed

#org @3
= Hey, kids are not allowed here!

#org @4
= Argh! Well, you can't\nstop our evil plan, though!

#org @move
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0x60
#raw 0xFE

Try that

+====================Supports====================+


+====================Supports====================+

HackMew

Mewtwo Strikes Back

Seen October 26th, 2011
Posted October 15th, 2010
1,314 posts
16.9 Years
I've tried that and I just tried it again. It still does the same thing... This trainer isn't the only one either. I have 4 trainers and a GYM Leader in there. 2 of the trainers and the leader do this. But all of them are set up the same.
Just to be sure, post the settings for all of them into a spoiler.
Male
Seen December 7th, 2010
Posted November 30th, 2010
60 posts
13.6 Years
You know, trainerbattle 0x1 is meant for gym leaders.
Yeah, I've heard that, but I can't find any list telling me what all the other 0xX's are. I know 0x0 is trainer battle, 0x1 is gym, 0x9 is tutorial battle, and 0x3 is supposed to be rival battle (checked script from original firered), but I still get the first badge even when I use 0x3.

If there is a guide that can show me how to properly set up a 0x3 or 0xX trainerbattle script, please show me.


Age 31
Seen September 22nd, 2016
Posted August 27th, 2016
79 posts
15.8 Years
Just to be sure, post the settings for all of them into a spoiler.
First Trainer(works fine):
Spoiler:


Second Trainer(works fine):
Spoiler:


Third Trainer(same problem):
Spoiler:


Forth Trainer(same problem):
Spoiler:


Gym Leader(same problem):
Spoiler:

+====================Supports====================+


+====================Supports====================+

HackMew

Mewtwo Strikes Back

Seen October 26th, 2011
Posted October 15th, 2010
1,314 posts
16.9 Years
First Trainer(works fine):
Spoiler:


Second Trainer(works fine):
Spoiler:


Third Trainer(same problem):
Spoiler:


Forth Trainer(same problem):
Spoiler:


Gym Leader(same problem):
Spoiler:
As you can see, the Unknown value for the fourth trainer is set to 00 instead of 03. Change that and see what happens.
Male
Sweden
Seen February 28th, 2023
Posted March 5th, 2010
28 posts
14.2 Years
I've tried that and I just tried it again. It still does the same thing... This trainer isn't the only one either. I have 4 trainers and a GYM Leader in there. 2 of the trainers and the leader do this. But all of them are set up the same.


GYM Leader:
Spoiler:

#dynamic 0x805799

#org @start
lock
faceplayer
trainerbattle 0x1 0x00B 0x0 @before @after @later
msgbox @6 0x6 <---What he says when you talk to him after you beat him
release
end

#org @before
= Welcome to BALEMORE CITY GYM!\nMy name is MAXI, and I am a \lNormal type leader!\nYou want to challenge me?
^^^^This is wrong. Changed it for you. You can't use \n every time. Look at the xse help file for msgbox help.
#org @after
= What!?

#org @later
setflag 0x820<---Moved it for no reason =\
msgbox @3 0x6
fanfare 0x13E
msgbox @4 0x6<--- 0x4 Not needed...
waitfanfare
msgbox @5 0x6
giveitem 0x131 0x1 0x0
release
end

#org @done
msgbox @1 0x6
release
end

#org @1
= You should travel to CELINIA CITY\nto get your next badge.

#org @3
= Congratulations!\pFor beating me, you get\nthis badge!

#org @4
= \v\h01 recieved a badge!

#org @5
= Oh, and please take this.

#org @6
= Put here what he says when you talk to him after you beat him. Maybe some words of encouragement? =]


Rocket:
Spoiler:
#dynamic 0x80566A

#org @start
lock
faceplayer
checkflag 0x820<----if 0x0 goto @end not needed
if 0x1 goto @done
msgbox @3 0x6<----He says this if you don't have the badge
release
end

#org @done
trainerbattle 0x1 0x15F 0x0 @1 @2 @after
release
end

#org @after
msgbox @4 0x6
applymovement 0x1 @move
waitmovement 0x0
setflag 0x0661
release
end

#org @1
= Hey, what are you\ndoing here kid?\pWe're doing private\nTEAM ROCKET stuff...so scram!\pHuh? What, you want to battle?\nOkay!
^^^^Look in the xse help file for help with \p, \n, and \l
#org @2
= You little...!

<[email protected] not needed

#org @3
= Hey, kids are not allowed here!

#org @4
= Argh! Well, you can't\nstop our evil plan, though!

#org @move
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0x60
#raw 0xFE

Try that
Nope, not working. :S The Rocket trainer still dont say anything if you not have a badge, and the gym leader is the same.


Age 31
Seen September 22nd, 2016
Posted August 27th, 2016
79 posts
15.8 Years
As you can see, the Unknown value for the fourth trainer is set to 00 instead of 03. Change that and see what happens.
Oh that's because I used the old picture. But they're all set to 03 and it still does the same thing.

Nope, not working. :S The Rocket trainer still dont say anything if you not have a badge, and the gym leader is the same.
Well they both worked when I tested them... I'm not sure what else to say. Unless it the rom your hacking. What version is it? R/S or FR/LG?

+====================Supports====================+


+====================Supports====================+
Male
Sweden
Seen February 28th, 2023
Posted March 5th, 2010
28 posts
14.2 Years
Oh that's because I used the old picture. But they're all set to 03 and it still does the same thing.


Well they both worked when I tested them... I'm not sure what else to say. Unless it the rom your hacking. What version is it? R/S or FR/LG?
FireRed.
I tested it again, and now the Gym worked, but the Rocket grunt dont say anything...


Age 31
Seen September 22nd, 2016
Posted August 27th, 2016
79 posts
15.8 Years
FireRed.
I tested it again, and now the Gym worked, but the Rocket grunt dont say anything...
Well I just tested the grunt again and it worked perfect. I'm not sure what you're doing wrong... Check the person event in A-map because this is what happens when I test it:
Spoiler:

+====================Supports====================+


+====================Supports====================+

HackMew

Mewtwo Strikes Back

Seen October 26th, 2011
Posted October 15th, 2010
1,314 posts
16.9 Years
Oh that's because I used the old picture. But they're all set to 03 and it still does the same thing.
Are you using some saves perhaps?


FireRed.
I tested it again, and now the Gym worked, but the Rocket grunt dont say anything...
Are you using a save state/game? If so, make sure to enter/exit a building before trying. If it still doesn't work, try putting them on a clean ROM and see what happens.
Age 31
Seen September 22nd, 2016
Posted August 27th, 2016
79 posts
15.8 Years
Are there any other people besides the trainers and the gym leader?
No. In the town there is, but other than that, no. Only the Gym Leader and the trainers are in the gym.

+====================Supports====================+


+====================Supports====================+
Male
Seen December 7th, 2010
Posted November 30th, 2010
60 posts
13.6 Years
So does nobody know what the difference between trainerbattle 0x1 and 0x3 is?

and any others besides 0x0?

To be more specific, is there a list/guide that can tell me any of this in detail? I've set up a script with 0x3, but I guess I did it wrong, because it still sets the first badge, and the battle is on route 1 after leaving what would be pallet town.

The flag that is set is not the first badge flag either.