The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.


Closed Thread
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old November 19th, 2007, 02:13 PM
score_under's Avatar
score_under
I program the *other* ASM.
 
Join Date: Aug 2005
Location: Hertfordshire, England
Age: 21
Nature: Rash
I am no longer active on these forums; if you need to contact me please use e-mail unless your name is Seth in which case please run a virus scan first. I probably won't develop this tool any more, you can steal the code or something.

Works in: Pokemon Gold, Pokemon Silver, Pokemon Crystal, Pokemon Fire Red, Pokemon Leaf Green, Pokemon Emerald, Pokemon Ruby, and Pokemon Sapphire. (Now dynamic offsets work in Gold too)


Most of the posts on the first page (except this one) that I have made are for the old command-line version.
If you don't have a webkit-based (e.g. Safari), Mozilla-based (e.g. Firefox), or css3-compliant browser, get firefox now as this page's CSS renders well ONLY in one or more of these conditions. If you use, for example, Internet Explorer, it will not display correctly.

Simple Guide Here
Beginners only - PKSV is so much more than this!


Warning: Never use #org $1 (or similar pokescript parlance), as it will write to position 1 in the ROM and corrupt vital data.
Get it at http://pk-script-view.sourceforge.net/.


Simply put, PKSV is a Pokémon Advance script editor. A very good one...
One you will instantly get hooked on - It's only a matter of time before you download!
The package you most probably want is the package with GUI.
Here's how it looks:

Anyone with spare time, a brain, and a sharp eye for bugs can develop it if they want - I give away ALL the source code in the download link!

I have developed this program in my free time because I found that Rubikon and PokeScript weren't advanced enough to suit my needs. This program will also automatically notify you of updates [version data] whenever they're available.

Two of the most unique features about this program:
  • It compiles movements into easy-to-read movement lists, not #raw!
  • It has a built in script generator! (But I'll need some more people to give me ideas about some other simple scripts that I could generate!)
  • Heck, you can even zoom in and out with ctrl+mouse wheel. (Or indeed, ctrl+numpad+ and ctrl+numpad- respectively)

How to install:
Use an unzipping program (if you don't have EITHER Windows XP OR one of these, do a google search for AlZip) to unzip the file you downloaded (usually pksvui_pkg?-?-?.zip).
Unzip it into its own folder and when you are happy with the place you have put it, double-click "AssociateShell.bat" to register PKSV in its current folder with your system.
Now all you have to do is run "pksvui.exe" and play around!


(If you're interested in how Gold #dynamic works, look here)
Spoiler:
Code:
#dyn findfromgold
#org @test
loadfont
2writetext :test
yesorno
2ptjump :asd
:test
= Testing\nTest1\e
:asd
#3ptr @zzzz
#org @zzzz
3writetext @asdf
3jump @yyyy
#org @yyyy
end

#org @asdf
= Message 2\e
Notice that 2-byte pointers use :labels and 3-byte pointers use @blocks. This is because "#org" blocks will never cross a bank, so a label inside them ensures it will be able to use a 2-byte pointer safely. You cannot use labels for 3-byte commands, unfortunately, you will have to use a code block.


Please reply if you like it!
...or rate this thread, or add reputation to this post, or PM me with hate, or add to my visitor messages.

Tech stuff:
Spoiler:
PKSV is a GPL-licenced decompiler and compiler for Pokémon Advance ROMs, currently with only one developer - me!
There are 2 executables: pksvui.exe is the frontend (the graphical IDE) and pksv.exe is the backend.
It is programmed in a mixture of C and ASM, and compiled with Visual C++.

Last edited by score_under; December 10th, 2011 at 05:49 PM.
  #2    
Old November 24th, 2007, 05:58 AM
Kristian's Avatar
Kristian
Smoochum
 
Join Date: Sep 2007
Location: Norway? :b
Nature: Calm
WOW, i tested it and it work perfectly! :p really simple to use to =)
  #3    
Old November 25th, 2007, 01:04 AM
light_trainer921's Avatar
light_trainer921
Flamethrower Helper
 
Join Date: Nov 2006
Location: Treasure Town at the human world
Age: 18
Gender:
Nature: Timid
I hate to be off-topic or breaking the rules but how can I get the program to work?
__________________
  #4    
Old November 25th, 2007, 02:12 AM
Kristian's Avatar
Kristian
Smoochum
 
Join Date: Sep 2007
Location: Norway? :b
Nature: Calm
Quote:
Originally Posted by light_trainer921 View Post
I hate to be off-topic or breaking the rules but how can I get the program to work?
first you have to download the: pksv_sourcecode,
when you have download that, unzip it,
then open pksv.exe,
then you load your rom then you type the offset you wanna see..
  #5    
Old November 25th, 2007, 07:25 AM
Teamtyranitar's Avatar
Teamtyranitar
Fizz-X
 
Join Date: Nov 2007
Location: Enjoying life
Age: 19
Gender:
Nature: Lax
umm what offset
......................
__________________
  #6    
Old November 25th, 2007, 11:33 PM
Dan13x
Togepi
 
Join Date: Apr 2007
Location: Brisbane, Australia
Age: 18
Gender: Male
Nature: Quiet
Wow! I've always wanted to see some of the scripts. Thanks score_under!
  #7    
Old November 26th, 2007, 09:10 AM
D-Trogh's Avatar
D-Trogh
Dead
 
Join Date: Jul 2005
Location: Belgium
Age: 22
Gender: Male
Send a message via Windows Live Messenger to D-Trogh
Quote:
Originally Posted by dan123410 View Post
Wow! I've always wanted to see some of the scripts. Thanks score_under!
Yeah, l0l.. why didn't you use ScriptEd or ScriptDec then? XD
__________________
[NTME | WPEDS | HTPE | SGPE | TGPE | PDEDS]
  #8    
Old November 26th, 2007, 12:09 PM
score_under's Avatar
score_under
I program the *other* ASM.
 
Join Date: Aug 2005
Location: Hertfordshire, England
Age: 21
Nature: Rash
This post applies to an OLD version of the program only
Spoiler:


Now it does even more: recompiles strings! I should have had this 2 days ago, but sourceforge didn't like the package.

@ D-Trogh:
It can decompile most scripts without problems, and makes a Clear Distinction between pause and pauseevent, while rubikon labels them as just pause *ambiguous*.
It also makes a distinction between msgbox (part of loadpointer) and message (something else to do with berry script, same effect).
And it doesn't forget to apply #org to any movement data. Shame on Rubikon!

@ Everyone!
UPDATE: Example script for storetext!
Code:
#org 0x6B09F8
lock
faceplayer
checkflag 0xE000
if 0x1 jump 0x6b0C50
jump 0x6b0C30

#org 0x6B0B00
= Dude, where's my \v\h02?\p...

#org 0x6b0C00
= car

#org 0x6b0C10
= burrito of doom?!

#org 0x6b0c30
setflag 0xE000
storetext 0x0 0x86b0C00 'storetext 0x0 ADDR means store ADDR into \v\h02.
                        'likewise, storetext 0x1 ADDR means store ADDR into \v\h03.
                        'storetext 0x50 ADDR means store ADDR into \v\h52.
                        'Get it?
jump 0x6b0d00

#org 0x6b0c50
clearflag 0xE000
storetext 0x0 0x86b0c10
jump 0x6b0d00

#org 0x6b0d00
message 0x6B0B00
showmsg
waitbutton
closemsg
release
end
Now just assign some guy to 0x6B09F8 in advancemap, and he says:
* Dude, where's my car?
and
* Dude, where's my burrito of doom?
in an alternating pattern.

Edit #1 000 000 000 or something like that :D
Use storevar to store a var as text.
EG. If 0x800D contains 0xC, storevar 0x0 0x800D will store the text "12" into text-var \v\h02.
__________________
Plz not to PM me, I don't come here often enough. Email if you need me

Last edited by score_under; August 23rd, 2008 at 04:45 AM.
  #9    
Old November 29th, 2007, 10:37 PM
Dan13x
Togepi
 
Join Date: Apr 2007
Location: Brisbane, Australia
Age: 18
Gender: Male
Nature: Quiet
Quote:
Originally Posted by D-Trogh View Post
Yeah, l0l.. why didn't you use ScriptEd or ScriptDec then? XD
I don't use any of them because for ScriptEd the text won't show up and for ScriptDec when I type in the offset and type N then press enter it disappears! That's why I use PKSV more.
  #10    
Old December 2nd, 2007, 01:48 PM
score_under's Avatar
score_under
I program the *other* ASM.
 
Join Date: Aug 2005
Location: Hertfordshire, England
Age: 21
Nature: Rash
Please feel free to subtly suggest things you might want to see in a future version of PKSV.
__________________
Plz not to PM me, I don't come here often enough. Email if you need me
  #11    
Old December 2nd, 2007, 06:01 PM
cooley's Avatar
cooley
///Keepin' it simple
 
Join Date: Feb 2007
Location: United States
Age: 19
Gender: Male
Nature: Impish
Send a message via Windows Live Messenger to cooley Send a message via Skype™ to cooley
I think you should make tutorials for n00bs. Some don't even know what an offset is.
__________________

  #12    
Old January 18th, 2008, 05:39 AM
Mitchman
Booted out - don't be like me!
 
Join Date: Dec 2007
Location: Southern Europe
Age: 21
Gender: Male
Nature: Hasty
im anoob at hacking what is an adress for a rom say like emerald
  #13    
Old January 18th, 2008, 06:10 AM
Teamtyranitar's Avatar
Teamtyranitar
Fizz-X
 
Join Date: Nov 2007
Location: Enjoying life
Age: 19
Gender:
Nature: Lax
Quote:
Originally Posted by cooley View Post
I think you should make tutorials for n00bs. Some don't even know what an offset is.
Hey i have never had done scripting but never mind i figured it out
__________________
  #14    
Old January 18th, 2008, 06:11 AM
Mitchman
Booted out - don't be like me!
 
Join Date: Dec 2007
Location: Southern Europe
Age: 21
Gender: Male
Nature: Hasty
um yeah what is an offset
  #15    
Old January 18th, 2008, 06:50 AM
WaterSplash's Avatar
WaterSplash
Common
 
Join Date: Jan 2008
Location: Wherever I am, I am
Age: 21
Gender: Male
Nature: Serious
Send a message via AIM to WaterSplash
I understand how to work the program, but I'm not sure how to change the scripts.

When I open it it comes up with a strange black box, then gives a prompt to open the ROM.
After that it asks for an offset. So I put it in and it comes up with the offset I asked for. But then if I hit any button it clicks out.

Help?
__________________

Berries Grow, Birds Fly, Sun Shines, and Brotha...I Splash People.
  #16    
Old January 18th, 2008, 07:47 AM
organization XIII's Avatar
organization XIII
Beginning Trainer
 
Join Date: Jan 2008
Location: N/A
Gender:
Nature: Calm
whats an offset? can any1 explain please?
  #17    
Old January 18th, 2008, 07:51 AM
Swampert 22's Avatar
Swampert 22
Is making tools for you...
 
Join Date: Sep 2005
Location: Switzerland
Age: 23
Gender: Male
Nature: Brave
An offset is the point in the rom where the data you want is stored. To find an offset, go into advance map and click on an event. It should then, in the address box have $XXXXXX.
X obviously being a number. Remember that offset, than put it into PKSV. Then it will decompile the script at that offset.
__________________

I've made some tools for Pokémon hacking! Please check out the thread... Swampert Tools Showcase

Head over to my thread to check out my latest tool, Pokémon Red/Blue Trainer Editor!

Visit my site for Pokémon ROM Hacking tools! Swampert Tools Homepage
  #18    
Old January 18th, 2008, 05:59 PM
organization XIII's Avatar
organization XIII
Beginning Trainer
 
Join Date: Jan 2008
Location: N/A
Gender:
Nature: Calm
thanks, never could have guess that stuff. but there is still a problem. it is that when i type the offset, then it will say "enter hex number! (Too late now!) what is that suppose to mean?
__________________
no sig yet *_*

Last edited by organization XIII; January 18th, 2008 at 06:12 PM.
  #19    
Old January 19th, 2008, 02:34 PM
cooley's Avatar
cooley
///Keepin' it simple
 
Join Date: Feb 2007
Location: United States
Age: 19
Gender: Male
Nature: Impish
Send a message via Windows Live Messenger to cooley Send a message via Skype™ to cooley
Hey, I was wondering how to compile scripts with this program? If it's possible.
__________________

  #20    
Old January 19th, 2008, 03:14 PM
Teamtyranitar's Avatar
Teamtyranitar
Fizz-X
 
Join Date: Nov 2007
Location: Enjoying life
Age: 19
Gender:
Nature: Lax
Quote:
Originally Posted by organization XIII View Post
thanks, never could have guess that stuff. but there is still a problem. it is that when i type the offset, then it will say "enter hex number! (Too late now!) what is that suppose to mean?
Totreial ok go to advanced map then click on a event it should have an offset fill that in without th $
__________________
  #21    
Old February 2nd, 2008, 03:45 AM
score_under's Avatar
score_under
I program the *other* ASM.
 
Join Date: Aug 2005
Location: Hertfordshire, England
Age: 21
Nature: Rash
This post applies to an OLD version of the program only
Quote:
Hey, I was wondering how to compile scripts with this program? If it's possible.
Save the file as a .PKS file, right-click it, then press Compile. <- NOT USED IN PKSV 2.0 (This was used before v0.9)

Old version of post:
Spoiler:
Sorry for the inactivity.
Quote:
Hey, I was wondering how to compile scripts with this program? If it's possible.
Go to command prompt and CD to the PKSV directory, then type...
Code:
pksv -r script.txt rom.gba
I've just started working on it again - working on getting it to decompile slot-machine scripts. (eg. buying coins, using slots). I've been testing on ruby.
__________________
Plz not to PM me, I don't come here often enough. Email if you need me

Last edited by score_under; July 15th, 2009 at 03:32 PM.
  #22    
Old February 2nd, 2008, 11:38 AM
Swampert 22's Avatar
Swampert 22
Is making tools for you...
 
Join Date: Sep 2005
Location: Switzerland
Age: 23
Gender: Male
Nature: Brave
Hey score-under, I had an idea that may make a useful addition to the program. Functionality to export the decompiled script to a txt file. Whadda ya think, cus sometimes, on a really long script it chops the top off. This would let you read the whole thing, and make basing new scripts on the decoded ones easier.

Just an idea!
__________________

I've made some tools for Pokémon hacking! Please check out the thread... Swampert Tools Showcase

Head over to my thread to check out my latest tool, Pokémon Red/Blue Trainer Editor!

Visit my site for Pokémon ROM Hacking tools! Swampert Tools Homepage
  #23    
Old February 4th, 2008, 10:39 AM
score_under's Avatar
score_under
I program the *other* ASM.
 
Join Date: Aug 2005
Location: Hertfordshire, England
Age: 21
Nature: Rash
This post applies to an OLD version of the program only

Old post:
Spoiler:
OK, but to do this at the moment, I do:
Code:
pksv ruby.gba ABCDEF > script.txt
Check here to see some of my compiler woes implementing the feature:
Spoiler:

EDIT:
Compiler blues atm :(
Code:
In file included from codeproc.h:182,
                 from pksv.c:28:
decompiler.h: In function `writescr':
decompiler.h:50: error: syntax error before "va_list"
decompiler.h: In function `DecodeProc':
decompiler.h:73: warning: assignment from incompatible pointer type
Fixed with a simple replacement of va_list with va_arg (simple mistake)
and placing (typeof(func)) before one of the lines.
Now, I'm getting:
Code:
C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s: Assembler messages:
C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2681: Error: ambiguous operand size for `cmp'
C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2683: Error: ambiguous operand size for `dec'
C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2686: Error: no such instruction: `movl -16(%ebp),%edx'
C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2687: Error: no such instruction: `leal -16(%ebp),%eax'
C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2688: Error: no such instruction: `addl $4,(%eax)'
C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2689: Error: no such instruction: `movl (%edx),%eax'
C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2690: Error: no such instruction: `movl %eax,-65564(%ebp)'
EDIT:
All solved with vsprintf. Good old vsprintf. Also freed about 6 bytes of memory!

New post:

Hey people! I got a new version out today.
It can decompile codes for the slot-machine much better now, with commands for altering and checking the coin case, and some purely semantic commands (to prevent false data being decompiled).
The unknown commands are prefixed with a "CMD_" both in the program AND in the decompiled code, and are useless until I find out what they actually do :D
@swampert22: This version can now do that!

EDIT:

Random no-confirmation trading script
Code:
setvar 0x8004 0x0 ' Their poke, slot number (still don't know the variable for trainer)
setvar 0x8005 0x0 ' Our poke, slot number [0-5]
special 0xfd
special 0xfe
waitspecial
__________________
Plz not to PM me, I don't come here often enough. Email if you need me

Last edited by score_under; August 23rd, 2008 at 04:45 AM.
  #24    
Old February 12th, 2008, 05:05 AM
Lyzo's Avatar
Lyzo
On vacation
 
Join Date: Mar 2007
Location: The Netherlands
Age: 19
Gender: Male
Nature: Bold
Send a message via Windows Live Messenger to Lyzo
Hey I've been trying to get the poké ball script because i still don't know how it works anyway the program worked but it says all these weird things that i don't get.

Here's what it says if anyone knows what it means please tell me.

copyvarifnotzero 0x8000 0x148
copyvarifnotzero 0x8001 0x1
callstd MSG_FIND ' PLAYER found one XXXXXX!
end


I think i understand the last 2 sentences. It plays a message just like the code message $**** and then the message. Then it ends. But i don't understand the first 2.
  #25    
Old February 14th, 2008, 03:59 AM
score_under's Avatar
score_under
I program the *other* ASM.
 
Join Date: Aug 2005
Location: Hertfordshire, England
Age: 21
Nature: Rash
This post applies to an OLD version of the program only

Hi,
Code:
copyvarifnotzero 0x8000 0x148
copyvarifnotzero 0x8001 0x1
When you find/obtain an item, the game needs to know which item and how much.
The number stored in 0x8000 tells it which item (0x148 = TM40 Aerial Ace)
The number stored in 0x8001 tells it how many (one)
then it calls the function to give the item (callstd MSG_FIND) and ends the script.

Also, be careful not to mix up message and msgbox in pksv - they mean different things.
Code:
message 0x????????  ' Gets ready to show a message (only one page, ie. cannot have \p or \l)
showmsg
waitbutton
closemsg
end

--------------

msgbox 0x???????? 'can have multiple pages
callstd MSG_NORMAL 'shows message
end
message 0x???????? is used primarily in the "berry" script, as it provides more control over when the message closes, what it does, etc.
msgbox 0x???????? is used for general-purpose messages.

How to edit scripts
This is a copy of a PM I sent - I hope it's useful to you.
Spoiler:

Quote:
I understand how to work the program, but I'm not sure how to change the scripts.

When I open it it comes up with a strange black box, then gives a prompt to open the ROM.
After that it asks for an offset. So I put it in and it comes up with the offset I asked for. But then if I hit any button it clicks out.

Help?
Sorry for being a bit ;) late, but if you're still at a loss, here's how to do it:

Save this as EditScript[NAME].bat (or something you can remember) EDIT: You need to put .bat on the end or it does not work!
Code:
@echo off
pksv ROMFILE.GBA OFFSET >edit_script
notepad edit_script
pksv -r edit_script ROMFILE.GBA
For example:
EditScript[Berry].bat
Code:
@echo off
pksv RubyRom.gba 1A14DD >edit_script
notepad edit_script
pksv -r edit_script RubyRom.gba
Then, move the EditScript[NAME].bat file into the PKSV folder (along with the ROM, if you don't know how to change BAT-files accordingly)
Now, double-click your .bat file and it should open notepad. Change the script in there, and as soon as you save and exit notepad, it will compile your script.

The 1st PKSV command chooses the ROM and offset, and decompiles it.
The last PKSV command chooses the ROM and script, and compiles it again.
ps. only 25% of people download this from pokecommunity.com - the rest come from pokecommunity.com
__________________
Plz not to PM me, I don't come here often enough. Email if you need me

Last edited by score_under; July 15th, 2009 at 03:33 PM.
Closed Thread
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 10:15 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.