multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.41k stars 438 forks source link

Can't apply shader to platecharset! (replace veh plate font) #959

Open MrSol0 opened 5 years ago

MrSol0 commented 5 years ago

Describe the bug

replacing vehicles plate font. MTA doesn't see platecharset texture (using shader_tex_names), so we can't replace it with better font (this font is really saved as .png and it is placed in vehicles.txd

To reproduce

1- Try replace the texture with shader won't work because it's not a world texture, but GTA SA converts the characters from platecharset to world texture "Plate" for each vehicle. or at least that's how i think it works.

Expected behaviour

expected to be able to change "platecharset" and change the fonts and the characters foe other languages and make some cool realistic car plates.

Screenshots

https://community.multitheftauto.com/images/gallery/vehicleflagplate/9498.png ( this was an attempt to replace the carplate but can only change the carplate texture.

Version ALL

Additional context From mantis 8370.

Pirulax commented 2 years ago

Hey! Quite an old issue, but I've found the culprit: GTA locks the raster as soon as it's loaded (CCustomCarPlateMgr::Initialise). This explains why replacing it doesn't affect the displayed charset. Fixing it should be pretty easy (unlock old raster, relock new raster). I'll fix it in a few days, unless I forget about it, in which case, please remind me.

Note: Because GTA hardcoded the charset texture size you must use the same size as GTA does.

Edit: I think you can't see it in shader_tex_names because it's not on any world object, but I think its loaded all the time (so replacing it should be possible, its just that it has no effect)

Fernando-A-Rocha commented 3 weeks ago

Hey reminder that u forgot this easy fix @Pirulax xD