The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Other Adding Portable Clock on Ruby (https://www.pokecommunity.com/showthread.php?t=352231)

bitelaserkhalif July 14th, 2015 6:10 PM

Adding Portable Clock on Ruby
 
Guys, I have the problem about clock.

Here it goes:
I want to make portable clock (usable outside of your house, and on your bag). I used THIS patch (gbatemp.net).
The clock reset and view script is like this:
Spoiler:

#org 0x8800000
'-----------------------------------
lockall
setvar 0x8004 0x0
msgbox 0x8800100 ' Would you like to re...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT YES
if == jump 0x8800200 ' Equal To
msgbox 0x8800300 ' Would you like to vi...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT YES
if == jump 0x81B6A91 ' Equal To
releaseall
end

#org 0x8800200
'-----------------------------------
call 0x81B6A9B
pause 0x1E
releaseall
end

#org 0x81B6A9B
'-----------------------------------
fadescreen FADEOUT_BLACK
special 0x9A
waitspecial
return

#org 0x81B6A91
'-----------------------------------
CMD_C3 0x2D
fadescreen FADEOUT_BLACK
special 0x9B
waitspecial
releaseall
end


#org 0x8800100
= Would you like to reset the clock?

#org 0x8800300
= Would you like to view the time?


But However after I edits a ???????? item between Contest Pass and Wailmer Pail with G3TOOLS , The game froze when I use Clock!
So far, I did this
Spoiler:

Field Script : 800000 (Look Above, just ignore another 8)
Description : 42D4FF (Is This the correct time?)



Please Help me! Is there's something wrong with the script or I need to make another script?

esperance July 14th, 2015 8:31 PM

That would be because scripts cannot be run by default from the "field usage" property. That property is so the engine can call an ASM function for the usage.
If you want to run a script, you'll need to write some ASM that calls and executes the script. There may be some existing code out there, but given you're using Ruby... it may be difficult to find.

If you don't even know what I mean by this, well... your clock isn't going to happen.

bitelaserkhalif July 15th, 2015 6:01 PM

Quote:

Originally Posted by Lost Heart (Post 8846883)
That would be because scripts cannot be run by default from the "field usage" property. That property is so the engine can call an ASM function for the usage.
If you want to run a script, you'll need to write some ASM that calls and executes the script. There may be some existing code out there, but given you're using Ruby... it may be difficult to find.

If you don't even know what I mean by this, well... your clock isn't going to happen.

Thank you. I would replace the clock with something other than that instead.

EDIT:
I meant something like a Contest Pass or a ticket, it would be easy.


All times are GMT -8. The time now is 2:29 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 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 - 2016 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.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.