Author Message

Viper4K

pl
Posts: 10

Location: Poland
Occupation:
Age: 25
V$:
#1   2015-11-24 18:15          
Hey all!

I'm type of person who wants to fix problems myself, but this one... I just can't do it. And i need help.
So, my problem is: i can't place custom textures at submenu's (like options, in game menu, track selector).

They all use main menu's texture. What i want to do is placing different textures on each (options have one texture,
track selector - other etc.) I found which line in .java file is responsible for it. It's
Now i just need to replace it. But how?
I need help!

Please!

4K

RedCarDriver

us
Posts: 1211

Location: United States Arizona
Occupation: it's complicated... more complicated than my relationships
Age: 30
V$: 86310
#2   2015-11-24 19:17          
Are you making sure to save the backgrounds to the same file format as they were originally? If you're replacing a PNG or DDS image with a JPG or BMP image, it's not going to work - because it's looking for one with the exact same name, not just the front part that Windows usually shows you.

In order to make sure you're getting this right: in any window, go to Tools -> Folder Options -> View tab and un-check "Hide file extensions for known file types", and click OK. This should make the extensions show up.

Viper4K

pl
Posts: 10

Location: Poland
Occupation:
Age: 25
V$:
#3   2015-11-24 20:39          
I know that. I just can't make new backgrounds for submenus like options, track selector etc.

Here's link to what my trouble looks like:
4K

RedCarDriver

us
Posts: 1211

Location: United States Arizona
Occupation: it's complicated... more complicated than my relationships
Age: 30
V$: 86310
#4   2015-11-24 21:11          
Oh. Okay, I misunderstood the problem you were having. Sorry.

Okay: RID_GENERALBG is "Resource ID for the general background". This is a named constant that's defined somewhere in the java sources. You can define your own constants. Check these lines from my painter script:

	final static int RID_BACKGROUND = frontend:0x00C0r;
	final static int RID_BACKGROUND_RGB = frontend:0x0AC0r;

The top one was there originally; the second one is one I wrote. I edited frontend.rpk to create the entry with the ID "0x00000AC0", which is the background for the RGB mode in the painter. If you want multiple backgrounds, you're going to have to edit your frontend.rpk to add them in. (Remember to use resdecode/resconvert, obviously.)

Viper4K

pl
Posts: 10

Location: Poland
Occupation:
Age: 25
V$:
#5   2015-11-24 21:40          
Painter script... It's one of few that i didn't checked xD

Huge thanks to you! You're legend! :)) :)) :awesome:

Added 1 hour 1 minute later:

One more question, if you don't mind...

Is there possibility to add new entry in java file? If there is, how should i do that?

This post was edited by Viper4K (2015-11-24 22:41, ago)
4K

RedCarDriver

us
Posts: 1211

Location: United States Arizona
Occupation: it's complicated... more complicated than my relationships
Age: 30
V$: 86310
#6   2015-11-24 22:58          
Not sure what you mean. If you mean a new .java file, I made PainterExtensions.java - it wasn't in the game originally - and I didn't need to put it into any RPK in order to make it work.

Viper4K

pl
Posts: 10

Location: Poland
Occupation:
Age: 25
V$:
#7   2015-11-24 23:04          
Oh wait - i just found one thing, which makes things harder...
My code is not RID_BACKGROUND, it's RID_GENERALBG... Damn.
4K

RedCarDriver

us
Posts: 1211

Location: United States Arizona
Occupation: it's complicated... more complicated than my relationships
Age: 30
V$: 86310
#8   2015-11-24 23:18          
You can do that, but you need to have defined RID_BACKGROUND in the file. (You can't redefine RID_GENERALBG; it's defined in another file or something.)

If you need another thing, change RID_GENERALBG to, like, RID_OPTIONSBG for the options menu.

You'll also have to add something to the subroutine that builds each menu to change the background, but doing that isn't really something I could walk you through.

Viper4K

pl
Posts: 10

Location: Poland
Occupation:
Age: 25
V$:
#9   2015-11-24 23:27          
Idk if you misunderstood, or i am just dumb, but i have defined somewhere RID_GENERALBG. That's what worries me (it's nowhere to be found)
Also, if i edit RID_BACKGROUND, and try to change it with RID_GENERALBG in options, it gives me crash on start.

Added 4 minutes later:

also, there's code from fontend for main menu pic:
<FILE 00000190.res >
typeof	7
superid	0x00000003
typeid	0x00000016
alias	gps_racesetup
isparentcompatible	1.00
</FILE>
<FILE 00000190.rsd >
sourcefile frontend\textures\GPS_FrameRaceSetup.png
</FILE>

Now, i would like to make new entry (define for example RID_OPTIONSBG, would be simple to put). How to do that? (is it even possible without big skills?)
4K

RedCarDriver

us
Posts: 1211

Location: United States Arizona
Occupation: it's complicated... more complicated than my relationships
Age: 30
V$: 86310
#10   2015-11-25 00:45          
Yes. I think you're confusing the two separate things that you have to do, with just being one thing, though.

You have to do two steps.

First, edit the RPK, and make a copy of one of those things you quoted. Change the typeid ("typeid 0x00000016") in your copy to something else, and remember that ID.

Then, go into your MainMenu.java file and make a copy of this line (which I'm making up, but somewhere in the code there has to be something that looks like this):
	final static int RID_GENERALBG = frontend:0x00C0r;
...except with GENERALBG changed for whatever name you want, and "0x00C0r;" changed for "[YOUR NEW TEXTURE TYPEID]r;". This should go at the top of the Java file with the rest of the lines that say "final static int".

Viper4K

pl
Posts: 10

Location: Poland
Occupation:
Age: 25
V$:
#11   2015-11-25 07:15          
I have some time before school, and i checked option java files again. Guess what i found?
	final static ResourceRef	RID_GENERALBG = new ResourceRef( frontend:0x0016r );

It was right on top!
Well... At least now i did it!

Huuuuge thanks to you!

This post was edited by Viper4K (2015-11-25 07:23, ago)
4K

RedCarDriver

us
Posts: 1211

Location: United States Arizona
Occupation: it's complicated... more complicated than my relationships
Age: 30
V$: 86310
#12   2015-11-26 01:28          
You're welcome! Congratulations on getting it done.

Viper4K

pl
Posts: 10

Location: Poland
Occupation:
Age: 25
V$:
#13   2015-11-26 13:53          
:D
4K