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

Advanced Scripting Tutorial

Status
Not open for further replies.

Overclocked

Paired with......Myself
72
Posts
17
Years
  • Age 30
  • Seen May 1, 2007
Does anyone know the command to change a sprite? e.g. Turn a hidden person into an old man or change an old man into an old woman.
 

Irish Witch

Office Jenny
147
Posts
17
Years
FINALLY! The setflag works! I looked at another script that had a setflag and that guided me. Just in case anyone needs help with setflags, I'll post the script so you get a good idea of what to do.

only difference between that script and the alterations I cave you is no compare.. I though it needed the compare but maybe I was wrong...

Does my program compile the scripts properly now that I've fixed that bug... It was only caused by a mis-placed bracket you know!
 

Overclocked

Paired with......Myself
72
Posts
17
Years
  • Age 30
  • Seen May 1, 2007
Just use advance map to change the pic by number.
I need it to change whilst playing the game.
You see I'm doing a flashback thing in my game and I need a thing (sprite No.152) to change into a MewTwo. I tried using movesprite but it doesn't work when the sprite is hidden away on the side of the map.
 

D-Trogh

Dead
439
Posts
18
Years
Okay, here's what happens.

1. I say Yes to him and get Bulbasaur.
2. I talk to him and he asks how it's doing.
3. I reset the ROM.
4. I say No to him.
5. I talk to him and he asks how it's doing even thought I don't even have it yet. So that would mean that I'd never get the chance to get it if I say No.

Do you understand now?
Well, I asked you to do something else.. but -MEH-

Try this. I don't know if it works.. but if it does, I'm becoming a good scripter :P
Spoiler:
 
91
Posts
17
Years
  • Seen Nov 1, 2010
Well, I asked you to do something else.. but -MEH-

Try this. I don't know if it works.. but if it does, I'm becoming a good scripter :P
Spoiler:

Why do you use 'goto' and 'jump' everywhere?
Just use if 0x1 0x( offset ) :)

And strings doesn't belongs there, some people may paste it in their scripts.

Code:
]#org 0xD00000
lock
faceplayer
message 0xD00100
boxset 0x5
compare LASTRESULT 0x1
if 0x1 0xD00200
checkflag 0x10A
if 0x1 0xD00500
message 0xD00300
boxset 0x6
release
end

#org 0xD00200
checkflag 0x10A
if 0x1 0xD00500
message 0xD00400
boxset 0x6
setflag 0x10A
givepokemon 0x1 0x5 0x0
release
end

#org 0xD00500
message 0xD00600
boxset 0x6
release
end

#org 0xD00100
= I really like BULBASAUR.\nDo you?

#org 0xD00400
= You do? Great! Then you deserve to get\none!\p\v\h01 received the BULBASAUR!

#org 0xD00300
= You don't? Too bad.

#org 0xD00600
= How's that BULBASAUR coming along?
 

Irish Witch

Office Jenny
147
Posts
17
Years
What I don't get is why you're using boxset 5 (and 6 for text)....

Isn;t it supposed to be
0 text.
1 text no close.
2 yes/no box
3 text close on any keypress

4 5 6 may overlap or something cause of the bit setting (I dunno) but normat text display should be 0 (1 for long text) and yes/no boxes should be 2 !

Why do you use 'goto' and 'jump' everywhere?
Just use if 0x1 0x( offset )

And strings doesn't belongs there, some people may paste it in their scripts.

He uses goto and jump cause in the most recent versions of scripted that's how it says to work. There is also if call and if gosub for returning subroutines.

And he has rem statements in from of the word strings so that won't be processed!

And D-Trogh's looks the most right so far! I don't have the time to do tests unfortunately. I'm a security officer. Every time I think I have time to sit and work one something I have to attent an alarm or something!
 
Last edited:

D-Trogh

Dead
439
Posts
18
Years
And he has rem statements in from of the word strings so that won't be processed!
Yes indeed !
He uses goto and jump cause in the most recent versions of scripted that's how it says to work. There is also if call and if gosub for returning subroutines.
I tought so too.. I always use the 'goto' but not with PokéScript ^^
What I don't get is why you're using boxset 5 (and 6 for text)....

Isn;t it supposed to be
0 text.
1 text no close.
2 yes/no box
3 text close on any keypress

4 5 6 may overlap or something cause of the bit setting (I dunno) but normat text display should be 0 (1 for long text) and yes/no boxes should be 2 !
Well.. the 'boxset 0x?' I don't get either.. Christos answerd my question about that in the SQT I think ^^
But, I always use '0x5' for a question box, and '0x6' for a normal textbox..
I never use something else :-\

Edit:
Ok, I can't fount it, maybe he didn't anser my question
 
Last edited:

Irish Witch

Office Jenny
147
Posts
17
Years
Here's my attempt at organising the script..

method:
Check flag first, jump if true
if false ask about pokemon, jump if true
if false display apology!

#org 0xD00000
lonk
faceplayer
checkflag 0x10A
if 0x1 goto 0xD00500
message 0xD00100
boxset 0x2
compare LASTRESULT 0x1
if 0x1 goto 0xd00200
message 0xd00100
boxset 0
release
end


#org 0xD00200
checkflag 0x10A
if 0x1 jump 0xD00500
message 0xD00400
boxset 0x6
setflag 0x10A
givepokemon 0x1 0x5 0x0
release
end

#org 0xD00500
message 0xD00600
boxset 0x6
release
end

All offsetts same, text same. Only section I changed was that first bit in bold.
 

D-Trogh

Dead
439
Posts
18
Years
Aw.. yeah, the 'checkflag' will be beter in the begining :cheeky:
But, your 'lonk' needs to be 'lock' :P
And 'boxset 0' ?? => 'boxset 0x6'
 

Irish Witch

Office Jenny
147
Posts
17
Years
0x simply means hex. If you're doing a number lower than 9 you don't need it (scripted or my program)

And boxset 0 should work! I only ever used 0 to 3 in my scripts. Now I admit I haven't programmed in rubikon for seven months but my scripts used to work!

I'm gonna have to revive my old project :-)


Kudo's picking up on the faulty lock though. I did write that script just as I was walking out the door :-D

overclock said:
I need it to change whilst playing the game.
You see I'm doing a flashback thing in my game and I need a thing (sprite No.152) to change into a MewTwo. I tried using movesprite but it doesn't work when the sprite is hidden away on the side of the map.

Use warp. If you perform a warp from inside a script you retain control of the charactrer after the warp. Warp the character to a new map, perform some scripts then warp back! Then you're flashback can have more than just one character change!
 
Last edited:

Blaziken626

Pokemon Black Shadow
208
Posts
17
Years
  • Age 30
  • Seen Aug 25, 2015
Woah, I guess I slept through a lot of posts last night! Well, to answer the question about the 0x5, 0x5 is used for Yes/No, is it not? And notice that he says "You do?" and "You don't?". And as for the PokeScript, I'm not even sure if I'm using it right. :P Am I just supposed to type this?

#kapush (.rbc file) (offset)

and then

#kapop (.gba ROM)

Because after I do that and press Enter, it says it processed 0 lines.
 
Last edited:

Irish Witch

Office Jenny
147
Posts
17
Years
Woah, I guess I slept through a lot of posts last night! Well, to answer the question about the 0x5, 0x5 is used for Yes/No, is it not? And notice that he says "You do?" and "You don't?". And as for the PokeScript, I'm not even sure if I'm using it right. :P Am I just supposed to type this?

#kapush (.rbc file) (offset)

and then

#kapop (.gba ROM)

Because after I do that and press Enter, it says it processed 0 lines.

?????

It's better to use the file associations in explorer.... But if I have to explain that again...

#encode (.rbc file) ' Encode script

#kapush (offset) (location) ' modify offsetts

#kapop (.gba ROM) ' Write to rom.....

The reason you kapush is because my program doesn't need fixed offsetts to work... Example, using you're script:

#org 0xD00000
lock
faceplayer
checkflag 0x10A
if 0x1 goto $GotBulba
message $TxtLikeBulba
boxset 0x2
compare LASTRESULT 0x1
if 0x1 goto $WantPokemon
message $TxtNoBulba
boxset 0
release
end

#org $WantPokemon
message $TxtHereBulbu
boxset 0x6
setflag 0x10A
givepokemon 0x1 0x5 0x0
release
end

#org $GotBulba
message $TxtGotBulba
boxset 0x6
release
end

#org $TxtLikeBulba
= I really like BULBASAUR.\nDo you?

#org $TxtHereBulba
= You do? Great! Then you deserve to get\none!\p\v\h01 received the BULBASAUR!

#org $TxtNoBulba
= You don't? Too bad.

#org $TxtGotBulba
= How's that BULBASAUR coming along?

Use that in MY program and it wil write into the rom with absolutely no gaps in the script!

If I want to move those around though then I can, either by using #kapush in pokescript or by loading the .buf file in bufrite (the default program) and adjusting it there...

Now flaming well read the 'about' section on my website.
Links in the signiture!
 
Last edited:

D-Trogh

Dead
439
Posts
18
Years
And as for the PokeScript, I'm not even sure if I'm using it right. :P Am I just supposed to type this?

#kapush (.rbc file) (offset)

and then

#kapop (.gba ROM)

Because after I do that and press Enter, it says it processed 0 lines.
For PokéScript.. use PokéScripts topic ;)
But => It's easier to just Right-Click your .rbc file and hit 'compile' in the menu ;)

B2T
 

Blaziken626

Pokemon Black Shadow
208
Posts
17
Years
  • Age 30
  • Seen Aug 25, 2015
What do you mean by explorer??? I see no explorer program. And you can't possibly mean Internet Explorer. Anyway, I think we should drop this topic considering it has nothing to do with the topic of this thread.

So anyway, back on topic...I got the givepokemon script to work! I used IrishWitch's script and tweaked around with it a bit. Here's the script:

Code:
#org 0xD00000
lock
faceplayer
checkflag 0x10A
if 0x1 goto 0xD00500
message 0xD00100
boxset 0x5
compare LASTRESULT 0x1
if 0x1 goto 0xD00200
message 0xD00300
boxset 0x6
release
end

#org 0xD00200
checkflag 0x10A
if 0x1 jump 0xD00500
message 0xD00400
boxset 0x6
setflag 0x10A
givepokemon 0x1 0x5 0x0
release
end

#org 0xD00500
message 0xD00600
boxset 0x6
release
end

#org 0xD00100
= I really like BULBASAUR.\nDo you?

#org 0xD00400
= You do? Great! Then you deserve to get\none!\p\v\h01 received the BULBASAUR!

#org 0xD00300
= You don't? Too bad.

#org 0xD00600
= How's that BULBASAUR coming along?

The only little problem is that I don't know how to make that receive Pokemon sound happen. But that doesn't really matter.
 

Irish Witch

Office Jenny
147
Posts
17
Years
This will be the last time I write something on pokescript in here I promise!

- UPDATE -
DAAMNIT!@

While trying to fix the bug for the construct handler I screwed up the registry association handler... I've just fixed that now!

*Hopefully* fully functional download now available!
 

D-Trogh

Dead
439
Posts
18
Years
The only little problem is that I don't know how to make that receive Pokemon sound happen. But that doesn't really matter.
Well, you can put 'jingle' before the text.. OR use the 'fanfare' command.. but then you need to look for the right "sound-var"
 

Irish Witch

Office Jenny
147
Posts
17
Years
Hey Blaziken. I've just sent you a Private Message (top of this page, click on private messages)

It hopefully answers some of you're questions about how to use my program (including what explorer is)

Edit, And D-Trog is right, put
fanfare <number>
waitforfanfare <number>
after the boxset command that says you get the pokemon.
In both cases number is the number of the sound you want made!
I think Sappy lets you listen to the sounds.
 
Last edited:

Blaziken626

Pokemon Black Shadow
208
Posts
17
Years
  • Age 30
  • Seen Aug 25, 2015
Great news! I've finally figured out how to get the TrainerBattle to work with DiamondCutter. (I used ScriptEd to find the script for a trainer battle.) All you have to do is put 0x0 between the trainer's number and the ptrintro.
 

Irish Witch

Office Jenny
147
Posts
17
Years
sounds like in scripted the trainerbattle construct wasn't working full stop...
Not only did you have to write a 5C at the beginning (the bytecode for 'trainerbattle' but you had to manually put the filler in as well!

Damn that program was a heap of rubbish!

* Note, I have tried to revive my old hack that got me started on making pokescript. I intend to post a howto very shorty on changing the script for the opening of the game (soon as I figure out how to do it!)
 
Status
Not open for further replies.
Back
Top