PHO - Pokémon Hackers Online
Go Back   PHO - Pokémon Hackers Online > Discussion Board > Archive

Notices

Archive Old threads that serve no purpose are here.

 
 
Thread Tools Display Modes
Old 20th January 2012, 01:34 AM   #1
Hopeless Masquerade
山の新人神様
Ex-Staff
 
Hopeless Masquerade's Avatar
 
Join Date: Oct 2012
Location: 守矢神社
Age: 21
Posts: 84
Hopeless Masquerade
Default Advanced Scripting - HMs

Advanced Scripting - HMs


In Pokemon, there are moves you can use in the overworld to further your adventure. Here, I'll be posting scripts that teach how these work, and how you can make your own. Also, if you use a custom script posted, please credit me.

Rock Smash



Normal (In-Game)


This is the Rock Smash script you find in-game.
Code:
#freespace 0xFF
#dynamic 0x800000

#org @start
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0 //A simple "release"
lockall
checkflag 0x825 // Check for badge.
if 0x0 goto @norm
checkattack 0xF9 // Check if a Poke has RockSmash
compare LASTRESULT 0x6
if 0x1 goto 0x81BE091
setanimation 0x0 LASTRESULT // Prepares the raising pokeball animation
bufferpartypokemon 0x0 LASTRESULT // Loads the name of our pokemon into memory.
bufferattack 0x1 0xF9 // Loads the name of Rock Smash into memory
msgbox 0x81BE09D MSG_YESNO //"This rock appears to be breakable...."
compare LASTRESULT 0x0
if 0x1 goto 0x81BE09A //Simple release.
msgbox 0x81BDFD7 MSG_KEEPOPEN //"[buffer1] used [buffer2]!"
closeonkeypress
doanimation 0x25 //Pokeball from Player Animation
waitstate
goto @break

#org @norm
msgbox 0x81BE0E2 MSG_SIGN //"It's a rugged rock, but a POK?MON\..."
end

//---------------
#org @break
applymovement LASTTALKED 0x81BE08F //In game defined movement for Rock Smash (break rock)
waitmovement 0x0
hidesprite LASTTALKED // Hides the rock we "talked" to
special 0xAB
compare LASTRESULT 0x0
if 0x1 goto 0x81BE08D //Another release
waitstate
releaseall
end


/* Messages - For Reference
#org 0x1BE09D
= This rock appears to be breakable.\nWould you like to use ROCK SMASH?

#org 0x1BDFD7
= [buffer1] used [buffer2]!

#org 0x1BE0E2
= It's a rugged rock, but a POK?MON\nmay be able to smash it.
*/

Using Item (Custom)


And this is a custom script that uses an item for the Rock Smash.

Code:
#freespace 0xFF
#dynamic 0x800000

#org @start
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0 //Use by most scripts in the game, is just a "release" and "end."
lockall
checkitem 0xXXX 0x1 //Insert item here.
compare LASTRESULT 0x0
if 0x1 goto @donthave
bufferitem 0x0 0xXXX //The item from before.
msgbox @m1 0x5
compare LASTRESULT 0x1
if 0x1 goto @break
releaseall
end

#org @donthave
msgbox @norm 0x6
releaseall
end

#org @break
msgbox @m2 0x6
sound 0x7C //Rock smash sound
applymovement LASTTALKED 0x81BE08F //Calls the in-game movement data for Rock Smash.
waitmovement 0x0
hidesprite LASTTALKED //Hides the rock.
special 0xAB //Wild pokemon battle?
compare LASTRESULT 0x0
if 0x1 goto 0x81BE08D //Just a "releaseall" and "end"
waitstate
releaseall
end

#org @norm
= It's a rugged rock, but a tool may\nbe able to smash it.

#org @m1
= This rock appears breakable.\nWould you like to use the\l[buffer1]?

#org @m2
= [player] used the [buffer1]!

How Do I Make It Work?!?


If you use either of these scripts, you'll notice that they do work. However, there's one problem. They rocks don't stay hidden! So, how do you fix it? It is quite simple, actually. In A-Map, after you have set the script, you go to "Person Id" property of the event, and set it to any value between 0011 and 001F, with each rock on the map having a unique id. By doing this, the rocks stay hidden!

Cut



Normal


This is how a normal cut script looks.
Code:
#dynamic 0x800000

// Cut script
#org @start
special 0x187 // Not sure what this does.
compare LASTRESULT 0x2
goto @abort
lockall
checkflag 0x821 // The flag for the CASCADEBADGE. Change if you want.
if 0x0 goto @nowork
checkattack 0xF // Check if any pokemon have the move
compare LASTRESULT 0x6
if 0x1 goto @nowork // No pokemon have the move
setanimation 0x0 LASTRESULT
bufferpartypokemon 0x0 LASTRESULT // Load the pokemon's name into memory
bufferattack 0x1 0xF // Load CUT's name into memory
msgbox 0x81BDF94 MSG_YESNO //"This tree looks like it can be CUT..."
compare LASTRESULT 0x0
if 0x1 goto @abort2
msgbox 0x81BDFD7 MSG_KEEPOPEN //"[buffer1] used [buffer2]!"
closeonkeypress
doanimation 0x2 // Do the cut animation
waitstate // Wait for its completion
goto @rest

#org @abort
release
end

#org nowork
msgbox 0x81BDFE3 MSG_SIGN // "This tree looks like it can be CUT..."
releaseall
end

#org @abort2
closeonkeypress
releaseall
end

#org @rest
applymovement LASTTALKED 0x81BDF85 // Makes the bush do the bush falling apart move
waitmovement 0x0 // Wait...
hidesprite LASTTALKED
releaseall
end

// :D

How Do I Make It Work?


To make the tree stay cut, you do the same thing you did to make the rock stay smashed. Sets its "Person ID" (in A-Map) to a value between 0011 and 001F.
Hopeless Masquerade is offline  
Sponsored Links
Old 20th January 2012, 02:21 AM   #2
Pia Carrot
Orange Developer
Administrator
 
Pia Carrot's Avatar
 
Join Date: Aug 2010
Location: Valencia Island
Age: 23
Posts: 811
Pia Carrot Pia Carrot Pia Carrot Pia Carrot Pia Carrot
Default

(Directed at me) Yay! Looking forward to the swimming script tutorial.
Pia Carrot is offline  
Old 20th January 2012, 02:22 AM   #3
Team Fail
Balance and Ruin
Ex-StaffStyle AdminstratorPHO VIP
 
Team Fail's Avatar
 
Join Date: Jul 2010
Posts: 564
Team Fail Team Fail Team Fail Team Fail Team Fail
Default

Modified thread title to user's request.

Useful little script! I'm guessing you can incorporate this into items?
__________________
twitter | dropbox | youtube | bro

Thank you for your time, PHO. I won't soon forget it.
Team Fail is offline  
Old 20th January 2012, 02:30 AM   #4
Hopeless Masquerade
山の新人神様
Ex-Staff
 
Hopeless Masquerade's Avatar
 
Join Date: Oct 2012
Location: 守矢神社
Age: 21
Posts: 84
Hopeless Masquerade
Default

Quote:
Originally Posted by Team Fail View Post
Modified thread title to user's request.

Useful little script! I'm guessing you can incorporate this into items?
It was written to specifically use an item.
Hopeless Masquerade is offline  
Old 20th January 2012, 05:12 AM   #5
Chrunch
Neophyte
 
Join Date: Apr 2012
Posts: 21
Chrunch
Default

Looks good. I'm sure it'll help a lot of people who don't know how to write a HM script or use some commands in HM scripts.
Chrunch is offline  
Old 20th January 2012, 05:14 AM   #6
zZJoennZz
desudesudesudeathdesu
 
zZJoennZz's Avatar
 
Join Date: Apr 2010
Location: Philippines
Age: 22
Posts: 74
zZJoennZz
Default

Sorry, I can't understand English too good so I'm gonna ask, this uses an item instead of pokemon with rock smash?
I'm new to scripting so...
__________________

...mehehehe
zZJoennZz is offline  
Old 20th January 2012, 08:08 AM   #7
Chrunch
Neophyte
 
Join Date: Apr 2012
Posts: 21
Chrunch
Default

Quote:
Originally Posted by zZJoennZz View Post
Sorry, I can't understand English too good so I'm gonna ask, this uses an item instead of pokemon with rock smash?
I'm new to scripting so...
Yes, it uses an item. :) The checkitem command in the script will check for an item, instead of a move.
Chrunch is offline  
Old 1st March 2012, 04:28 PM   #8
NTA
Newbie
 
NTA's Avatar
 
Join Date: Jul 2011
Posts: 5
NTA is on a distinguished road
Default

"#freespace 0xFF"

I've never seen this command before

What exactly do it do?
__________________
NTA is offline  
Old 1st March 2012, 07:14 PM   #9
Team Fail
Balance and Ruin
Ex-StaffStyle AdminstratorPHO VIP
 
Team Fail's Avatar
 
Join Date: Jul 2010
Posts: 564
Team Fail Team Fail Team Fail Team Fail Team Fail
Default

Unfortunately, this thread hasn't had a post in it in over a month, so this will have to be locked. agentgeo, I don't think you'll have any issues opening this back up though.

Closed.
__________________
twitter | dropbox | youtube | bro

Thank you for your time, PHO. I won't soon forget it.
Team Fail is offline  
Old 8th July 2012, 07:59 PM   #10
Hopeless Masquerade
山の新人神様
Ex-Staff
 
Hopeless Masquerade's Avatar
 
Join Date: Oct 2012
Location: 守矢神社
Age: 21
Posts: 84
Hopeless Masquerade
Default

Re-opened and Updated!
That's right, I've added information on Cut, as well as how to make Cut and Rock Smash work!

Next up, Surf!
Hopeless Masquerade is offline  
 

Tags
advanced, hms, scripting, [Tutorial]

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Complete ROM Hacking Guide - Scripting Part 1: Introduction To Scripting Linkandzelda Archive 0 11th October 2012 04:23 PM


All times are GMT. The time now is 01:03 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc. User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo.
Pokémon Hackers Online (PHO) is in no way affiliated with or endorsed by Nintendo LLC, Creatures, GAMEFREAK inc,
The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast.
All forum/site content (unless noted otherwise) and site designs are © 2006-2013 Pokémon Hackers Online (PHO).
Green Charizard Christos TreeckoLv100

"Black 2" by ARTPOP. Kyurem artwork by XOUS.

no new posts