• 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?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.
23
Posts
13
Years
  • Seen Jun 30, 2010
Nicolai Fox, you've been a great help so far!

The sprite now disappears and stays gone. When you press A on the sprite, the message appears, then the screen flashes and you hear the cry as you're supposed to. . .

but there's no battle. It just disappears.

Spoiler:


I'm so close to the breakthrough that will allow me to do a complete edit.
 
202
Posts
14
Years
  • Seen Jan 6, 2017
@melosfox

Just to clarify. You want to fight a level 30 Drowsee, which is holding an energy powder? That is what that battle script seems to be telling me lol.

The Wild Pokémon data should only have three values, yours has four.

wildbattle 0xX(pokemon species) 0xX(level of pokemon) 0xX(held item)

Bare in mind, all of the number values must be in hexidecimal format.
 
23
Posts
13
Years
  • Seen Jun 30, 2010
No, actually, I'm trying to fight a level 80 Mewtwo with a twistedspoon. (In Emerald) I have actually figured out most of the code and come up with a couple extra commands which work pretty well, except the battle begins with a strange fight intro on rocky soil. How do I change the fight background? Also, the sunlight is very strong, something else I'd like to change. Thanks!

Spoiler:


(Am I a fast learner?)
 
Last edited:
202
Posts
14
Years
  • Seen Jan 6, 2017
Best to learn how to do your own, than to copy Nintendo's (you will need less help in the future).

Here's what you're looking for:

wildbattle 0x96 0x50 0xD6

That is all. (And of course you need the setflag business etc, and maybe a custom song before wildbattle if you want a custom song).

#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @1 0x6
cry 0x96 0x0
wildbattle 0x96 0x50 0xD6
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @1
= MEWTWO: Argh you beat me hax!
 
23
Posts
13
Years
  • Seen Jun 30, 2010
Thanks, but it doesn't work, same problem as last time. The cry happens, then the sprite disappears. That's why I copied Nintendo's basic structure and edited it until it fit my needs. It's fairly close now, just the battle background is wrong.

EDIT: I fixed the background. I had overlooked the weather of the map in Advancemap. It had nothing to do with the script. I feel foolish.
 
Last edited:

vietazn654

A sound soul dwells within me
371
Posts
14
Years
Geez I actually thought this one would work =p

Code:
#dynamic 0x2DFD25

#org @start
checkflag 0x1004
if 0x1 goto @done
msgbox @1 0x6
applymovement 0x5 @move
waitmovement 0x0
msgbox @2 0x6
call @pokedex
msgbox @3 0x6
call @run
msgbox @6 0x6
applymovement 0x5 @done0
waitmovement 0x0
hidesprite 0x800F
setflag 0x1004
release
end

#org @done
release
end

#org @move
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0xFE

#org @1
= [blue_fr]\v\h01!

#org @2
= [blue_fr]PROF. BIRCH: I was looking for\nyou!\pRemember when I gave you that\nPOKEDEX?\pPROF. ROWAN of SINNOH gave me the\nNATIONAL DEX, so I want to update\lyour POKEDEX for you!\pLet's see... I put this here, and\ntake this our and... Ker-chunk!

#org @pokedex
fanfare 0x13E
msgbox @4 0x4
waitfanfare
closeonkeypress
special 0x16F
return

#org @3
= [blue_fr]Your MOM also wanted me to give\nyou these new shoes.

#org @run
fanfare 0x13E
msgbox @5 0x4
waitfanfare
closeonkeypress
setflag 0x82F
return

#org @4
= \v\h01's POKEDEX has been upgraded\nto NATIONAL MODE!

#org @5
= \v\h01 recieved the RUNNING SHOES!

#org @6
= [blue_fr]Well, that's all for now, \v\h01!\nI'll see you back at the lab!

#org @done0
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE

Errors:
-PROF. BIRCH is disappeared. (I thought the hidesprite meant that it would hide afterwards =p)

-The Running Shoe don't work =\

Anymore that you find wrong you can fix also. Thanks ;]
 

Binary

え?
3,977
Posts
16
Years
  • Age 29
  • Seen Apr 7, 2014
-PROF. BIRCH is disappeared. (I thought the hidesprite meant that it would hide afterwards =p)
There could be only (I think) two reasons. Either the flag has already been set, for which you'll have to use another flag or a level script is causing this problem, for which you have to delete any level scripts on the map.

-The Running Shoe don't work =\
Try putting setflag 0x82F in the main script block.

Also, you should put all your movements and text at the bottom.
 
202
Posts
14
Years
  • Seen Jan 6, 2017
melos@ I am truly stumped. I tried that script myself and it worked :s

What is this there for?
#raw 0x53 0x0F 0x80

viet@ In addition to what Binary said.

One cause of your Running Shoes not working could actually be the headers outside.

Make sure your outside headers have the label "Show village names". If that doesn't work try more.

The running shoes script might work you just may have some maps that don't have the header set up right.

As for Birch, exactly what Binary said. If you have set a Person ID for Birch with no particular reason, then change it to something else, or 0000.
 
Last edited:

gl3500

Glcelebi The Rom Hacker
11
Posts
14
Years
I am sure something is wrong, i am just not too familiar with these kind of scripts, so i am not definite yet, what i wanted was that when the player steps on a particular tile very close to prof.oaks lab in firered, another sprite next to the lab will go inside the lab and the player will say "....." after the sprite has gone into the lab. Can somebody please explain what i am doing wrong and explain exactly how the commands work for the door opening and closing thing, i tried something and it is not coming out right.
Spoiler:

I cannot compile script to test it, it says error 13 type mismatch on line 12. Appreciate help if i can get any. Thanx
 

vietazn654

A sound soul dwells within me
371
Posts
14
Years
@gl3500 You forgot to put it in HEX.

Code:
#dynamic 0x71B364
#org @start
checkflag 0x202
if 0x1 goto @hi2
goto @hi 
closeonkeypress
release
end
#org @clone
#raw 0x13
#raw 0x01
#raw [B]0xFE[/B]

#org @clonefinal
#raw 0x11
#raw 0x11
#raw 0xFE

#org @hi
lockall
applymovement 0x03 @clone
setdooropened 0x10 0xD
doorchange
applymovement 0x03 @clonefinal
setdoorclosed 0x10 0xD
doorchange
setflag 0x202
releaseall
end


#org @hi2
lockall
msgbox @weird 0x6
closeonkeypress
releaseall


#org @weird
= .......
 
202
Posts
14
Years
  • Seen Jan 6, 2017
How do you set one variable to a value, and then change it to another value?

I am using the Fire Red Hacked engine, and I used this code which changes the level of the Pokémon a gym leader has to three levels higher than your highest level Pokémon.

setvar 0x4052 0x203
trainerbattle 0x1 etc
setvar 0x4052 0x0

The var first gets set to the value that makes the Pokélevels what I wanted them to be, which worked. But after the battle, all trainer Pokémon levels are still 3 levels higher than my highest level Pokémon. If the value of 4052 is 0, it should cancel the change?

Thanks.
 
54
Posts
14
Years
  • Seen May 21, 2011
Ooft busy day.

@melosfox
1. Remove the nops.
2. Make sure the overworld's Person ID is set to 1000 (same as the flag you set)
2.5. A little tip. Underneath the "wildpokémonbattle" part, put in "playsong 0xXXX". Replace XXX with any song (there is a list of them in any header in Advance Map). This will make the battle theme when fighting the Pokémon whatever you want.

@smashking
What are you asking smashking? Be a little clearer.

@metroid die
The "waitmovement 0x0" part is supposed to be the same as the applymovement.

So for move player it's
applymovement 0xFF
waitmovement 0xFF

And you can still move about because you didn't use the "lock" command at the start of your script.

@viet
Decompile isn't the opposite of compile in this case. Decompile simply translates the script into something that is more readable (if it is already readable, then nothing happens).

So yeah, you need to make the script in a new offset.


I changed the waitmovements to what you said, but the error persists... Nothing I do changes it. Can you help out with this?
 

gl3500

Glcelebi The Rom Hacker
11
Posts
14
Years
@gl3500 You forgot to put it in HEX.
Thanx for the help, i will give it a try and see if it works. Again, Thanx. :-)

@gl3500 You forgot to put it in HEX.

Code:
#dynamic 0x71B364
#org @start
checkflag 0x202
if 0x1 goto @hi2
goto @hi 
closeonkeypress
release
end
#org @clone
#raw 0x13
#raw 0x01
#raw [B]0xFE[/B]

#org @clonefinal
#raw 0x11
#raw 0x11
#raw 0xFE

#org @hi
lockall
applymovement 0x03 @clone
setdooropened 0x10 0xD
doorchange
applymovement 0x03 @clonefinal
setdoorclosed 0x10 0xD
doorchange
setflag 0x202
releaseall
end


#org @hi2
lockall
msgbox @weird 0x6
closeonkeypress
releaseall


#org @weird
= .......

Thanx, whoops, i actually missed that, sometimes, i actually dont see things as simple as that, i will give it a try, thanx for the help. :-)

Hi, i have another problem now, i was able to compile the script and everything, but it is not working properly. the sprite does not move, the door opens and closes, but the "...." shows up. Why did the sprite not go through the door and into the lab. Please help again. I am trying, but i cannot get script working correctly, i am still quite new to the door command. Can somebody please show me what i am now doing wrong. Appreciate help. Thanx
Spoiler:
 
Last edited:
202
Posts
14
Years
  • Seen Jan 6, 2017
@gl3500

Spoiler:


I think that is what you want.

If not. What exactly do you want to happen?
 

Binary

え?
3,977
Posts
16
Years
  • Age 29
  • Seen Apr 7, 2014
@gl3500:
Spoiler:


EDIT: It would actually be better if you did this instead:
Spoiler:

Makes it a little simpler, eh?
 

gl3500

Glcelebi The Rom Hacker
11
Posts
14
Years
@gl3500:
Spoiler:


EDIT: It would actually be better if you did this instead:
Spoiler:

Makes it a little simpler, eh?

Yes and thanx, i got it working, i do have one other question though, i tried testing the PC function with this script. What i wanted it to do was to display message @10, when closed by pressing a, the screen will fade to black, play fanfare and ONLY when fanfare is done, the screen will fade back to normal, open up PC, allow use of PC WHILE keeping the hero unable to move until the PC is closed, finally, when the PC is closed, i want it to display message @11 and this message will again, only close when a is pushed. Can somebody please help with this, ithis is my first time trying a PC script and i cannot work out what i am doing wrong, i have tried more than 10 scripts for it and none have given the results i want, can anybody please point out what i di wrong. Thanx
Spoiler:
P.s The PC was using the pokeball sprite that is used for items, so do not think that i needed the lock and faceplayer commands.

Also, going back to my script from earlier, everything is working, i just have one problem now, when the sprite goes through the door. I wanted the messagebox @weird to automatically popup and you close it with a, originally my script made the sprite go through the door and if i walked back over the tile with the script, it shows the ".....". I now edited it to this in the spoiler and now nothing appears if i rewalk over it, now i know what the problem is with the "...." not reappearing, but it is not what i want. I want the "...." to popup automatically after the sprite has gone through the door and close when a is pressed, and if possible, how would i delay the message a bit? Finally, how do i make it so that when the "...." is shown and closed after pressing a, the "...." will not show again so that after the "...." has shown up and closed, the next time i step on the tile with the script, nothing will happen.

Spoiler:
 
Last edited:

vietazn654

A sound soul dwells within me
371
Posts
14
Years
Code:
#dynamic 0x2166E0

#org @start
checkflag 0x1000
if 0x1 goto @done
applymovement 0xFF @move
waitmovement 0x0
msgbox @1 0x6
setflag 0x1000
release
end

#org @done
release
end

#org @move
#raw 0x57
#raw 0x03
#raw 0x03
#raw 0x01
#raw 0x01
#raw 0x03
#raw 0xFE

#org @1
= \v\h01: (W-wh-where am I?)\p(Hmm... There's only one way to\nfind out.)
It's for RUBY... The movement part won't work. It skips it and goes to the message.


EDIT: NVMNVMNVM! IT WORKS! =P
 
Last edited:
23
Posts
13
Years
  • Seen Jun 30, 2010
Argh

Ok, so I'm going along scripting in XSE, when I try to compile the code, I get an error.

"Not enough free space found. Can not compile.

So I double check to make sure that there is in fact free space, and I notice that I have tons of it. Also, I can compile all parts of the script, unless I type in:
#dynamic 0xoffset
#org @start
at the beginning of the script (which has to be done for it to function.

What am I doing wrong?

(Also, when I compile the script in another program and get it working, I get a white screen at the beginning. What could cause that? I'm almost positive I'm not overwriting anything.)
 
Last edited:
23
Posts
13
Years
  • Seen Jun 30, 2010
If you haven't tried, put this at the beginning:

Code:
#dynamic 0x800000

Hmm. . . yes, I have tried that.
Still. XSE won't compile it, but PokeSvui does.
And, as soon as it's compiled, I get a white screen at the beginning.

Here's the script (offsets removed for now.)
Spoiler:


I know the script works because I was careful to save the state.
 
Last edited:
Status
Not open for further replies.
Back
Top