The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Tutorials (https://www.pokecommunity.com/forumdisplay.php?f=66)
-   -   Sierra's MEGA-HUGE XSE Scripting Tutorial (https://www.pokecommunity.com/showthread.php?t=164276)

Unknown908 July 7th, 2018 6:13 AM

DIEGOISAWESOME. PLZ!!!. I have played pokémon crystaldust and I LOVED it. But the things you changed like opeing and the color when the pokémon word shines. PLEASE! make tutorials of them. EVEN IF THIS IS THE FUTURE. PLZ!
!!!!
!!!!
!!!!
PLEASE!!!!!!!!!!!
PLEASE!!!!!!!
I BEG YOU!
PLZ!! :(

pikachux2 November 22nd, 2018 6:27 PM

Having some problems moving the camera with a script tile. I'm setting unknown to 3 and my script doesn't crash. It simply doesn't move the camera. Even using a waitmovement 0x7F after my applymovement call.

DrFuji November 22nd, 2018 11:11 PM

Quote:

Originally Posted by pikachux2 (Post 9951935)
Having some problems moving the camera with a script tile. I'm setting unknown to 3 and my script doesn't crash. It simply doesn't move the camera. Even using a waitmovement 0x7F after my applymovement call.

Are you able to post your script so other members can analyse it and find out what's wrong?

Make sure that you're including the commands 'special 0x113' and 'special 0x114' before and after moving the camera.

pikachux2 November 23rd, 2018 7:32 AM

Quote:

Originally Posted by DrFuji (Post 9951980)
Are you able to post your script so other members can analyse it and find out what's wrong?

Make sure that you're including the commands 'special 0x113' and 'special 0x114' before and after moving the camera.

Special 0x113 and 0x114 were the problem, I hadn't heard about them. Thanks :)

Now am I able to move the camera with the movesprite or movesprite2 cmds? I have a script where this would be much easier than adjusting the camera based on players initial location with an applymovement cmd.

BluRose November 23rd, 2018 12:34 PM

Quote:

Originally Posted by pikachux2 (Post 9952132)
Now am I able to move the camera with the movesprite or movesprite2 cmds? I have a script where this would be much easier than adjusting the camera based on players initial location with an applymovement cmd.

try with the npc id 0xFE (or 0xFF? i can't remember)

pikachux2 November 23rd, 2018 1:07 PM

The camera is 0x7F, but as far as I can tell I'm not able to move it with any movesprite cmd. Also having a problem were the sprite whose ID initiates my script keeps turning to face against the player each time I applymovement 0xFF. This is bizarre to me because I'm not even using a faceplayer cmd, or msgbox 0x6 (which I think deals with some kind of faceplayer call, if I'm correct). Even more bizarre because the player moves earlier in the script and doesn't trigger the NPC to move.

Spoiler:
#dynamic 0x819170

#org @main
lockall
compare 0x407D 0x4
if 0x4 goto @afterWon
compare 0x407D 0x2
if 0x1 goto @rematch
if 0x0 goto @original
goto @end

#org @original
msgbox @challenge 0x5
compare 0x800D 0x1
if 0x1 goto @wantsChallenge
setvar 0x407D 0x1
msgbox @okay 0x4
closeonkeypress
goto @end

#org @rematch
msgbox @rematchMsg 0x5
compare 0x800D 0x1
if 0x1 goto @wantsChallenge
msgbox @okay 0x4
closeonkeypress
goto @end

#org @wantsChallenge
msgbox @challengeStart 0x4
closeonkeypress
pause 0x10
fadescreen 0x1
setflag 0x113
movesprite 0xFF 0x23 0xB
movesprite2 0x7F 0x23 0xB
pause 0x10
setflag 0x114
pause 0x20
fadescreen 0x0
compare 0x407D 0x1
if 0x3 call @intros
applymovement 0xFF @lookRight
applymovement 0x3 @rightKidMoveIn
waitmovement 0x3
setvar 0x407D 0x2
trainerbattle 0x1 0x43 0x0 @before @after @battle2
goto @end

#org @battle2
msgbox @1stWin 0x4
closeonkeypress
applymovement 0x3 @rightKidBackOut
applymovement 0x8 @bottomKidMoveIn
applymovement 0xFF @lookDown
waitmovement 0x8
trainerbattle 0x1 0x44 0x0 @before2 @after2 @battle3
goto @end

#org @battle3
msgbox @2ndWin 0x4
closeonkeypress
applymovement 0x8 @bottomKidBackOut
applymovement 0x1 @leftKidMoveIn
applymovement 0xFF @lookLeft
waitmovement 0x1
trainerbattle 0x1 0x42 0x0 @before3 @after3 @battle4
goto @end

#org @battle4
msgbox @3rdWin 0x4
closeonkeypress
applymovement 0x1 @leftKidBackOut
applymovement 0x4 @topKidMoveIn
applymovement 0xFF @lookUp
waitmovement 0x1
trainerbattle 0x1 0x41 0x0 @before4 @after4 @won
goto @end

#org @won
setvar 0x407D 0x3
msgbox @finalWin 0x4
closeonkeypress
applymovement 0x4 @topKidBackOut
waitmovement 0x4
pause 0x30
applymovement 0xFF @lookAround
waitmovement 0xFF
pause 0x30
applymovement 0x1 @suprised
applymovement 0x3 @suprised
applymovement 0x8 @suprised
applymovement 0x4 @suprised
waitmovement 0x0
applymovement 0x3 @rightKidMoveIn
applymovement 0xFF @lookRight
waitmovement 0x3
msgbox @youWin 0x4
closeonkeypress
msgbox @prize 0x4
countpokemon
compare 0x800D 0x6
if 0x1 goto @partyFull
setvar 0x8006 0x0
loadpointer 0x0 @magby
special 0x25
setvar 0x8006 0x1
loadpointer 0x0 @elekid
special 0x25
multichoice 0x12 0x8 0x20 0x0
compare 0x800D 0x0
if 0x1 @pickedMag
compare 0x800D 0x1
if 0x1 @pickedEle
msgbox @wantNone 0x4
closeonkeypress
goto @end

#org @pickedMag
pause 0x30
givepokemon 0xF0 0xC 0x0 0x0 0x0 0x0
fanfare 0x101
msgbox @gotPokeMag 0x4
waitfanfare
closeonkeypress
msgbox @giveNickname 0x5
compare 0x800D 0x1
if 0x1 call @name
msgbox @takeCareMag 0x4
closeonkeypress
setvar 0x407D 0x5
goto @end

#org @pickedEle
pause 0x30
givepokemon 0xEF 0xC 0x0 0x0 0x0 0x0
fanfare 0x101
msgbox @gotPokeEle 0x4
waitfanfare
closeonkeypress
msgbox @giveNickname 0x5
compare 0x800D 0x1
if 0x1 call @name
msgbox @takeCareEle 0x4
closeonkeypress
setvar 0x407D 0x4
goto @end

#org @name
countpokemon
subvar 0x800D 0x1
copyvar 0x8004 0x800D
fadescreen 0x1
special 0x9E
waitstate
return

#org @intros
applymovement 0xFF @lookRight
msgbox @welcome1 0x4
closeonkeypress
applymovement 0xFF @lookDown
msgbox @welcome2 0x4
closeonkeypress
applymovement 0xFF @lookLeft
msgbox @welcome3 0x4
closeonkeypress
applymovement 0xFF @lookUp
msgbox @welcome4 0x4
closeonkeypress
return

#org @partyFull
msgbox @partyFullMsg 0x4
closeonkeypress
goto @end

#org @afterWon
msgbox @afterMsg 0x4
closeonkeypress
goto @end

#org @end
releaseall
end


there is the body if anyone wants to check it out...

DrFuji November 23rd, 2018 11:13 PM

Quote:

Originally Posted by pikachux2 (Post 9952071)
Now am I able to move the camera with the movesprite or movesprite2 cmds? I have a script where this would be much easier than adjusting the camera based on players initial location with an applymovement cmd.

There's really only one instant move camera command and its extremely buggy. It will move every OW (including the player) rather than just the camera, resets all OWs original positions after a trainerbattle and if you don't move the camera back to its original position after using it, will mess with the movement permissions of the map. It should only really be used in the context of the video in the thread (looking at something far away) and isn't suited for your purpose at all.

Quote:

Originally Posted by pikachux2 (Post 9952164)
The camera is 0x7F, but as far as I can tell I'm not able to move it with any movesprite cmd. Also having a problem were the sprite whose ID initiates my script keeps turning to face against the player each time I applymovement 0xFF. This is bizarre to me because I'm not even using a faceplayer cmd, or msgbox 0x6 (which I think deals with some kind of faceplayer call, if I'm correct). Even more bizarre because the player moves earlier in the script and doesn't trigger the NPC to move.

there is the body if anyone wants to check it out...

I'm not 100% sure why the OW is acting like that based of your script, but make sure that it isn't sharing its 'Person Event Number' with any other OW. If that isn't the case, you could try writing an extra applymovement command each time the player changes their facing direction that changes the troublesome OW's facing direction to the correct one.

Also, you're using setflag 0x113/ 0x114 instead of the special command in your script. Finally, its msgbox 0x2 that has lock/ faceplayer automatically built-in. Here's what it says in the first post of this thread:

Spoiler:
Msgbox Numbers
Here are the many different types, taken directly from The ROM Hacking Newsletter, also located in the ROM Hacking section.
This week's tip comes from HackMew. This time, it's all about msgboxes. Below is a description, script example and in-game shot of the different msgbox types.

0x2
Spoiler:
Description:
This is the msgbox used for normal people. Using this type means that you don't need to use the lock, faceplayer or release commands.

Script:
#dynamic 0x800000


#org @start
msgbox @hello 0x2
end

#org @hello
= Hello, my name is dshayabusa.


0x3
Spoiler:
Description:
Used for signs etc. No lock or faceplayer effect. Only shows the sign textbox when used on an actual sign.

Script:
#dynamic 0x800000



#org @start
msgbox @sign 0x3
end

#org @sign
= You are here

0x4
Spoiler:
Description:
A normal msgbox except for the fact that it does not close. Command closeonkeypress must be used to close it. No lock or faceplayer effect.

Script:
#org @start
msgbox @hello 0x4
end

#org @hello
= Hello, my name is dshayabusa.

0x5
Spoiler:
Description:
Used for Yes/No questions. No lock or faceplayer effect.

Script:
#dynamic 0x800000


#org @start
msgbox @question 0x5
end

#org @question
= Is this statement false?

0x6
Spoiler:
Description:
Normal textbox. Has no lock or faceplayer effect.

Script:

#dynamic 0x800000

#org @start
msgbox @hello 0x6
end

#org @hello
= Hello, my name is dshayabusa.

pikachux2 November 24th, 2018 9:20 AM

Quote:

Originally Posted by DrFuji (Post 9952263)
There's really only one instant move camera command and its extremely buggy. It will move every OW (including the player) rather than just the camera, resets all OWs original positions after a trainerbattle and if you don't move the camera back to its original position after using it, will mess with the movement permissions of the map. It should only really be used in the context of the video in the thread (looking at something far away) and isn't suited for your purpose at all.



I'm not 100% sure why the OW is acting like that based of your script, but make sure that it isn't sharing its 'Person Event Number' with any other OW. If that isn't the case, you could try writing an extra applymovement command each time the player changes their facing direction that changes the troublesome OW's facing direction to the correct one.

Also, you're using setflag 0x113/ 0x114 instead of the special command in your script. Finally, its msgbox 0x2 that has lock/ faceplayer automatically built-in. Here's what it says in the first post of this thread:

Spoiler:
Msgbox Numbers
Here are the many different types, taken directly from The ROM Hacking Newsletter, also located in the ROM Hacking section.
This week's tip comes from HackMew. This time, it's all about msgboxes. Below is a description, script example and in-game shot of the different msgbox types.

0x2
Spoiler:
Description:
This is the msgbox used for normal people. Using this type means that you don't need to use the lock, faceplayer or release commands.

Script:
#dynamic 0x800000


#org @start
msgbox @hello 0x2
end

#org @hello
= Hello, my name is dshayabusa.


0x3
Spoiler:
Description:
Used for signs etc. No lock or faceplayer effect. Only shows the sign textbox when used on an actual sign.

Script:
#dynamic 0x800000



#org @start
msgbox @sign 0x3
end

#org @sign
= You are here

0x4
Spoiler:
Description:
A normal msgbox except for the fact that it does not close. Command closeonkeypress must be used to close it. No lock or faceplayer effect.

Script:
#org @start
msgbox @hello 0x4
end

#org @hello
= Hello, my name is dshayabusa.

0x5
Spoiler:
Description:
Used for Yes/No questions. No lock or faceplayer effect.

Script:
#dynamic 0x800000


#org @start
msgbox @question 0x5
end

#org @question
= Is this statement false?

0x6
Spoiler:
Description:
Normal textbox. Has no lock or faceplayer effect.

Script:

#dynamic 0x800000

#org @start
msgbox @hello 0x6
end

#org @hello
= Hello, my name is dshayabusa.

Thanks for all the help! I've deduced that its the trainerbattle 0x1 cmd that's causing the movement... I assume that it has a faceplayer call... I figured this out by trying to turn the sprite, just to have her turn back when the @before msgbox appears for the trainerbattle.

/JASHIN/ May 8th, 2019 12:21 AM

Is there a way to compare a variable based on whether it is higher or lower than a certain number?

For example..

if 0x4011 > 20 event happens

DrFuji May 8th, 2019 6:07 AM

Quote:

Originally Posted by /JASHIN/ (Post 10015659)
Is there a way to compare a variable based on whether it is higher or lower than a certain number?

For example..

if 0x4011 > 20 event happens

You can use the 'compare' command to do that easily. Here's what your example would look like with it:

Code:

compare 0x4011 0x14
if 0x2 goto @EventHappens


The first line is pretty simple, you just write the variable you want to use and then the value that you want to compare it to. The second line is tricky if you don't know what XSE's 'if values' mean. Here's a table that diegoisawesome has on the first page:

Code:

Lower Than (0x0)
Equals (0x1)
Greater Than (0x2)
Lower than or Equal to (0x3)
Greater than or Equal to (0x4)
Not exactly equal to (0x5)


Since I'm using 'if 0x2', the script will only move onto @EventHappens if 0x4011 is greater than 20 (0x14). Hopefully that all makes sense.

/JASHIN/ May 8th, 2019 8:20 AM

Beautiful!

Thank you very much!

/JASHIN/ June 6th, 2019 3:41 PM

Hi, I'm trying to execute a code that allows me to evolve a certain pokemon in my party (I'm actually form changing it, but I have inserted a routine to skip the evolution sequence. The issue I'm having is forcing the game to specifically ONLY evolve the particular pokemon.

So far I have this code: (note that my issue isn't with the routine, but rather with making the game understand that I picked A certain pokemon and any other pokemon will not be allowed to evolve)
Spoiler:

#org @start
lock
msgbox @talk1 0x6 "If bulbasaur is in your party its going to evolve"
setvar 0x8004 0x1
special2 0x800D 0x17C
compare 0x800D 0x1
if 0x1 goto @have
end

#org @have
From here is where I'm having issues. I need the game to give me bulbasaur's slot number in the party so I can execute this code:
Setvar 0x8001 0x(whichever slot Bubasaur is in)
callasm 0x900000 (This will evolve the pokemon in that slot.)
end


So, yeah.. Basically I need the game to check if I have the pokemon, find which slot that pokemon is in and execute that ASM to evolve it... Does anyone have any information? It would be greatly appreciated. BTW I got the ASM from here if that helps..

https://www.pokecommunity.com/showpost.php?p=8513813&postcount=39

MobAcc June 7th, 2019 3:42 AM

I have a question. If I use special 0x9f to select a pokemon. How would I execute a script to basically say if the chosen pokemon is (let's say pikachu) perform this script. If it's not pikachu perform this script. Basically I'm wondering if special 0x9f stores the index pokemon of the pokemon u chose and if I can use a compare to set up 2 scenarios. I'm wondering which var it would load the index number to

MobAcc June 7th, 2019 5:58 AM

Or better yet is there a way to script an event so that a certain pokemon MUST be the 1st pokemon in your party to proceed ? Like basically I want to put a pokemon at the front of your party and have a guy stop you unless that pokemon is the first one in your party. It's really important that it's the first one in your slot.

SupKids June 25th, 2019 12:57 PM

Is there a way to prevent you from stepping on a tile unless you have at least one Pokémon? It's supposed to be like when Professor Oak stops you from going on route 1 in Fire Red/Leaf Green.

Avara June 26th, 2019 12:32 AM

Quote:

Originally Posted by SupKids (Post 10036830)
Is there a way to prevent you from stepping on a tile unless you have at least one Pokémon? It's supposed to be like when Professor Oak stops you from going on route 1 in Fire Red/Leaf Green.

You could use a level script triggered in the overworld for that (the green "S" tiles). Diego's covered how these work in this tutorial already, alternatively there's this post. You could use that in combination with a flag check for if the Pokemon menu has been activated (flag 0x828 for FR, 0x860 for EM) or the countpokemon command. Hope that helps!

SupKids June 27th, 2019 6:55 PM

Thanks for your response! Your post helped me understand variables better, but I just ended up using flags like you suggested since the variables seemed to reset once I left the map and came back.

Aelthir October 1st, 2019 2:39 PM

Very handy tutorial! I'm just getting started with scripting, and I'm sure I will be jumping back for keywords and values often!

Nice-kun March 31st, 2020 11:43 PM

is it possible to combine apply movement script and trainer battle script? how?

Pyxal April 4th, 2020 2:03 PM

Quote:

Originally Posted by PkmonTitanium (Post 10141979)
is it possible to combine apply movement script and trainer battle script? how?

This is fairly simple. Just slam dunk a trainer battle command in a script where you want it to be. Do look at the main page of the thread. You will find alot of answers there.

Anti-HyperLink July 11th, 2020 3:46 PM

Should I risk flags 200+ unless they're listed or should I follow the advice in the XSE guide and use flags above 1000? Which is more accurate?

Pyxal July 14th, 2020 11:45 PM

Quote:

Originally Posted by Anti-HyperLink (Post 10180813)
Should I risk flags 200+ unless they're listed or should I follow the advice in the XSE guide and use flags above 1000? Which is more accurate?

Flags over 0x1000 are actually used. They are reserved for trainer flags. 200-2FF is preferable.

Anti-HyperLink July 16th, 2020 1:45 PM

Quote:

Originally Posted by PokeChu (Post 10181811)
Flags over 0x1000 are actually used. They are reserved for trainer flags. 200-2FF is preferable.

Thanks!

Pyxal July 19th, 2020 8:18 AM

There seem to be some of the applymovement commands missing in the documentation. They are listed below.
FireRed [source]:
Spoiler:
#raw 0x45 = Walk in place. Direction of walking depends on which way you were facing at time of activation. Loops forever
#raw 0x5A = Look Down
#raw 0x5B = Run in place, downwards. Loops forever. Uses running frames, as opposed to walking frames.
#raw 0x5C = Seemingly Absolutely nothing
#raw 0x5D = Also absolutely nothing
#raw 0x5E = Again, Nothing
#raw 0x5F = Nothing once more.
#raw 0x67 = Nothing.
#raw 0x68 = Face up, and locks movement.
#raw 0x69 = Face up, and locks movement. When used for cut trees and smash rocks, it plays the destruction animation.
#raw 0x6A = Nothing.
#raw 0x6B = Nothing.
#raw 0x6C = Causes person not to flip while moving right, aka Moonwalking.
#raw 0x6D = Nothing.
#raw 0x6E = Walks one tile down, but takes two steps.
#raw 0x6F = Walks one tile down, but takes two steps.
#raw 0x70 = Faces right, then down, very fast.
#raw 0x71 = Faces down, then up, very fast.
#raw 0x72 = Faces up, then left, very fast.
#raw 0x73 = Faces left, then right, very fast.
#raw 0x74 = Runs in place downward, uses running frames, as opposed to normal
walking frames. Loops forever.
#raw 0x75 = Runs in place upward, uses running frames, as opposed to normal
walking frames. Loops forever.
#raw 0x76 = Runs in place left, uses running frames, as opposed to normal
walking frames. Loops forever.
#raw 0x77 = Runs in place right, uses running frames, as opposed to normal walking frames. Loops forever.
#raw 0x78 = Player looks diagonally left and right, twice.
#raw 0x79 = Faces down, Locks movement.
#raw 0x7A = Faces up, and locks movement.
#raw 0x7B = Faces left, locks movement.
#raw 0x7C = Runs and jumps in place, facing down. Uses running frames.
#raw 0x7D = Runs and jumps in place, facing up. Uses running frames
#raw 0x7E = Runs and jumps in place, facing left. Uses running frames.
#raw 0x7F = Runs and jumps in place, facing right. Uses running frames.
#raw 0x80 = Runs and jumps down. Uses running frames.
#raw 0x81 = Runs and jumps up. Uses running frames.
#raw 0x82 = Runs and jumps left. Uses running frames.
#raw 0x83 = Runs and jumps right. Uses running frames.
#raw 0x84 = Runs and jumps down two tiles. Uses running frames.
#raw 0x85 = Runs and jumps up two tiles. Uses running frames.
#raw 0x86 = Runs and jumps left two tiles. Uses running frames.
#raw 0x87 = Runs and jumps right two tiles. uses running frames.
#raw 0x88 = Step on the spot right, then face down.
#raw 0x89 = Step on the spot down, then face up.
#raw 0x8A = Step on the spot up, then face left
#raw 0x8B = Step on the spot left, then face right
#raw 0x8C = Run down. Uses running frames
#raw 0x8D = Run up. Uses running frames
#raw 0x8E = Run left. Uses running frames
#raw 0x8F = Run right. Uses running frames
#raw 0x90 = Slide down, facing right, then faces down.
#raw 0x91 = Slide up, facing down, then faces up.
#raw 0x92 = Slides left, facing up, then faces left.
#raw 0x93 = Slides right, facing left, then faces right.
#raw 0x94 = Spins down. Faces down when completed.
#raw 0x95 = Spins up. Faces up when completed.
#raw 0x96 = Spins left. Faces left when completed.
#raw 0x97 = Spins right. Faces left when completed.
#raw 0x98 = Runs downward, using running frames. Loops forever.
#raw 0x99 = Runs downward in place, and jumps. Repeats once.
#raw 0x9A = Runs downward in place, swaying from side to side slighty. Uses running frames.
#raw 0x9B = Walks downward VERY slowly, taking ten steps to move one tile.
#raw 0x9C = Walks upward VERY slowly.
#raw 0x9D = Walks left VERY slowly.
#raw 0x9E = Walks right VERY slowly.
#raw 0x9F = Looks diagonaly left and right, twice, then faces the same way you started facing.
#raw 0xA0 = Slides down one tile.
#raw 0xA1 = Slides up one tile.
#raw 0xA2 = Slides left one tile.
#raw 0xA3 = Slides right one tile.
#raw 0xA4 = Flies up off the screen, and disappears.
#raw 0xA5 = Flies down from top of screen, and reappears.
#raw 0xA6 = Runs very fast, and jumps down one tile
#raw 0xA7 = Runs very fast, and jumps up one tile
#raw 0xA8 = Runs very fast, and jumps left one tile
#raw 0xA9 = Runs very fast, and jumps right one tile
#raw 0xAA through #raw 0xFD either lock or crash the game.

Emerald [source]:
Spoiler:
#raw 0x4F - Player runs in place, facing down doesn't seem to stop, even with 0xFE after.
#raw 0x50 - #raw 0x53 = Nothing.
#raw 0x5A and 0x5B = player faces up, 0xFE doesn't cancel the effects
#raw 0x5E = After it finishes when you walk right, it uses the walk left sprite.
#raw 0x68 = same as 0x4F
#raw 0x69 = same, but runs facing up instead
#raw 0x6A = same, but runs facing left instead
#raw 0x6B = same, but runs facing right instead
#raw 0x6C = seems to be walking in place, facing down
#raw 0x6D = seems to be walking in place, facing up
#raw 0x6E = seems to be walking in place, facing left
#raw 0x6F = seems to be walking in place, facing right
#raw 0x9B = player starts flying and does something cool http://imgur.com/qhLqOel
#raw 0x5F = cancels the effect of 0x5E

Momoro November 2nd, 2020 12:55 PM

Hi!

I read your entire tutorial on XSE scripting, and now I know the professional basics.

I'm particularly fond of your givepokemon script example (the one that gives you a Charmander), and I have a question about it:

How do I make the Pokemon to be given Shiny? If I were to put some kind of post-game event for a shiny Pokemon, how would I change your givepokemon script to also make the given Pokemon shiny?

That's really the only question I have :D

Thanks for this really, really big tutorial!

Momoro November 3rd, 2020 11:13 PM

Umm, problem with the Charmander givepokemon script?

If the player already has a Pokemon, it just skips to How's my charmander doing?

Can someone help? Thanks :)

Meister_anon~Master_o f_None January 3rd, 2021 5:38 PM

Quote:

Originally Posted by Momoro (Post 10226934)
Umm, problem with the Charmander givepokemon script?

If the player already has a Pokemon, it just skips to How's my charmander doing?

Can someone help? Thanks :)

If the pokemon you have is the charmander it gave you, then that's how the script is supposed to work, to not give you repeat pokemon.

If you want it to give you unlimited charmanders you'd have to remove the flag check and flag set, but that's not that great of a mechanic unless its for a nuzlocke using uncatchable pokemon or something.

Momoro February 14th, 2021 12:53 AM

Quote:

Originally Posted by Meister_anon~Master_o f_None (Post 10255395)
If the pokemon you have is the charmander it gave you, then that's how the script is supposed to work, to not give you repeat pokemon.

If you want it to give you unlimited charmanders you'd have to remove the flag check and flag set, but that's not that great of a mechanic unless its for a nuzlocke using uncatchable pokemon or something.

The problem is: if you already have a Pokemon, even if you didn't yet receive the Charmander, the How's my charmander doing? script plays.

Meister_anon~Master_o f_None February 14th, 2021 4:26 PM

Quote:

Originally Posted by Momoro (Post 10282511)
The problem is: if you already have a Pokemon, even if you didn't yet receive the Charmander, the How's my charmander doing? script plays.

Ok so I haven't seen your code but I'm making 2 assumptions here, 1st that you wrote this script yourself, and 2nd (based on the first) that somehow you used the wrong check flag, and the game is checking the flag that sets the pokemon menu icon, instead of a unique flag for the script.

Luckily I'm working on an ingame trade script that needed to use that flag so I know the number.

The flag for the pokemon menu is 0x828. If that's what you have that's your problem.

But using that flag is a good way of preventing someone from accessing the trade without having a pokemon, not completely necessary depending on where the script npc is, but a good rule of thumb. So using your own discretion you can either delete the checks and ifs involving that flag.

Or you can take a look at how I did mine, to work around it, as your problem could also be the if statement after.


checkflag 0x828
if 0x0 goto 0x871A43E

So here its checking the flag to see if you have received a pokemon. (since the flag gets set when you receive your starter.
then my if statement is says, if the flag isn't set go here. That's how it should be.

Now if you had 0x1 instead of 0x0, in that case if you had pokemon it would skip the rest of your script and go to the pointer message and end.

In the case above it only continues through your script when the if is set to 0x0.


So try those options.

either remove checkflag 0x828, and the if statement below it.

or make sure its used correctly and the below if, is 0x0 and not 0x1.

Hope that does it for you.

Momoro February 15th, 2021 3:54 PM

Quote:

Originally Posted by Meister_anon~Master_o f_None (Post 10282787)
Ok so I haven't seen your code but I'm making 2 assumptions here, 1st that you wrote this script yourself, and 2nd (based on the first) that somehow you used the wrong check flag, and the game is checking the flag that sets the pokemon menu icon, instead of a unique flag for the script.

Luckily I'm working on an ingame trade script that needed to use that flag so I know the number.

The flag for the pokemon menu is 0x828. If that's what you have that's your problem.

But using that flag is a good way of preventing someone from accessing the trade without having a pokemon, not completely necessary depending on where the script npc is, but a good rule of thumb. So using your own discretion you can either delete the checks and ifs involving that flag.

Or you can take a look at how I did mine, to work around it, as your problem could also be the if statement after.


checkflag 0x828
if 0x0 goto 0x871A43E

So here its checking the flag to see if you have received a pokemon. (since the flag gets set when you receive your starter.
then my if statement is says, if the flag isn't set go here. That's how it should be.

Now if you had 0x1 instead of 0x0, in that case if you had pokemon it would skip the rest of your script and go to the pointer message and end.

In the case above it only continues through your script when the if is set to 0x0.


So try those options.

either remove checkflag 0x828, and the if statement below it.

or make sure its used correctly and the below if, is 0x0 and not 0x1.

Hope that does it for you.

Thanks! It works now :D I did accidentally use the 0x828 checkflag 😳

Thanks again!

Meister_anon~Master_o f_None February 15th, 2021 4:19 PM

Quote:

Originally Posted by Momoro (Post 10283615)
Thanks! It works now :D I did accidentally use the 0x828 checkflag 😳

Thanks again!

:D Awesome! glad I was able to help.

Funny name May 24th, 2021 4:41 PM

Great post! I have some trouble compilating a trainerbattle script...

Do you guys know how to write an script where you repeat a certain battle after beating the elite 4, as if it was a reset?

ChrisPlayGame August 7th, 2022 6:32 PM

When I use this script on a script tile in Advance map, It freezes my game and the music continues playing:

#dynamic 0x482166

#org @start
lock
msgbox @1 0x6
applymovement 1 @3s
waitmovement 1
pause 0x20
msgbox @2 0x2
applymovement 1 @4s
waitmovement 1
release
end

#org @3s
#raw 0x01
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0xFE

#org @4s
#raw 0x00
#raw 0x08
#raw 0x08
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x09
#raw 0xFE

#org @1
= Hey you!

#org @2
= It doesn't look like you've ever been\n here before\pLet me welcome you\pWelcome to Central Glitch!\pAlso known as Mystery town!\pSay... It doesn't look like you're from\n the glitch dimension at all\pYou must be from the normal world\pHow did you get here?\p...\pHmm... you say you fought a trainer\n named Aub and you got sent here?\pInteresting...\pAub was a citizen of this town.\pOne morning, he was nowhere to be\n found!\pBut who would've ever thought he\n would be in the normal world?\pWhen you are in the glitch dimension,\p You can never go back to the normal\n world.\pThat also goes for people who live\n here.\pThat means you are stuck here in\n this dimension forever!\pDont worry! I'm sure you can find\n a way out like Aub did!\pCome to my house if you need me!

There was a part in the tutorial telling me how to fix it but its blank


All times are GMT -8. The time now is 8:11 PM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.