Script Help Thread (DO NOT REQUEST SCRIPTS) Page 326

Started by HackMew December 20th, 2008 5:10 AM
  • 625760 views
  • 9682 replies

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,771 posts
10.5 Years
hey guys im newer too scripting, but i have the basics down. im having trouble with a lengthy script im trying to write that gives you a pokemon depending on your personality types all yes/no questions please correct my mistakes and tell me what i did wrong here i really appreciate it.

Spoiler:
#dynamic 0x9C2A2B

#org @start
lock
faceplayer
checkflag 0x860
if 0x1 goto @done
msgbox @question 0x5
compare LASTRESULT 0x1
if 0x1 goto @giveduskull
msgbox @question2 0x5
compare LASTRESULT 0x1
if 0x1 goto @givechickorita
msgbox @question3 0x5
compare LASTRESULT 0x1
if 0x1 goto @givesandshrew
msgbox @question4 0x5
compare LASTRESULT 0x1
if 0x1 goto @givewurmple
msgbox @question5 0x5
compare LASTRESULT 0x1
if 0x1 goto @givepichu
msgbox @question6 0x5
compare LASTRESULT 0x1
if 0x1 goto @givevulpix
msgbox @question7 0x5
compare LASTRESULT 0x1
if 0x1 goto @giveroselia
msgbox @question8 0x5
compare LASTRESULT 0x1
if 0x1 goto @givepoliwag
msgbox @chandler 0x6
release
end

#org @done
msgbox @goaway 0x6
release
end

#org @chandler
msgbox @talk0 0x6
givepokemon 0x168 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @damnkid 0x06
waitfanfare
setflag 0x860
release
end

#org @talk0
= Okay so you are clearly indecisive\nand cannot make up your mind\lhowever we anticipated this... here\lis you ****** pokemon.

#org @damnkid
= Have fun \v\h01 ... (Chandler)

#org @goaway
= Damn Kid ! You need to get a life\nbefore I decide to end yours!

#org @question
= Hello \v\h01...\nI have been expecting you...\lI have a few Questions please\lanswer them honestly,\lAre you Mischivous?

#org @giveduskull
msgbox @talk1 0x6
givepokemon 0x169 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @recievedduskull 0x6
waitfanfare
setflag 0x860
release
end

#org @talk1
= I You and this little Pokemon have\nan attatchment beyond words...\ldefend it with your life...

#org @recievedduskull
= You Recieved a DUSKULL !

#org @question2
= Are you Nice?

#org @givechickorita
msgbox @talk2 0x6
givepokemon 0x98 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @recievedchickorita 0x6
waitfanfare
setflag 0x860
release
end

#org @talk2
= I You and this little Pokemon have\nan attatchment beyond words...\ldefend it with your life...

#org @recievedchickorita
= You Recieved a CHICKORITA !

#org @question3
= Are you Shy?

#org @givesandshrew
msgbox @talk3 0x6
givepokemon 0x1B 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @recievedsandshrew 0x6
waitfanfare
setflag 0x860
release
end

#org @talk3
= I You and this little Pokemon have\nan attatchment beyond words...\ldefend it with your life...

#org @recievedsandshrew
= You Recieved a SANDSHREW !

#org @question4
= Are you Insecure?

#org @givewurmple
msgbox @talk4 0x6
givepokemon 0x122 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @recievedwurmple 0x6
waitfanfare
release
end

#org @talk4
= I You and this little Pokemon have\nan attatchment beyond words...\ldefend it with your life...

#org @recievedwurmple
= You Recieved a WURMPLE !

#org @question5
= Are you Eccentric?

#org @givepichu
msgbox @talk5 0x6
givepokemon 0xAC 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @recievedpichu 0x6
waitfanfare
release
end

#org @talk5
= I You and this little Pokemon have\nan attatchment beyond words...\ldefend it with your life...

#org @recievedpichu
= You Recieved a PICHU !

#org @question6
= Are you Hot-Tempered?

#org @givevulpix
msgbox @talk6 0x6
givepokemon 0x25 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @recievedvulpix 0x6
waitfanfare
release
end

#org @talk6
= I You and this little Pokemon have\nan attatchment beyond words...\ldefend it with your life...

#org @recievedvulpix
= You Recieved a VULPIX !

#org @question7
= Are you Self-Centered?

#org @giveroselia
msgbox @talk7 0x06
givepokemon 0x16B 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @recievedroselia 0x6
waitfanfare
release
end

#org @talk7
= I You and this little Pokemon have\nan attatchment beyond words...\ldefend it with your life...

#org @recievedroselia
= You Recieved a ROSELIA !

#org @givepoliwag
msgbox @talk8 0x6
givepokemon 0x3C 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @recievedpoliwag 0x6
waitfanfare
release
end

#org @talk8
= I You and this little Pokemon have\nan attatchment beyond words...\ldefend it with your life...

#org @recievedpoliwag
= You Recieved a POLIWAG !
Just scrolling through, I honestly don't see a problem, but I might have missed something. Can you explain what happends when the script runs?

Paired with Simba

Shadowraze

ur mum

Age 24
Non-binary
ur mum
Seen November 24th, 2022
Posted October 16th, 2016
794 posts
10.1 Years
hey guys

i just want to know how to write a map script ..
I mean like when we play pok. emerald the first thing that happens is we get out of the truck and mom take us inside home.. how can do things like that
i have searched but couldn't get it.
Pls help
Making a level script is pretty easy. :3

Try this tutorial of mine scroll down to the very last part that says level script and try to make one there. :) http://www.pokecommunity.com/showthread.php?t=279345

If you don't get it in my tutorial try cooley's tutorial on level scripts. http://www.pokecommunity.com/showthread.php?t=141650

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,771 posts
10.5 Years
Can anyone help me with my script I posted I really can't figure out what I did wrong :/
I can't either. What XSE version are you using?

Paired with Simba

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,771 posts
10.5 Years
I think 1.0 I feel like I wrote everything correct
1.0 will not accept the msgbox syntax you are using:

V1.0 messages are:

Msgbox @msg
callstd 0x[type]

V1.1.1:

Msgbox @msg 0x[type]


Upgrade to 1.1.1 and your script should work.

Paired with Simba
Male
Seen February 28th, 2016
Posted May 24th, 2013
11 posts
13.6 Years
can someone help me with this script because there problem is when I get the pokemon in the pokeball the pokeball doesn't disappear, it only disappear when I exit the house or enter a new map.can someone help me to disappear after I get the pokemon. thanks



POKEMON IN A POKEBALL SCRIPT
#Dynamic 0x80000
#org @start
lock
faceplayer
checkflag 0x404
msgbox @msg 0x02
if 0x0 goto @give
release
end
#org @give
lock
faceplayer
msgbox @msg2 0x02
msgbox @textdata 0x5
compare LASTRESULT 0x0
if 0x1 goto 0x8AD9557
waitkeypress
hidepokepic
setvar 0x8004 0x4
countpokemon
compare LASTRESULT 0x6
if 0x1 call @fll
givepokemon 0xEF 0x5 0x0 0x0 0x0 0x0
fanfare 0x172
msgbox @given 0x02
waitfanfare
waitkeypress
setflag 0x404
release
end
#org @hold
waitkeypress
hidepokepic
setvar 0x8004 0x4
lock
faceplayer
msgbox @msg 0x02
release
end
#org @fll
lock
faceplayer
msgbox @full 0x02
release
end
#org @msg
= This POKéBALL holds a POKéMON.
#org @msg2
= This POKéBALL seems to have\na POKéMON inside.
#org @textdata
= Want to take the ELEKID?
#org @given
= \v\h01\ received an ELEKID.
#org @full
= You must have a free space in\nyour party to take the Pokémon.

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,771 posts
10.5 Years
can someone help me with this script because there problem is when I get the pokemon in the pokeball the pokeball doesn't disappear, it only disappear when I exit the house or enter a new map.can someone help me to disappear after I get the pokemon. thanks



POKEMON IN A POKEBALL SCRIPT
#Dynamic 0x80000
#org @start
lock
faceplayer
checkflag 0x404
msgbox @msg 0x02
if 0x0 goto @give
release
end
#org @give
lock
faceplayer
msgbox @msg2 0x02
msgbox @textdata 0x5
compare LASTRESULT 0x0
if 0x1 goto 0x8AD9557
waitkeypress
hidepokepic
setvar 0x8004 0x4
countpokemon
compare LASTRESULT 0x6
if 0x1 call @fll
givepokemon 0xEF 0x5 0x0 0x0 0x0 0x0
fanfare 0x172
msgbox @given 0x02
waitfanfare
waitkeypress
setflag 0x404
release
end
#org @hold
waitkeypress
hidepokepic
setvar 0x8004 0x4
lock
faceplayer
msgbox @msg 0x02
release
end
#org @fll
lock
faceplayer
msgbox @full 0x02
release
end
#org @msg
= This POKéBALL holds a POKéMON.
#org @msg2
= This POKéBALL seems to have\na POKéMON inside.
#org @textdata
= Want to take the ELEKID?
#org @given
= \v\h01\ received an ELEKID.
#org @full
= You must have a free space in\nyour party to take the Pokémon.
Why are you hiding a pokepic? You never used the showpokepic command. If you want the sprite to disappear, use hidesprite 0x[event#] after you set the flag which was put in the pokeball's person ID (404?).

Paired with Simba
Male
Seen February 28th, 2016
Posted May 24th, 2013
11 posts
13.6 Years
Why are you hiding a pokepic? You never used the showpokepic command. If you want the sprite to disappear, use hidesprite 0x[event#] after you set the flag which was put in the pokeball's person ID (404?).

ah ok i'll try it thanks. and I will remove the hidepokepic command

LaDestitute

Razor Sharp

Male
West Coast, USA
Seen February 27th, 2017
Posted April 23rd, 2015
84 posts
10.1 Years
I have very little experience with XSE, and I'm still learning. I'm putting together one of those "You don't have any Pokemon, you can't pass" sort of scripts, but I'm having problems. He moves to the player, and does the first part of his movement (including the exclamation mark), and moves to the player, but he doesn't do the rest.

Here's how I want it to go:
1. Player steps on script tile.
2. Depending on whether they stepped on the middle, right, or left script tile, the NPC will move to match their position and face them.
3. NPC does a exclamation mark and quickly moves to be right in front of the player, with no tiles between them.
4. NPC says "I can't let you pass because you don't have any Pokemon. It's not safe to go out without at least one."
5. NPC moves back to original position.
6. Script repeats if player tries again, but nothing will happen if they meet the conditions to pass.

#dynamic 0x456734
#org @start
countpokemon
compare 0x800D 0x1
if 0x1 goto @continue
goto @nopass
end

#org @continue
end

#org @nopass
applymovement 0x1 @move
end

#org @move
lock
#raw 0x62
#raw 0x1D
#raw 0x1D
#raw 0xFE
msgbox @1 0x6
#raw 0x11
#raw 0x11
#raw 0xFE
waitmovement 0x1
end

#org @1
= I can't let you pass because you\ndon't have any Pokemon. It's \nnot safe to go out without at least one.
end

#org @move1
#raw 0x10
#raw 0xFE
waitmovement 0x1
release
end

Spherical Ice

Age 25
Leicester, UK
Seen 21 Hours Ago
Posted February 20th, 2022
5,251 posts
15.5 Years
I have very little experience with XSE, and I'm still learning. I'm putting together one of those "You don't have any Pokemon, you can't pass" sort of scripts, but I'm having problems. He moves to the player, and does the first part of his movement (including the exclamation mark), and moves to the player, but he doesn't do the rest.

Here's how I want it to go:
1. Player steps on script tile.
2. Depending on whether they stepped on the middle, right, or left script tile, the NPC will move to match their position and face them.
3. NPC does a exclamation mark and quickly moves to be right in front of the player, with no tiles between them.
4. NPC says "I can't let you pass because you don't have any Pokemon. It's not safe to go out without at least one."
5. NPC moves back to original position.
6. Script repeats if player tries again, but nothing will happen if they meet the conditions to pass.

#dynamic 0x456734
#org @start
countpokemon
compare 0x800D 0x1
if 0x1 goto @continue
goto @nopass
end

#org @continue
end

#org @nopass
applymovement 0x1 @move
end

#org @move
lock
#raw 0x62
#raw 0x1D
#raw 0x1D
#raw 0xFE
msgbox @1 0x6
#raw 0x11
#raw 0x11
#raw 0xFE
waitmovement 0x1
end

#org @1
= I can't let you pass because you\ndon't have any Pokemon. It's not safe to go out without at least one.
end

#org @move1
#raw 0x10
#raw 0xFE
waitmovement 0x1
release
end
Use the dynamic offset of 0x800000, not some arbitrary number. XSE will automatically compile it to the correct place and you won't corrupt your ROM that way.

#dynamic 0x800000

#org @start
countpokemon
compare 0x800D 0x1
if 0x1 goto @continue
goto @nopass // I removed the "end" command, it isn't necessary.

#org @continue
release
end

#org @nopass
applymovement 0x1 @move1
waitmovement 0x0
msgbox @1 0x6
applymovement 0x1 @move2
waitmovement 0x0
release
end

#org @move1
#raw 0x62 // You don't need to add "lock".
#raw 0x1D
#raw 0x1D
#raw 0xFE // You cant have commands halfway through a movement command. You can only dictate which movement will happen in this sections.

#org @move2
#raw 0x11
#raw 0x11
#raw 0xFE

#org @1 // Similarly, text strings can only have text, not extra commands.
= I can't let you pass because you\ndon't have any Pokémon.\pIt's not safe to go out without\nat least one. // Use the Text Adjuster (Ctrl + T) so the text doesn't run off the screen.

LaDestitute

Razor Sharp

Male
West Coast, USA
Seen February 27th, 2017
Posted April 23rd, 2015
84 posts
10.1 Years
I'm using a separate fresh firered rom to test my scripts, so I don't have to worry about fubaring my own project.

Are you sure you didn't make a mistake or something in the edited version? When I step on the script events now, either I get a game freeze or nothing happens. Yes, I'm compiling to the fresh rom, and using the offset 800000 for the script events.

Spherical Ice

Age 25
Leicester, UK
Seen 21 Hours Ago
Posted February 20th, 2022
5,251 posts
15.5 Years
You need to set the Unknown on the Script tile to 0300 (or just 03 in 1.9.5) in Advance Map and the Var number to an unused variable - I tend to use 4050.

LaDestitute

Razor Sharp

Male
West Coast, USA
Seen February 27th, 2017
Posted April 23rd, 2015
84 posts
10.1 Years
You need to set the Unknown on the Script tile to 0300 (or just 03 in 1.9.5) in Advance Map and the Var number to an unused variable - I tend to use 4050.
Okay, thanks, it worked fine. :D

Although, some questions.
What does the Unknown value do?
How do I get the NPC to actually move to the player's front position, say if they step on the left or right script event instead of the middle one? It looks a bit odd with the NPC moving to the middle, otherwise. I could just have one script event, though, I guess. That works too, I'm just curious.

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,771 posts
10.5 Years
Okay, thanks, it worked fine. :D

Although, some questions.
What does the Unknown value do?
How do I get the NPC to actually move to the player's front position, say if they step on the left or right script event instead of the middle one? It looks a bit odd with the NPC moving to the middle, otherwise. I could just have one script event, though, I guess. That works too, I'm just curious.
The unknown is just a staple. I never use it and things usually work fine, but it is something that Game Freak used on theirs as far as I know.

There is a command called playerfacing(?). That will get the players direction and you can run different scripts based on it or you could force the player to look in the direction of the person that is moving.

Paired with Simba

hinkage

Everyone currently in an argument with this member: I really suggest you stop.

Seen October 3rd, 2021
Posted October 30th, 2020
378 posts
12.7 Years
Okay, thanks, it worked fine. :D

Although, some questions.
What does the Unknown value do?
How do I get the NPC to actually move to the player's front position, say if they step on the left or right script event instead of the middle one? It looks a bit odd with the NPC moving to the middle, otherwise. I could just have one script event, though, I guess. That works too, I'm just curious.
If you have multiple scriptboxes and want the NPC to walk up to you... uh, it's just easier to show through example:

Spoiler:
#org @set
lock
setvar 0x4001 0xX (1 for first scriptbox, 2 for second, etc. this is a temp var, it resets after leaving the map.)
jump @main (your main script)

#org @main
compare 0x4001 0x1
if == call @comp1 (if 0x1 is set then call this. "comp1" stands for "comparison 1")
compare 0x4001 0x2
if == call @comp2 (if 0x2 is set...)
compare 0x4001 0x3
if == call @comp3 (if 0x3 is set... and on and on, for each scriptbox you have)
pauseevent 0x0
--your script ---
release
end

#org @comp1
applymovement 0xX @move1 (should move sprite X to put sprite in front of player according to the first scriptbox -- you have to define @move1, @move2, @move3, etc., yourself)
return

#org @comp2
applymovement 0xX @move2 (should move sprite X to put sprite in front of player according to the second scriptbox)
return

#org @comp3
applymovement 0xX @move3 (same as other two)
return


Check out your rival's scripts. They do it too, and it might be easier for you to understand if you actually see it in action.
(ღ˘⌣˘ღ)

LaDestitute

Razor Sharp

Male
West Coast, USA
Seen February 27th, 2017
Posted April 23rd, 2015
84 posts
10.1 Years
Another question, how do I make it so with the givepokemon command, have the Pokemon given have a specific OT and IDno (or is the IDno randomly generated? Not sure) and/or nickname?

Edit - Overheat, please use the search function next time, before asking.
To award the national dex, use this:
special 0x16F

LaDestitute

Razor Sharp

Male
West Coast, USA
Seen February 27th, 2017
Posted April 23rd, 2015
84 posts
10.1 Years
Can someone proof-check this for me? I'm using a compare variable to set different NPC movement depending on variable value (with the three script events sharing the same variable, but different values) but it's not working as I thought.

#dynamic 0x800000

#org @start
countpokemon
compare 0x800D 0x1
if 0x1 goto @continue
goto @nopokemon

#org @nopokemon
compare 0x4000 0x1
if 0x1 goto @nopass0
if 0x2 goto @nopass1
if 0x3 goto @nopass2

#org @continue
release
end

#org @nopass0
applymovement 0x1 @move3
waitmovement 0x0
msgbox @1 0x6
applymovement 0x1 @move4
waitmovement 0x0
release
setflag 0x200
end

#org @nopass1
applymovement 0x1 @move1
waitmovement 0x0
msgbox @1 0x6
applymovement 0x1 @move2
waitmovement 0x0
release
setflag 0x200
end

#org @nopass2
applymovement 0x1 @move5
waitmovement 0x0
msgbox @1 0x6
applymovement 0x1 @move6
waitmovement 0x0
release
setflag 0x200
end

#org @move1
#raw 0x62 
#raw 0x1D
#raw 0x1D
#raw 0xFE

#org @move2
#raw 0x11
#raw 0x11
#raw 0xFE

#org @move3
#raw 0x62 
#raw 0x0A
#raw 0x1D
#raw 0x1D
#raw 0xFE

#org @move4
#raw 0x11
#raw 0x11
#raw 0x0B
#raw 0xFE

#org @move5
#raw 0x62 
#raw 0x0B
#raw 0x1D
#raw 0x1D
#raw 0xFE

#org @move6
#raw 0x11
#raw 0x11
#raw 0x0A
#raw 0xFE

#org @1
= I can't let you pass because you\ndon't have any Pokémon.\pIt's not safe to go out without\nat least one.