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

Scripting Guide for Beginner Hackers

Status
Not open for further replies.
Well ok thanks thethethethe. Man scripting is becoming a bit easy but still can't understand big scripts.
 
Hey can anyone tell me whats wrong with this script. It is an item script. Well here it is, the script-

#org 0x850000
copyvarifnotzero 0x8000 0xD
copyvarifnotzero 0x8001 0x1
callstd 0x6 ' PLAYER found one XXXXXX!
end

Thanks in advance.
 
You should stick too asking these in the scrapbox, but i'll do it anyway...

Code:
#org $begin
lock
faceplayer
giveitem 0xD 0x1
message $getitem
boxset 0x6
#raw 0x53
release
end

#org $getitem
= You found a XXXXXXX!

That is a basic item script..
 
You should stick too asking these in the scrapbox, but i'll do it anyway...

Code:
#org $begin
lock
faceplayer
giveitem 0xD 0x1
message $getitem
boxset 0x6
#raw 0x53
release
end

#org $getitem
= You found a XXXXXXX!

That is a basic item script..

In Scripted there is no Give Item command. That's why akash's script is written like that. What's written in akash's script is what's done in by giveitem. This is a scriptED tutorial so a some things are going to be different to what you might know, pokescript-wise.

Hey can anyone tell me whats wrong with this script. It is an item script. Well here it is, the script-

#org 0x850000
copyvarifnotzero 0x8000 0xD
copyvarifnotzero 0x8001 0x1
callstd 0x6 ' PLAYER found one XXXXXX!
end

Thanks in advance.
Like Crashlink said, you should just have posted this in the script thread in the scrap box, especially since, this has been covered in the tutorial yet.

But It should be like this.....
Code:
copyvarifnotzero 0x8000 0xD
copyvarifnotzero 0x8001 0x1
callstd [B]0x0[/B]
 
Oh, long time, no see, guys.

I would like to ask you to only post task-related scripts here, or I will ask a moderator to lock up this thread and there will be no guide. Blazikendude, you're right, I didn't put a lock and faceplayer, along with release command in the end, you will now recieve ocassional PMs with guide status. Akash, I have no clue what's wrong with ScriptED, why it isn't working. It happened to me till I didn't turn off the Windows feature mentioned in the troubleshooting. I cannot help you then.

Please, all of you, stay tuned on updates ;)
 
Hi

Well thanks thethethethe. And martin its ok cuz I downloaded PKSV. Well thanks anyways. HAPPY NEW YEAR.
 
Happy new year, people! And look forward to the new part! Checkgender and start of tutorial 2!
 
checkgender 0x*

Asterisk represents either 0 or 1 where 0 is male, 1 is female.

Just a little response to this statement. Checkgender only needs one byte to work, A0, If you were to add an extra byte to the end of it, it would just act as a nop and just be wasted space, wouldn't it? It wouldn't really do anything. The compare is supposed to be what checks if it's boy or girl. Like you said 0x0=male, 0x1=female.

But I guess, I'd better ask, does it work this way too, becasue that's whats important?
 
Ah, I see. I know what you mean now. It seems that I just misplaced that. *corrects*

Thanks :)

And yes, it worked last time I used it that way. But anyway, I have wrong statemet there, and that's what I don't want.

EDIT/REPOST: The guide was accidentally deleted, a little problem occured. Now... The guide is restored - big thanks to Hiroshi Sotomura for his kindness and mainly for restoration of the guide.

Checkgender Guide

You might sometimes need to check if player chose male or female gender in the start. It can be handy when you want to call someone "dude" or "chick" - you know, it would be silly i a boy named e.g. Travis was called "chick" :D No, we cannot let that this way. There is a command that checks gender.

checkgender

You need to use compare command again.


compare LASTRESULT 0x*


Asterisk represents either 0 or 1 where 0 is male, 1 is female.

So, look at the example. If you wnat to put this into a script, don't forget to replace 0xoffset with valid offset e.g. 0xB00000

#org 0xoffset
lock
faceplayer

checkgender
compare LASTRESULT
0x1 - if player is female, then
if 0x1 goto 0xoffset2 - go to offset
... - if player is male, script continues normally.
release
end


#org 0xoffset2
...
release
end


As you should know basic message commands, I didn't put them into the example. If you want, you can try to make a script and then post it here to be checked.
 
Last edited:
Okay,
Here goes!
I'm a little rusty sooo...
Spoiler:
 
I think your beginning to understand this...
I've also realised my old PokeScript scripts didn't work because they were made as ScriptEd scripts xD

I think it should look like this:

Code:
#org 0x800000
lock
faceplayer
checkgender
compare LASTRESULT 0x1
goto 0x800200
boxset 0x06
message 0x800100
boxset 0x06
release
end

#org 0x800100
= Hey dude!\n Whats up?

#org 0x800200
= Hey girl!\n Hows it going?

I didn't really know where to put the boxsets, so I experimented a little.
 
You corrected it, but your correction needs a correction, too ;) Don't worry, it won't hurt that much.

#org 0x800000
lock
faceplayer
checkgender
compare LASTRESULT 0x1
if 0x1 goto 0x800200
message 0x800100
callstd 0x6
release
end

#org 0x800100
= Hey dude!\n What's up?

#org 0x800200
msgbox 0x800300
callstd 0x6
release
end

#org 0x800300
= Hey girl!\n How's it going?

It is better now. Mainly because you cannot put the goto command pointing directly to a message.
And I replaced boxsets with callstd. It will sure work with both ways, but I like callstd more :D

And I know now why there was amistake with the goto command, I forgot to put in the "if" routine. It's fixed in the guide, now.

And Blazikendude, FORGET EVERYTHING YOU LEARNED WITH POKéSCRIPT TUTORIALS. ScriptED's language is pretty much different so don't mix up the two. It may work in Pokéscript but it WON'T WORK IN SCRIPTED.
 
Thanks for fixing that, I was thinking about if the goto needed an "if", and it bothered me quite a bit xD.
I can tell that ScriptEd is alot different from PokeScript xD.
 
And therefore I don't recommend using the two at the same time. You should choose if you want to stay with one or another, and that should be definitive. Personally, I have nothing against Irish Witch, but I don't like the mess Pokéscript caused amongst ScriptEd usera and therefore I strongly recommend to use ScriptEd instead. Everyone who isn't sure how to write out commands in ScriptEd can freely look in this guide and the content will expand with enough feedback.
 
Alright, can I use #raw and specials in ScriptEd?
That would help me replace commands I don't know.
 
Well, a #raw command is sought of like a hex command, instead of using the proper command in the program, you use a hex code if you don't know the actual command or if it wont work. In all programs there are no movements called ; left, right, up or down. They are #raw's. Atleast that's what I learnt O.o
 
Oh!
Thank you Carshink!
You are the only person who atually awnsers my n00bish scripting questions!
Thank you so much!
Now are you saying that #RAW commands are movement commands?
Anyways,
I thank you so much!
 
Alright, can I use #raw and specials in ScriptEd?
That would help me replace commands I don't know.

Of course. "special" is a command common between both scriptED and pokescript. And #raw can be used in both.
But Martin² might correct me here... but in pokescript, you can use #raw's like this...
Code:
#raw 0x53 0x0F 0x80
But it needs to be used like this in ScriptED...
Code:
#raw 0x53
#raw 0x0F
#raw 0x80

Oh!
Now are you saying that #RAW commands are movement commands?
Anyways,
I thank you so much!

#raw commands are anything. Movements are #raw's. All commands are #raw's. Let me put it this way. Here's a normal script.
Code:
#org 0x800000
#raw 0x6A
#raw 0x5A
#raw 0x0F
#raw 0x00
#raw 0x0D
#raw 0x00
#raw 0x80
#raw 0x08
#raw 0x09
#raw 0x06
#raw 0x6C
#raw 0x02
This script in #raw's will do the exact same thing as this script below. (I left out pointers)
Code:
#org 0x800000
lock
faceplayer
message 0x80000D
boxset 6
release
end
Scripting in hex is the same as Scripting in #raw's.
 
Status
Not open for further replies.
Back
Top