• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.
So I hopefully have a simple problem. I'm using movesprite2 to move a sprite on the other side of the map out of the way at the end of an event. It works just fine, but it moves back once you leave the map...I thought movesprite2 was permanent? How do I get it to stay put?

movesprite2 does NOT work. I tried using it but to no avail. Got an answer from others that it doesn't work also. The best thing you can do is just do a setflag on the guy that's walking away or whatever and a clearflag on the guy you want standing there.

So let's say for a previous script, best results are for before you enter a city as you are entering to set the setflag so that the guy you want after the event to appear, just clearflag him.

Script 1:
#org @event
lock
faceplayer
msgbox @talkto 0x6
setflag 0x1100 - make sure the guy AFTER the event has this flag in A-Map
release
end

#org @talkto
= Go inside this town and talk to Ralph.

So you go talk to Ralph inside

Script 2
#org @event
lock
faceplayer
msgbox @yo 0x6
applymovement 0x# @bye
waitmovement 0x0
hidesprite 0x# - though you set the flag on the next command, it doesn't take effect right away so you have to hide the sprite
setflag 0x1101 - make sure the guy DURING the event has this flag in A-Map
clearflag 0x1100 - this clears the flag of the guy AFTER the event so that he will appear once you go to him
showsprite 0x## - for safety you can also do a showsprite of the guy AFTER the event so that when you walk over there to him you know he'll be there.
release
end


hope this helped a little, this is my method of use. I know I wish movesprite2 worked too but it doesn't.
 
Dang...I was hoping I wouldn't have to resort to using two flags...I know I'll never use them all but it feels so cumbersome and wasteful, especially since I'm already doing this a couple other times at different points during the event. But thanks for your answer Pug.

EDIT: Ok more problems. I have this script as a script event with var 0x4051 var #2

'---------------
#org 0x8017C0
checkflag 0x4B1
if 0x1 goto 0x8801851
checkflag 0x4B2
if 0x1 goto 0x8801851
lock
textcolor 0x2
msgbox 0x88017EA MSG_KEEPOPEN '"Where do you thing you're\ngoing?"
closeonkeypress
applymovement MOVE_PLAYER 0x880180D
release
end

'---------------
#org 0x801851
release
end


'---------
' Strings
'---------
#org 0x8017EA
= Where do you thing you're\ngoing?


'-----------
' Movements
'-----------
#org 0x80180D
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements


It works perfectly except for one thing....the movement isn't applied. Unfortunately that allows you to leave the area, and the whole point of the script is to keep you there.
 
Last edited:
Dang...I was hoping I wouldn't have to resort to using two flags...I know I'll never use them all but it feels so cumbersome and wasteful, especially since I'm already doing this a couple other times at different points during the event. But thanks for your answer Pug.

EDIT: Ok more problems. I have this script as a script event with var 0x4051 var #2

'---------------
#org 0x8017C0
checkflag 0x4B1
if 0x1 goto 0x8801851
checkflag 0x4B2
if 0x1 goto 0x8801851
lock
textcolor 0x2
msgbox 0x88017EA MSG_KEEPOPEN '"Where do you thing you're\ngoing?"
closeonkeypress
applymovement MOVE_PLAYER 0x880180D
release
end

'---------------
#org 0x801851
release
end


'---------
' Strings
'---------
#org 0x8017EA
= Where do you thing you're\ngoing?


'-----------
' Movements
'-----------
#org 0x80180D
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements


It works perfectly except for one thing....the movement isn't applied. Unfortunately that allows you to leave the area, and the whole point of the script is to keep you there.

Did you try a waitmovement 0x0 after the applymovement?
 
Game: Pokémon Firered
Type: Person Script
Editor: XSE
Script:
Spoiler:

Screenshots and/or videos: It's pretty explanotory - I talk to the girl, she goes through some of the dialogue I gave gave her, and she then gives me a LV.100 Eevee and the Running Shoes for ****'s and giggles (the Pokémon menu doesn't show up, but I do receive an Eevee - you can see it after getting your Pokémon from Oak).

The problem is that I can't seem to trigger flags. I've used three in here - one to give me the running shoes, and two other ones to avoid having the entire script repeat itself. I can't say I've used the wrong flags, so I think the problem is with clearflag.

Help, please? :I
There's no setflag command in your script, which is why your flags aren't triggering. If there aren't any flags set, you obviously won't be able to check for them or clear them lol
 
There's no setflag command in your script, which is why your flags aren't triggering. If there aren't any flags set, you obviously won't be able to check for them or clear them lol

Yeah, I apologize. I re-read Diego's XSE tutorial, and noticed the setflag command in there. I didn't see it previously, so I thought that clearflag was the thing I needed (like, the flag has been reached, so it has been 'cleared'/passed).

Anyhow, thanks anyway. That was one heck of a silly mistake. :p

By the way, this is not my first time trying to learn some basic scripting. Previously, I got stuff like this to work. However, sometimes, when I left an area, flags seemed to reset.

I'll give a simple example: I talk to NPC and he delivers line #1. Then, when I talk to him again, he delivers #2. He will continue to deliver #2 forever. But when I would leave the area and come back, he'd deliver line #1 again, and afterwards #2.

Have you heard of this issue before? I can't remember what it was that I did different from now, where I (now) did it correctly.
 
Yeah, I apologize. I re-read Diego's XSE tutorial, and noticed the setflag command in there. I didn't see it previously, so I thought that clearflag was the thing I needed (like, the flag has been reached, so it has been 'cleared'/passed).

Anyhow, thanks anyway. That was one heck of a silly mistake. :p

By the way, this is not my first time trying to learn some basic scripting. Previously, I got stuff like this to work. However, sometimes, when I left an area, flags seemed to reset.

I'll give a simple example: I talk to NPC and he delivers line #1. Then, when I talk to him again, he delivers #2. He will continue to deliver #2 forever. But when I would leave the area and come back, he'd deliver line #1 again, and afterwards #2.

Have you heard of this issue before? I can't remember what it was that I did different from now, where I (now) did it correctly.
Do you mind sharing your script? I am by no means an expert scripter (I'm learning how to script too), but I can take a look at it and see if I can figure out what's going wrong.
 
Do you mind sharing your script? I am by no means an expert scripter (I'm learning how to script too), but I can take a look at it and see if I can figure out what's going wrong.

Oh... Well, I'm sorry. It was a while ago (that's why I'm re-learning the basics again). And I tend to not hold on to the scripts for very long. :/
 
Oh... Well, I'm sorry. It was a while ago (that's why I'm re-learning the basics again). And I tend to not hold on to the scripts for very long. :/
Hmm, then idk...Your flag could've been temporary, which would be why it reset when you left the area (like how cut trees respawn after you leave the area). But I can't tell for certain without looking at the script.
 
Hmm, then idk...Your flag could've been temporary, which would be why it reset when you left the area (like how cut trees respawn after you leave the area). But I can't tell for certain without looking at the script.

Oh hey, this one resets, too. ^^ It's flag 0x7 that resets when you leave. Do you know what determines what makes them temporary or not?

Spoiler:


Is this supposed to be something simple? Because I'm starting to find it an unbearable mess already. : p
 
I'm creating a new item on Pokémon Firered, and I'd like it to do 2 things: it lets the user go right in front of NPCs without them knowing and it reduces the user's vision as if he was in a cave without Flash.

(It is only the script part that I need some help; not the Item Making part).

I'm searching on the internet, but I cannot find any answers for the second part. As for the first part, I presume I can create a flag for my item. When I use it, the flag is active, and every trainer will have the checkflag command. If the flag is active, they don't battle me.
 
Im pretty new to this so mind me if im completely oblivious, but the hidden sprite comes back after I move. How do I make it dissapear completely?


Spoiler:
 
Oh hey, this one resets, too. ^^ It's flag 0x7 that resets when you leave. Do you know what determines what makes them temporary or not?

Spoiler:


Is this supposed to be something simple? Because I'm starting to find it an unbearable mess already. : p
My comments are in bold. It looks ok to me (I'm a beginner too though, so I can't really tell if its good or not), but I think flag 0x7 is the problem. And I don't think there is a way to determine whether a flag is temporary or not, other than going through all the scripts and manually figuring it out. (Luckily somebody already did that for you, look at this tutorial:https://www.pokecommunity.com/threads/302347)
 
Im pretty new to this so mind me if im completely oblivious, but the hidden sprite comes back after I move. How do I make it dissapear completely?


Spoiler:

You have to make the flag that you set the npc's person id

Oh hey, this one resets, too. ^^ It's flag 0x7 that resets when you leave. Do you know what determines what makes them temporary or not?

Spoiler:


Is this supposed to be something simple? Because I'm starting to find it an unbearable mess already. : p

I'm confused what are you trying to do...
 
Last edited:
Did you try a waitmovement 0x0 after the applymovement?

I just tried it, but nothing changed. The text appears, and then the script ends.

Script for reference:
Spoiler:
 
I just tried it, but nothing changed. The text appears, and then the script ends.

Script for reference:
Spoiler:

Shouldn't your lock be at the beginning of the script since it also releases when it checks the flag...

Also can you post your non-compiled script.
 
Yeah that lock was leftover from an earlier version of the script. I don't actually have a non-compiled script because I thought this was so simple I didn't need to have it backed up...let me just whip one up real quick...

Spoiler:
 
Yeah that lock was leftover from an earlier version of the script. I don't actually have a non-compiled script because I thought this was so simple I didn't need to have it backed up...let me just whip one up real quick...

Spoiler:

We usually only use KEEP_OPEN on events where the player receives a badge, a PKMN or an item from NPCs, so there really is no need for you to use KEEP_OPEN if you're just going to close it as soon as it shows up anyway...
Code:
...
textcolor 0x2
msgbox @stay [COLOR="Red"]0x6[/COLOR]
applymovement MOVE_PLAYER @up
waitmovement 0x0
...

0x6 is a normal text speech, 0x5 is a YES/NO speech, and 0x4 is the KEEP_OPEN type speech.

Aside from that, there really isn't anything wrong with your script.
 
Status
Not open for further replies.
Back
Top