• 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 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.

RainDogg54

Crown of Love
54
Posts
14
Years
I just recently started scripting so forgive me if I'm doing this completely wrong.

I'm trying to make a script that won't let the player walk pass a certain point until he gets a Pokemon.
It's just supposed to make the player move 1 space left and display a message saying you can't go into the tall grass without a Pokemon.
Code:
#org $script
lock
message $warning
$warning 1 = I shouldn't go into the tall grass without a POKEMON..
boxset 6
applymovement 0xFF $move
$move 1 ; #binary 0x02 0xFE
pausemove 0x0000
release
end
But it this script just crashes my game and I don't know why.
Can someone tell me what I'm doing wrong and help me out? Thanks in advance
 
73
Posts
14
Years
  • Seen Aug 31, 2014
Code:
#org $script
lock
message $warning
$warning 1 = I shouldn't go into the tall grass without a POKEMON..
boxset 6
applymovement 0xFF $move
$move 1 ; #binary 0x02 0xFE
pausemove 0x0000
release
end

What program are you using? I use XSE, and if you don't any my help doesn't work, sorry.

First off, things like $warning and $move should be moved down under the original script (put in #org $warning and then the message, and #org $move and then the action.)

2. Moving. After #org $move, use #raw instead of #binary. The 0x02 and 0xFE work ^^

3. Instead of pausemovement, use waitmovement.

4. If you want to wait to make them get a pokemon, you need to check the givepokemon script for a setflag code. If you're directly replacing the Oak stops you script, you'll have to dig around (or ask another question) for the flag number.

That should cover it.

Now, my question: Whats the variable or flag for Oak giving you a pokemon? If no flag or variable, how (in directions, not code) would I change it so a script like above would click off when Oak hands you a pokemon?
 

RainDogg54

Crown of Love
54
Posts
14
Years
Code:
#org $script
lock
message $warning
$warning 1 = I shouldn't go into the tall grass without a POKEMON..
boxset 6
applymovement 0xFF $move
$move 1 ; #binary 0x02 0xFE
pausemove 0x0000
release
end
What program are you using? I use XSE, and if you don't any my help doesn't work, sorry.
I use poketscript not XSE but i don't think it matters.
First off, things like $warning and $move should be moved down under the original script (put in #org $warning and then the message, and #org $move and then the action.)
Ok so do you mean I should put this?
Code:
#org $warning
message $warning
$warning 1 = I shouldn't go into the tall grass without a POKEMON..
and then do the same with $move?

Sorry I'm very new at this I'm still learning.

And I'm going to add the checkflag after I get this part of the script working
 

cooley

///Keepin' it simple
1,148
Posts
17
Years
Code:
Now, my question: Whats the variable or flag for Oak giving you a pokemon? If no flag or variable, how (in directions, not code) would I change it so a script like above would click off when Oak hands you a pokemon?[/QUOTE]
[FONT=Segoe UI]The Flag is 0x828. That activates the Pokémon menu when you are given a Pokémon. So you would use it like this:

[I]givepokemon PKMN_CHARMANDER 0x5 ITEM_ORANBERRY
setflag 0x828
//[/I][/FONT][I]fanfare 0x13E
[FONT=Segoe UI]//msgbox @received_poke 0x4[/FONT]
//waitfanfare
release
end[/I]

The "//" indicate optional, but optimal commands for a givepokemon script.

And the easiest way to check off whether Prof. Oak gives you a Pokémon is to use Setflag, or if you're advanced, setvar. But setflag is easier to understand.. So you pick a flag (eg. 1000) and use it: "setflag 0x1000".

Now, just doing that is just... useless Lol. You'd have to check it with checkflag; 

[I]checkflag 0x1000
if 0x1(true) goto @gave_poke[/I]

Simple enough, right?

[QUOTE="RainDogg54, post: 5219496, member: 177556"]I use poketscript not XSE but i don't think it matters.
Ok so do you mean I should put this?
[CODE]#org $warning
message $warning
$warning 1 = I shouldn't go into the tall grass without a POKEMON..
and then do the same with $move?

Sorry I'm very new at this I'm still learning.

And I'm going to add the checkflag after I get this part of the script working
Using XSE over Pokescript does matter.. It's the amount of help you'll get as a beginner, and the ease of using one as a beginner. But you're choice is your choice. Right click, compile in Notepad < XSE compiling on spot with one click of a button

Code:
[B]#org $warning
 $warning 1 =[/B] I shouldn't go into the tall grass without a POKEMON..
This would be right. But I'll allow romancandle to help you more, because I don't know pokescript that well. :\
 
31
Posts
14
Years
  • Seen Sep 6, 2013
Do certain flags not work? I tried using the numbers 7 and 900 among others in the person ID field, and the person did not disappear after a setflag line (yes I had a hidesprite working).
Then, ONLY changing the flag and ID to others (20, 28, 29, 2A), it worked perfectly.
 

cooley

///Keepin' it simple
1,148
Posts
17
Years
Do certain flags not work? I tried using the numbers 7 and 900 among others in the person ID field, and the person did not disappear after a setflag line (yes I had a hidesprite working).
Then, ONLY changing the flag and ID to others (20, 28, 29, 2A), it worked perfectly.
That's exactly how it is. Some of the flags, are used by the game already.
Check you're XSE guide to see which ones are in use, meaning anyone not listed, is available to you. And there are many..
 
73
Posts
14
Years
  • Seen Aug 31, 2014
I use poketscript not XSE but i don't think it matters.
Ok so do you mean I should put this?
Code:
#org $warning
message $warning
$warning 1 = I shouldn't go into the tall grass without a POKEMON..
and then do the same with $move?

Sorry I'm very new at this I'm still learning.

And I'm going to add the checkflag after I get this part of the script working

As Cooley kindly pointed out:
Code:
#org $warning
$warning 1 = I shouldn't go into the tall grass with a POKEMON..
This is the correct way to do messages. The 2nd $warning (left of the 1) is not necessary, but it won't hurt (from my experience). You'll need to expand the first #org though. Like this:
Spoiler:

The 0x6 makes it a normal textbox message.

Move Script:
Spoiler:


Let us know if you need help with the flag part too ^^
 

trebornosliw

Learning
516
Posts
14
Years
  • Age 31
  • Seen Jul 22, 2012
Well, it's been awhile since I posted here...
Alright, this is a very, very basic XSE roadblock script. The only problem I have is that the applymovement doesn't work, so there's really no point to the script. I've already set the unknown and var number to the correct values (0003 and 4050), so I'm not sure what the problem is.
Script:
Spoiler:
 

cooley

///Keepin' it simple
1,148
Posts
17
Years
Spoiler:

Well I kind of fixed your script, with some advice from Ash493. So try it now.
 

trebornosliw

Learning
516
Posts
14
Years
  • Age 31
  • Seen Jul 22, 2012
Okay, I'll try it that way. Thanks!
EDIT: LOL, Cooley, you know better! The script worked alright, but you added setflag! It's a roadblock, so I don't want to setflag with this script. Bad Cooley!
Seriously though, thanks. This was enlightening.
 
Last edited:
5,256
Posts
16
Years
Script Type: Trainerbattle, Applymovement, Msgbox
Script Editor: eXtreme Script Editor [XSE]
Script Problem: After the battle, the game freezes.
Script:
Spoiler:

Comments: I removed the text because... I don't really know why, as I'm going to release screenshots with them in anyway. But, meh, it shortens the scripts length, so who cares?
 

Samike360

Lover of May
397
Posts
15
Years
Script Type: Trainerbattle, Applymovement, Msgbox
Script Editor: eXtreme Script Editor [XSE]
Script Problem: After the battle, the game freezes.
Script:
Spoiler:

Comments: I removed the text because... I don't really know why, as I'm going to release screenshots with them in anyway. But, meh, it shortens the scripts length, so who cares?

For these kind of trainerbattles, with the script continueing after the battle, I always use trainerbattle 0x1 instead of 0x0, and I think that's your problem. Try the changes made in bold that I added to the above script and see if that helps.
 
71
Posts
14
Years
  • Seen Jul 9, 2017
Game: Fire Red
Type: Trigger
Editor: Pokescript
Script:
Spoiler:

Screenshots and/or Videos: Can't give you pics yet because of 15 post lock
 
71
Posts
14
Years
  • Seen Jul 9, 2017
I made a script tile after oaks door
When I go through that door, nothing happens and when i step up and down, the game freezes...

I made a XSE script too:

'---------------
#org 0x80145B
checkflag 0x828
if 0x1 goto 0x8801480
applymovement 0x9 0x8801481
msgbox 0x8801487 MSG_NORMAL '"Hello there.\nI heard from my coll..."
release
end

'---------------
#org 0x801480
end


'---------
' Strings
'---------
#org 0x801487
= Hello there.\nI heard from my collegue\lProfessor Oak, that you are\nbeginning your journey.\pI've got some help from\nProf. Oak, Prof. Birch and Prof. Elm\lto get these starters for you.\pSo choose wisely.


'-----------
' Movements
'-----------
#org 0x801481
#raw 0x62 'Exclamation Mark (!)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements
 
Last edited:

trebornosliw

Learning
516
Posts
14
Years
  • Age 31
  • Seen Jul 22, 2012
Game: Fire Red
Type: Trigger
Editor: Pokescript
Script:
Spoiler:

Screenshots and/or Videos: Can't give you pics yet because of 15 post lock

Okay, so I'm not a big Pokescript fan, but I've used it before and I think I can see a few problems with your script. Changes in bold. Remember to always use hex numerals, I think that's the issue here.
Also, you might need to seperate your move command like a msgbox, but I'm not sure (you do in XSE...)
Seriously, change to XSE. It's way better, and very, very easy to learn if you already know Pokescript.
...Yeah, don't know enough about Pokescript to change more than that...

I made a script tile after oaks door
When I go through that door, nothing happens and when i step up and down, the game freezes...

I made a XSE script too:
Spoiler:

Oh, this is the same thing. In XSE. Cool. :)
I take it you extracted this from the game. When you edit and reinsert this, copy, paste, and compile it. DO NOT try to decompile, edit, then recompile it.
Umm, why are the targets for applymovement different in both scripts?
By the way, if you apply the changes above, the script will work if you step onto it after entering the map, but it still will not work right when you enter the lab. For that, you need a Level script; Cooley's done two absolutely terrific tutorials on level scripting, look them up.

That's all I can think of for that.

My own problem:
Spoiler:

The applymovement target doesn't walk down like I want him to. People # is 100B, so he vanishes right, and event # is 1. Oh, Unknown is 3, Movement 11, and on the script itself, unknown 3 var number 4050.
 
Status
Not open for further replies.
Back
Top