Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Reload this Page [Tutorial] [ASM]Transparent Textboxes

Notices
For all updates, view the main page.

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.



Reply
 
Thread Tools
  #1    
Old November 11th, 2013 (04:03 AM).
ep!c ep!c is offline
Banned
 
Join Date: Mar 2013
Gender: Male
Posts: 124
Send a message via Skype™ to ep!c


Transparent Textboxes

Introduction

Hello everybody! Yes you read correctly: Today I'm gonna show you how to insert
half-transparent textboxes.. without bugs! You can even use a complete costum textbox
for intro, menu etc. without messing them up. This tutorial just requires basic knowledge of
scripting and hex-editing: maybe also palette understanding.

Let's get started

For this tutorial we need a few tools:
  • VisualBoyAdvance
  • Hex-Editor (I use HxD)
  • NamelessSpriteEditor
  • XSE
  • AdvanceMap
You will also need two Assembler-Snippets..
I always provide a compiled and uncompiled version.


Pro arguements for compiled:
  • No need to compile yourself
  • Easy if you don't have ASM skills
Pro arguements for uncompiled:
  • Use your own offsets (dont need to always follow the tut)
  • Try it out completely on yourself

In this tutorial we will use the compiled ASM snippets, meaning you must follow the offsets etc.
However, here are the files:
(Right click -> Save File as; dropbox links could bug a bit, so do this)


Inserting the ASM codes into your ROM

Open your activate.bin, your deactivate.bin and your ROM-file into a hex-editor (I use HxD)
Mark the whole activate.bin and paste it into your ROM at position 0x750020.

Spoiler:


Do the same with deactivate.bin but insert it to 0x750134 this time.

Spoiler:


Now you can save your file but do not close your hex-editor, we will need it later!

Creating a NPC in AdvanceMap + Script


Open AdvanceMap and go to your room. Create a NPC there.

Spoiler:


Now we will write a Script in XSE. It should be the following:

Spoiler:
Code:
#dynamic 0x800000
#org @start
callasm 0x750021
msgbox @text
callstd 2
callasm 0x750135
end

#org @text
= This is a test.



Spoiler:


After you have compiled it, copy the offset and insert it at your NPC.

Spoiler:


Are you ready for a test in Visual Boy Advance or No$GBA?
Open your ROM in it and speak to the NPC..
Damn, that looks crappy, doesn't it?

Spoiler:


The text doesn't even display.. ffs..

Final Step: Inserting the correct palette

Our game previously crashed, because my ASM code reads a palette, that
should be written to 0x750000. But there are only 0xFF bytes for us..
So we're gonna change that!
Firstly, open your hex-editor if you closed it before.
Just open your ROM-file.
At 0x750000, insert those bytes:

Spoiler:
Code:
2E530000FF7F0000FF7F0000FF7F0000FF7F0000000000000000000000000000


Smart guys will see, that this is a palette-structure.
Just mark 32 bytes (2 lines) and copy/paste these bytes in the spoiler above.

Spoiler:


Save your ROM and open your VBA, testing another time.
(Now i would recommend you to place the NPC OUTSIDE.
In the room there is a black outline-tile, which overlaps with the box.)

Spoiler:


Yeah, this **** finally worked!!

I hope you liked this tutorial and successfully inserted this hack.
It's really easy for everyone, just a bit hex-editing, but that's it.

If you use this hack in any way, give me credits.
When you don't do this, this will result in me deleting the tutorial, which would be bad for all.

~ep!c

Reply With Quote
  #2    
Old November 11th, 2013 (05:26 PM).
Lost Heart's Avatar
Lost Heart Lost Heart is offline
the better journalist
Crystal Tier
 
Join Date: Mar 2010
Age: 18
Gender: Other
Nature: Impish
Posts: 2,126
This is quite nice and all, but do you think it would be possible to see some source code?

Otherwise, great.
__________________
Reply With Quote
  #3    
Old November 11th, 2013 (05:37 PM).
kearnseyboy6's Avatar
kearnseyboy6 kearnseyboy6 is offline
Aussie's Toughest Mudder
 
Join Date: Dec 2008
Posts: 294
You are an asset to the Pokecommunity
__________________
HOLIDAYING CURRENTLY!!
Reply With Quote
  #4    
Old November 11th, 2013 (06:54 PM).
King Haxxo King Haxxo is offline
 
Join Date: Nov 2013
Gender: Male
Posts: 5
After I enter the code with HxD, I can't open any maps in the ROM, it just crashes every time I try. Any ideas?
__________________


Pokemon - Tainted Black
A darkness has fallen over Kanto... Will you be the one to vanquish it?
Reply With Quote
  #5    
Old November 11th, 2013 (07:06 PM). Edited November 11th, 2013 by awipe1.
awipe1's Avatar
awipe1 awipe1 is offline
 
Join Date: Aug 2012
Gender: Male
Posts: 213
This is perfect! I have yet to try it out but I will definitly be adding this to my game! Question though, does this cause any side effects?

EDIT: I tried it out and it works great! Only one problem though, the moment you finish the text and try to end it, the original coloured textbox pops up for like a frame or two. Anyway of fixing that? Or did I do something wrong?

EDIT AGAIN: So I have been playing around with it, and it seems to work fine. However two problems have been occuring.
1) I don't know why you added this 'callstd 2' to your script. It kinda just repeated the script twice. I took it out and it seems to be working fine.
2) At random times, at the end of the message box, it will return to its original colour for like a frame or two, so I don't know what's up with that.
__________________
Check out my Pokemon Rom! Click the Image Below!
Reply With Quote
  #6    
Old November 11th, 2013 (08:10 PM).
Renegade's Avatar
Renegade Renegade is offline
Time for real life...
 
Join Date: Nov 2011
Location: United States
Gender: Male
Nature: Careful
Posts: 998
Quote originally posted by awipe1:
EDIT AGAIN: So I have been playing around with it, and it seems to work fine. However two problems have been occuring.
1) I don't know why you added this 'callstd 2' to your script. It kinda just repeated the script twice. I took it out and it seems to be working fine.
2) At random times, at the end of the message box, it will return to its original colour for like a frame or two, so I don't know what's up with that.
I am having this same problem. When I finish talking to the NPC, the box disappears but then the original box (non-transparent) comes up for like .10101010 seconds then disappears.
Reply With Quote
  #7    
Old November 11th, 2013 (08:59 PM).
awipe1's Avatar
awipe1 awipe1 is offline
 
Join Date: Aug 2012
Gender: Male
Posts: 213
Quote originally posted by CrystalStatic:
I am having this same problem. When I finish talking to the NPC, the box disappears but then the original box (non-transparent) comes up for like .10101010 seconds then disappears.
Hopefully Ep!c can figure it out, I am trying everything I can overhere and still nothing! Other than that though, it looks great!
__________________
Check out my Pokemon Rom! Click the Image Below!
Reply With Quote
  #8    
Old November 11th, 2013 (10:13 PM). Edited November 12th, 2013 by ep!c.
ep!c ep!c is offline
Banned
 
Join Date: Mar 2013
Gender: Male
Posts: 124
Send a message via Skype™ to ep!c
Quote originally posted by agentgeo:
This is quite nice and all, but do you think it would be possible to see some source code?

Otherwise, great.
Just download the .asm file which is provided at the beginning. You can open it
with notepad.

Quote originally posted by kearnseyboy:
After I enter the code with HxD, I can't open any maps in the ROM, it just crashes every time I try. Any ideas?
I bet you just inserted the code?
Well, you must MARK 110 bytes in your ROM and then paste it, otherwise you
change the file-size of your ROM which messes all the pointers up!
(to say it easy, you must REPLACE not INSERT bytes )

Quote originally posted by awipe1:
Question though, does this cause any side effects?
No, it doesnt =) The whole palette is replaced with a custom for the ASM
code, so nothing is messed up fortunatly!

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

Hey guys, I tried playing my ROM at a better computer and you seem to be right, awipe.. The original textbox appears to come back
However, this is caused by my ASM snipped beeing faster than the closing routine of the textbox (thats what I guess for now)

FOR ALL XSE 1.1.1 USERS:
Write "msgbox @text 0x2" instead of "msgbox @text, callstd 0x2"!

I hope I can bring some update out thar in the evening =)


______________________________________________________________________________________________


Hey guys.
I have finally fixed this little issue that awipe1 found.
Links to the new deactivate.bin have been updated (or downlod it here now)

The new deactivation routine has the same bytes as the old, so just replace the old with the new, there shouldn't be any issues!
Reply With Quote
  #9    
Old November 12th, 2013 (07:39 AM).
awipe1's Avatar
awipe1 awipe1 is offline
 
Join Date: Aug 2012
Gender: Male
Posts: 213
Quote originally posted by ep!c:
Just download the .asm file which is provided at the beginning. You can open it
with notepad.



I bet you just inserted the code?
Well, you must MARK 110 bytes in your ROM and then paste it, otherwise you
change the file-size of your ROM which messes all the pointers up!
(to say it easy, you must REPLACE not INSERT bytes )



No, it doesnt =) The whole palette is replaced with a custom for the ASM
code, so nothing is messed up fortunatly!

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

Hey guys, I tried playing my ROM at a better computer and you seem to be right, awipe.. The original textbox appears to come back
However, this is caused by my ASM snipped beeing faster than the closing routine of the textbox (thats what I guess for now)

FOR ALL XSE 1.1.1 USERS:
Write "msgbox @text 0x2" instead of "msgbox @text, callstd 0x2"!

I hope I can bring some update out thar in the evening =)


______________________________________________________________________________________________


Hey guys.
I have finally fixed this little issue that awipe1 found.
Links to the new deactivate.bin have been updated (or downlod it here now)

The new deactivation routine has the same bytes as the old, so just replace the old with the new, there shouldn't be any issues!
Hey man, thanks a lot for taking our problems into consideration! That really makes me happy that you would go through that much trouble to help us!

One more request though? I did import the activate and deactivate by using ASM, I entered them using hex. So for example, in the activate part, I looked at the picture and started entering the numbers (1F B5 80 ...) At offset 750020.

I thought that way was easier because I know 0 knowledge on ASM. Do you think you can upload the hex values for the new deactivate bin (like you did for the palette). It would really help amature hackers like me out a lot! Thanks for your time man! Keep up the great work! I will for sure credit you when I use this in my ROM!
__________________
Check out my Pokemon Rom! Click the Image Below!
Reply With Quote
  #10    
Old November 12th, 2013 (07:56 AM).
ep!c ep!c is offline
Banned
 
Join Date: Mar 2013
Gender: Male
Posts: 124
Send a message via Skype™ to ep!c
You must just drag&drop or open your .bin in the hex-editor and copy the bytes of it
But hey, here are the values:

Activate:
Spoiler:
Code:
1FB580233F4C237010223F493F480BDF24483F21017024481F21017023484121017023483F21017022480F21017022480A2101702148FF2101702148FF2101702048002101702048002101701F48002101701F48002101701E48002101701E48002101701D48002101701D48002101701C48002101701C48002101701B48002101701B48002101701A48002101701A48002101701948002101701948002101701FBDC046480000044900000450000004510000045200000453000004DC770302DD770302DA770302DB770302DE770302DF770302EC770302ED770302EE770302EF770302F0770302F1770302F2770302F3770302F4770302F5770302F6770302F7770302C07A0302E001000500007508

Deactivate:
Spoiler:
Code:
1FB528481F21017027481F21017027484021017026481E21017026481021017025480021017025482921017024482521017024485A21017023486721017023481F21017022480021017022489C2101702148772101702148FF21017020487E2101702048332101701F487F2101701F48EF2101701E48722101701E48FF2101701D487F2101701D480E2101701C48532101701C4C10221C491C480BDF402323701FBDC046480000044900000450000004510000045200000453000004DC770302DD770302DA770302DB770302DE770302DF770302EC770302ED770302EE770302EF770302F0770302F1770302F2770302F3770302F4770302F5770302F6770302F7770302C07A0302E00100052C1E4708
Reply With Quote
  #11    
Old November 12th, 2013 (03:12 PM).
Renegade's Avatar
Renegade Renegade is offline
Time for real life...
 
Join Date: Nov 2011
Location: United States
Gender: Male
Nature: Careful
Posts: 998
Oh boy... I'm still having trouble with the original textbox coming up. The new deactivation ASM didn't work. Any ideas?
__________________
Reply With Quote
  #12    
Old November 12th, 2013 (04:38 PM).
Tide's Avatar
Tide Tide is offline
Nocturnal ROM Hacker
 
Join Date: Jul 2011
Location: Florida, United States
Gender: Male
Nature: Careful
Posts: 59
Send a message via Skype™ to Tide
Thanks for the tutorial, I found it to be extremely helpful in making the hack more graphically appealing - and I had little to no trouble with the process.

However, the black textbox overlapping indoors is a bit undesirable. So, I am wondering, how would I go about making the actual color of the transparent textbox different, like an "aquatic blue", rather than black?
Reply With Quote
  #13    
Old November 12th, 2013 (05:08 PM).
awipe1's Avatar
awipe1 awipe1 is offline
 
Join Date: Aug 2012
Gender: Male
Posts: 213
Quote originally posted by CrystalStatic:
Oh boy... I'm still having trouble with the original textbox coming up. The new deactivation ASM didn't work. Any ideas?
Yes I am sorry Ep!c but I am having the same problem as well! I have been testing it out and it seems completely random. However I see it mostly when I speed up the text.
__________________
Check out my Pokemon Rom! Click the Image Below!
Reply With Quote
  #14    
Old November 13th, 2013 (05:21 AM).
ep!c ep!c is offline
Banned
 
Join Date: Mar 2013
Gender: Male
Posts: 124
Send a message via Skype™ to ep!c
Fuu.. then it's really my PC thats so ass-lame xD (but i run VBA at 99 %..)
An "ugly" solution would be setting a "pause 0x3/0x4/0x5" after the msgbox and before the deactivation routine..

Quote:
However, the black textbox overlapping indoors is a bit undesirable. So, I am wondering, how would I go about making the actual color of the transparent textbox different, like an "aquatic blue", rather than black?
You can change the colors of our inserted palette at 0x750000 to dark-blue rather than black. Shouldn't be hard
Reply With Quote
  #15    
Old November 13th, 2013 (04:44 PM).
awipe1's Avatar
awipe1 awipe1 is offline
 
Join Date: Aug 2012
Gender: Male
Posts: 213
Quote originally posted by ep!c:
Fuu.. then it's really my PC thats so ass-lame xD (but i run VBA at 99 %..)
An "ugly" solution would be setting a "pause 0x3/0x4/0x5" after the msgbox and before the deactivation routine..
Well that's a nice little solution for now, but do you know of any other solutions? I don't want to slow down my game just for transparent text boxes There has to be something that can prevent this. I might try out the pause 0x1 thing, but we will see.
__________________
Check out my Pokemon Rom! Click the Image Below!
Reply With Quote
  #16    
Old November 13th, 2013 (10:03 PM).
ep!c ep!c is offline
Banned
 
Join Date: Mar 2013
Gender: Male
Posts: 124
Send a message via Skype™ to ep!c
Well I actually dont want to set pause 0xY too :D
I will definitly give an update on this, probably today if I find time.
Reply With Quote
  #17    
Old November 13th, 2013 (10:39 PM).
awipe1's Avatar
awipe1 awipe1 is offline
 
Join Date: Aug 2012
Gender: Male
Posts: 213
Quote originally posted by ep!c:
Well I actually dont want to set pause 0xY too :D
I will definitly give an update on this, probably today if I find time.
Alright thanks a lot! I'm looking forward to seeing the results!
__________________
Check out my Pokemon Rom! Click the Image Below!
Reply With Quote
  #18    
Old November 13th, 2013 (11:26 PM).
ep!c ep!c is offline
Banned
 
Join Date: Mar 2013
Gender: Male
Posts: 124
Send a message via Skype™ to ep!c
YAY ITS FINALLY FIXED!! :D

SOURCE: here.
BIN:
Spoiler:
1F B5 26 48 1F 21 01 70 25 48 1F 21 01 70 25 48 40 21 01 70 24 48 1E 21 01 70 24 48 10 21 01 70 23 48 00 21 01 70 23 48 29 21 01 70 22 48 25 21 01 70 22 48 5A 21 01 70 21 48 67 21 01 70 21 48 1F 21 01 70 20 48 00 21 01 70 20 48 9C 21 01 70 1F 48 77 21 01 70 1F 48 FF 21 01 70 1E 48 7E 21 01 70 1E 48 33 21 01 70 1D 48 7F 21 01 70 1D 48 EF 21 01 70 1C 48 72 21 01 70 1C 48 FF 21 01 70 1B 48 7F 21 01 70 1B 48 0E 21 01 70 1A 48 53 21 01 70 1A 4C 40 23 23 70 1F BD C0 46 48 00 00 04 49 00 00 04 50 00 00 04 51 00 00 04 52 00 00 04 53 00 00 04 DC 77 03 02 DD 77 03 02 DA 77 03 02 DB 77 03 02 DE 77 03 02 DF 77 03 02 EC 77 03 02 ED 77 03 02 EE 77 03 02 EF 77 03 02 F0 77 03 02 F1 77 03 02 F2 77 03 02 F3 77 03 02 F4 77 03 02 F5 77 03 02 F6 77 03 02 F7 77 03 02 C0 7A 03 02


This time the deactivation routine is 100 bytes long. Replace it with the old!
GLHF!
Reply With Quote
  #19    
Old November 14th, 2013 (04:56 PM).
awipe1's Avatar
awipe1 awipe1 is offline
 
Join Date: Aug 2012
Gender: Male
Posts: 213
Quote originally posted by ep!c:
YAY ITS FINALLY FIXED!! :D

SOURCE: here.
BIN:
Spoiler:
1F B5 26 48 1F 21 01 70 25 48 1F 21 01 70 25 48 40 21 01 70 24 48 1E 21 01 70 24 48 10 21 01 70 23 48 00 21 01 70 23 48 29 21 01 70 22 48 25 21 01 70 22 48 5A 21 01 70 21 48 67 21 01 70 21 48 1F 21 01 70 20 48 00 21 01 70 20 48 9C 21 01 70 1F 48 77 21 01 70 1F 48 FF 21 01 70 1E 48 7E 21 01 70 1E 48 33 21 01 70 1D 48 7F 21 01 70 1D 48 EF 21 01 70 1C 48 72 21 01 70 1C 48 FF 21 01 70 1B 48 7F 21 01 70 1B 48 0E 21 01 70 1A 48 53 21 01 70 1A 4C 40 23 23 70 1F BD C0 46 48 00 00 04 49 00 00 04 50 00 00 04 51 00 00 04 52 00 00 04 53 00 00 04 DC 77 03 02 DD 77 03 02 DA 77 03 02 DB 77 03 02 DE 77 03 02 DF 77 03 02 EC 77 03 02 ED 77 03 02 EE 77 03 02 EF 77 03 02 F0 77 03 02 F1 77 03 02 F2 77 03 02 F3 77 03 02 F4 77 03 02 F5 77 03 02 F6 77 03 02 F7 77 03 02 C0 7A 03 02


This time the deactivation routine is 100 bytes long. Replace it with the old!
GLHF!
PERFECT!! I can't wait to try this out! Don't forget to change it in the actual tutorial as well!

I am not at home currently but I will try it when I get home!
__________________
Check out my Pokemon Rom! Click the Image Below!
Reply With Quote
  #20    
Old November 14th, 2013 (09:01 PM).
Renegade's Avatar
Renegade Renegade is offline
Time for real life...
 
Join Date: Nov 2011
Location: United States
Gender: Male
Nature: Careful
Posts: 998
Quote originally posted by ep!c:
YAY ITS FINALLY FIXED!! :D

SOURCE: here.
BIN:
Spoiler:
1F B5 26 48 1F 21 01 70 25 48 1F 21 01 70 25 48 40 21 01 70 24 48 1E 21 01 70 24 48 10 21 01 70 23 48 00 21 01 70 23 48 29 21 01 70 22 48 25 21 01 70 22 48 5A 21 01 70 21 48 67 21 01 70 21 48 1F 21 01 70 20 48 00 21 01 70 20 48 9C 21 01 70 1F 48 77 21 01 70 1F 48 FF 21 01 70 1E 48 7E 21 01 70 1E 48 33 21 01 70 1D 48 7F 21 01 70 1D 48 EF 21 01 70 1C 48 72 21 01 70 1C 48 FF 21 01 70 1B 48 7F 21 01 70 1B 48 0E 21 01 70 1A 48 53 21 01 70 1A 4C 40 23 23 70 1F BD C0 46 48 00 00 04 49 00 00 04 50 00 00 04 51 00 00 04 52 00 00 04 53 00 00 04 DC 77 03 02 DD 77 03 02 DA 77 03 02 DB 77 03 02 DE 77 03 02 DF 77 03 02 EC 77 03 02 ED 77 03 02 EE 77 03 02 EF 77 03 02 F0 77 03 02 F1 77 03 02 F2 77 03 02 F3 77 03 02 F4 77 03 02 F5 77 03 02 F6 77 03 02 F7 77 03 02 C0 7A 03 02


This time the deactivation routine is 100 bytes long. Replace it with the old!
GLHF!
Finally, thank you. It works perfectly
Reply With Quote
  #21    
Old November 15th, 2013 (12:22 AM).
ep!c ep!c is offline
Banned
 
Join Date: Mar 2013
Gender: Male
Posts: 124
Send a message via Skype™ to ep!c
In order to make YES/NO boxes or showpokepics (for mugshots) transparent, use a new activation routine: here!
This routine is unfortunatly 110 bytes long, so you must move your deactivation routine to another place.. in this example I moved it just right behind the activation routine:
Spoiler:

This results in a new deactivation offset, 750138 (in script callasm 0x750139; +1)

Here you see some screens =)

Spoiler:


I ****ed up Y-axis xD// use 0x4 for Y-coordinate for showpokepic.
Reply With Quote
  #22    
Old November 15th, 2013 (05:37 AM).
Renegade's Avatar
Renegade Renegade is offline
Time for real life...
 
Join Date: Nov 2011
Location: United States
Gender: Male
Nature: Careful
Posts: 998
Quote originally posted by ep!c:
In order to make YES/NO boxes or showpokepics (for mugshots) transparent, use a new activation routine: here!
This routine is unfortunatly 110 bytes long, so you must move your deactivation routine to another place.. in this example I moved it just right behind the activation routine:
Spoiler:

This results in a new deactivation offset, 750138 (in script callasm 0x750139; +1)

Here you see some screens =)

Spoiler:


I ****ed up Y-axis xD// use 0x4 for Y-coordinate for showpokepic.
This one works as well! And what's better is it covers for the old activation code so the showpokepic and yes/no boxes don't have to be called separately from the regular message box. I give it a 5/5
Reply With Quote
  #23    
Old November 15th, 2013 (05:46 AM).
ep!c ep!c is offline
Banned
 
Join Date: Mar 2013
Gender: Male
Posts: 124
Send a message via Skype™ to ep!c
Thanks
If you want, you can also suggest other things
Reply With Quote
  #24    
Old November 15th, 2013 (06:22 AM).
awipe1's Avatar
awipe1 awipe1 is offline
 
Join Date: Aug 2012
Gender: Male
Posts: 213
Quote originally posted by ep!c:
Thanks
If you want, you can also suggest other things
Lol well do you know how to add more pokedex slots? Because that sure would be nice I don't think there is a tutorial on that yet and I want to add 25 new pokemon that can be caught, however I don't have any pokedex slots for them

If you could make a tutorial on that, that would be great!
__________________
Check out my Pokemon Rom! Click the Image Below!
Reply With Quote
  #25    
Old November 15th, 2013 (06:47 AM).
ep!c ep!c is offline
Banned
 
Join Date: Mar 2013
Gender: Male
Posts: 124
Send a message via Skype™ to ep!c
If its possible without any further engine hack, sure.
But my question belonged to Transparency xD
Reply With Quote
Reply
Quick Reply

Sponsored Links

You may also like.. (Beta)
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

Forum Jump


All times are UTC -8. The time now is 12:25 AM.