• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.
17
Posts
13
Years
  • Age 30
  • Seen Aug 15, 2012
OK, so I'm using JPAN's tutorial to add new multichoice boxes. I'm editing the Game Corner, and now my problem is: how do I make the coin cost align to the right, like in the game? In my hex editor, I see the bytes "FF BB BC CC BB FC 13 55 FC 06 00 00 A2 A3 A1 00 BD C9 C3 C8 CD" This says "ABRA (align to the right) 120 COINS". I'm using XSE to input my new values, which are "BULBASAUR (align to the right) 4,000 COINS". How do I input the align to the right part? I'm kind of a noob at this.
 

redriders180

Mastermind of Pokemon Glazed
314
Posts
13
Years
Ok guys, thanks a ton for everything, and I only have a few more questions.

First, I want to change around the puzzle in Fortree Gym so its bigger and more challenging. I went into the gym on advance map, and the spinny bars aren't on the map, and when i went into the map header code, it only has a code for a special event, and i assume its this special event that makes the spinny bars spin. Is there a way to edit this?

Also, I tried to find a tutorial on inserting homemade Pokemon in the space between Celebi and Treecko, but the only tutorial i found is in another language, which uses programs in another language too. are there any tutorials or programs in English for this task?
 
8
Posts
15
Years
  • Seen Mar 17, 2014


You'll never learn if you skip through or think those tutorials are gibberish.
Learn from the basics and understand what you're doing.

Ok so i reread the tutorials i even read the same one 3 times but its still just not making sense and since i no this isn't a request thread maybe someone can point me in the direction of one
 
55
Posts
14
Years
  • Seen Feb 1, 2023
I'm trying to write a script that generates a random trainer battle. Naturally, this involves using the random command. My code:
Spoiler:

The problem is that instead of using the random number, I think XSE uses 0x800D, the variable that random assigns to. And there is no trainer # 0x800D.
Is there a way to fix this?
 

TheDarkShark

Metal Headed Hacker
56
Posts
13
Years
@blakcat: Well, most commands can handle variables as parameters. Those commands related to Flags do NOT support this. It's not a very nice solution (it takes tons of free space...), but it is the only possible solution I can think of:

Code:
#dynamic 0x800000

#org @main
random 0x2b5
compare LASTRESULT 0x0
if 0x1 goto @trainer1
compare LASTRESULT 0x1
if 0x1 goto @trainer2
...
compare LASTRESULT 0x2b4
if 0x1 goto @trainer2b5

#org @trainer1
trainerbattle 0x1 0x0 @talk @talk @finish
end

#org @trainer2
trainerbattle 0x1 0x1 @talk @talk @finish
end
 

Skara

THIS. IS. SEMPITERNAL.
350
Posts
15
Years
Ok, I'm obviously doing something wrong here...
Spoiler:


I'm about to code the setflag into Surge's Gym Battle.
For some reason, that full script doesn't come up when I open it on AMap.
 
55
Posts
14
Years
  • Seen Feb 1, 2023
@TheDarkShark: Thanks a ton! I'm gonna take a guess and say that since trainerbattle is essentially a flag, variables won't work as a parameter. I had thought of trying to explicity account for all the trainers, but I'm really hoping there's another way to do it.

@Skara: I'm using a different script editor (XSE), so I might be waaaayy off, but I think you may be doing a few things wrong:
1) #org @text is used twice
2) I don't think your second part (see spoiler) ever gets called. 'release' 'end' are directly above it so it seems there is no way for it to run (again, correct me if I'm wrong)
Spoiler:

3) I've never seen "if 0x1 jump :end" before. I'm relatively new to scripting so that doesn't mean that much, but potentially it could be the problem (although it probably isn't)

I would recommend putting the second part in its own function and make sure the first part calls it so it's sure to run. But like I said, I use a different script editor.
 

colcolstyles

Yours truly
1,588
Posts
15
Years
I'm trying to write a script that generates a random trainer battle. Naturally, this involves using the random command. My code:
Spoiler:

The problem is that instead of using the random number, I think XSE uses 0x800D, the variable that random assigns to. And there is no trainer # 0x800D.
Is there a way to fix this?

If you only want a small number of available trainers, then TheDarkShark's method will be perfectly manageable. However, if you're looking for a more general solution, you'll have to disassemble the routines associated with the 'trainerbattle' command and edit them so that if the second parameter is a variable, the game will load the value stored in that variable. It's not too hard if you know what you're doing but if you don't, it's most likely impossible.
 
1
Posts
13
Years
  • Seen Feb 24, 2011
i guess we aren't allowed to request scripts, so how about a yes or no question..
can i make it so that when i get the Badge that allows me to use Cut outside of battle, all of the trees disappear?
i want to make a game where HM's aren't needed.
 

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
i guess we aren't allowed to request scripts, so how about a yes or no question..
can i make it so that when i get the Badge that allows me to use Cut outside of battle, all of the trees disappear?
i want to make a game where HM's aren't needed.

set a flag after you get the badge.
put that said flag on all the trees so they'll disappear.
 

Skara

THIS. IS. SEMPITERNAL.
350
Posts
15
Years
@TheDarkShark: Thanks a ton! I'm gonna take a guess and say that since trainerbattle is essentially a flag, variables won't work as a parameter. I had thought of trying to explicity account for all the trainers, but I'm really hoping there's another way to do it.

@Skara: I'm using a different script editor (XSE), so I might be waaaayy off, but I think you may be doing a few things wrong:
1) #org @text is used twice
2) I don't think your second part (see spoiler) ever gets called. 'release' 'end' are directly above it so it seems there is no way for it to run (again, correct me if I'm wrong)
Spoiler:

3) I've never seen "if 0x1 jump :end" before. I'm relatively new to scripting so that doesn't mean that much, but potentially it could be the problem (although it probably isn't)

I would recommend putting the second part in its own function and make sure the first part calls it so it's sure to run. But like I said, I use a different script editor.
Cheers, I'll try that out. If it still doesn't show up full I'll have to resort to screaming.
 
55
Posts
14
Years
  • Seen Feb 1, 2023
i guess we aren't allowed to request scripts, so how about a yes or no question..
can i make it so that when i get the Badge that allows me to use Cut outside of battle, all of the trees disappear?
i want to make a game where HM's aren't needed.

set a flag after you get the badge.
put that said flag on all the trees so they'll disappear.

That would indeed work, but I believe that since the badges themselves are flags, you could simply put their flags on the trees and you wouldn't need extra flags.

Spoiler:


I'm trying to write a script that generates a random trainer battle. Naturally, this involves using the random command. My code:

Spoiler:


The problem is that instead of using the random number, I think XSE uses 0x800D, the variable that random assigns to. And there is no trainer # 0x800D.
Is there a way to fix this?

If you only want a small number of available trainers, then TheDarkShark's method will be perfectly manageable. However, if you're looking for a more general solution, you'll have to disassemble the routines associated with the 'trainerbattle' command and edit them so that if the second parameter is a variable, the game will load the value stored in that variable. It's not too hard if you know what you're doing but if you don't, it's most likely impossible.

I actually wanted to use all the available trainers in Ruby, so it would be a little ridiculous to use TheDarkShark's method for 200+ trainers. And I don't know how to edit the 'trainerbattle' routines, but I could probaby pick it up pretty easy if you could refer me to a tutorial or PM me or something.
 
Last edited:
4
Posts
13
Years
  • Seen Apr 3, 2011
Sorry if this has been posted before but I ran a search and couldn't really find anything on it.


Game: Sapphire
Type: Person
Editor: Notepad / PKSV
Script: Choose Pokemon
Spoiler:


img.photobucket.com/albums/v237/cloudy789/eh.png
img.photobucket.com/albums/v237/cloudy789/eh2.png
I'm not allowed to post urls.


I want to pull up the r/s choose pokemon menu so that I can choose my starter, but when I run this script that first image pops up.
Then when I hit A, I'm suddenly the green glitch guy and not myself anymore.

I have no clue why the second part happens. As for the special, maybe I'm not setting a flag that I need to?
 

Teh Blazer

Divider of Zero
776
Posts
15
Years
I've just put a level script on the same map as another level script (Is that bad, two level scripts on the same area?). I can get the first to activate no problem, but the second one checks for the Po0kedex flag and activates afetr that. The problem is I can't seem to activate the second one, even after the conditions are set. This is XSE. Here is the second script:

Spoiler:
I was sort of answered in the sense that I can't have two level scripts of the same type on the same map, but I don't know what to do.

I have two level scripts (Type 02) that I want to activate at different times. Of course the first one works but when the requirements for the second one are activated, the second one doesn't activate. In fact, when I enter the map to activate it, the screen just goes black and doesn't respond.

How do i fix this/ combine the two scripts into one?
 
3,830
Posts
14
Years
  • Age 27
  • OH
  • Seen Feb 26, 2024
Okay, I consider myself a pretty good scripter, but I've run into a problem. For some reason, whenever I've been writing a script, and I compile it, it will either malfunction, or the game will reset that has the said script.

I've tried two different scripters (XSE and PKSV), but the errors happen regardless. Am I doing something wrong, or do both have some bug I haven't heard about.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Okay, I consider myself a pretty good scripter, but I've run into a problem. For some reason, whenever I've been writing a script, and I compile it, it will either malfunction, or the game will reset that has the said script.

I've tried two different scripters (XSE and PKSV), but the errors happen regardless. Am I doing something wrong, or do both have some bug I haven't heard about.

Mind posting your script?
 
3,830
Posts
14
Years
  • Age 27
  • OH
  • Seen Feb 26, 2024
Mind posting your script?

Well, this is what it looks like, compiled.

Code:
#org 0x8740454
'-----------------------------------
lockall
checkflag FR_POKEMON
if true jump 0x8740472 ' Flag is set
msgbox 0x8740474 ' Wait, I need to spea...
callstd MSG_LOCK ' Built-in lock command
applymovement PLAYER 0x87404A6 ' walk_down end
pauseevent 0x0
releaseall
end

#org 0x8740472
'-----------------------------------
releaseall
end


#org 0x8740474
= Wait, I need to speak with\nPROFESSOR LITTLE first!

#org 0x87404A6
M walk_down end
(From PKSV)
 

Nerketur

PokéScripter
104
Posts
13
Years
Okay, I consider myself a pretty good scripter, but I've run into a problem. For some reason, whenever I've been writing a script, and I compile it, it will either malfunction, or the game will reset that has the said script.

I've tried two different scripters (XSE and PKSV), but the errors happen regardless. Am I doing something wrong, or do both have some bug I haven't heard about.

I don't know about PKSV, but I do know that a script causing the ROM to reset is not a usual occurrence unless you use Pokescript.

If this just randomly started happening, I'd say the ROM could have gotten corrupted. If it happened from the first time you started, I'd say you used a bad ROM. Try doing the script in a new, clean ROM, and see what happens.

If that doesn't work... then it's probably the script. But, looking at the script, it doesn't "seem" to be bad. I'd recommend posting what XSE sees it as, because I don't know how PKSV works.

Malfunctions happen when your script is incorrect. So, those are easily fixable. =)
 
Status
Not open for further replies.
Back
Top