Jump to content

Loading MP textures


bolmin
 Share

Recommended Posts

Hi, I was wandering is it possible to load multiplayer textures? I attached how I load singleplayer textures, which works fine most of the time. Screenshot_54.png.b8873ba81f9fdb3375217b33e4dc1fe3.png

The problem is that some singleplayer textures just do not work, this includes mostly everything outside of ui_textures.rpf so for example stuff from uI_hud.rpf doesn't work. The other thing is that ui_textures_mp.rpf doesn't work either, so I am curious is it the same thing as with the online weapons, that they can't be loaded without memory manipulation.

Edited by bolmin
Link to comment
Share on other sites

They do work, dont let the engine decide when to unload the textures until you are done with them for starters, im using a ton of mp textures from hud and blips to social club ones, and even some leftovers from gta online. 

Being biased of course since im the creator but you can much faster test textures by using scripts in the map editor and make changes in realtime i made a really quick test with a mix of sp/mp textures:

 

2.jpg

3.jpg

chai.jpg

  • Like 1
Link to comment
Share on other sites

For me atleast its a massive time saver when i can create new ui without the need of compiling or restarting the game.

Works pretty much as c++ and you can test any texture really quickly to see if they work and easily move it in to your own mod heres what it takes to display a texture:

// Dict, Texture, x, y, size_x, size_y, heading, r, g, b, a
DrawTexture("blips","blip_ambient_secret", 0.565f, 0.5f, 0.035f, 0.035f, 0, 255, 255, 255, 255);

 

  • Like 2
Link to comment
Share on other sites

Screenshot_56.png.e9200dd1d74033ef91de99e30d062a84.png

I used this and here are the results:Screenshot_55.thumb.png.08689423b67ea040891415ffd46d3b68.png

So the texture doesn't load and I removed the lines about unloading the textures. What am I doing wrong?

Edited by bolmin
Link to comment
Share on other sites

DrawTexture("inventory_items_mp", "kit_camp_wilderness", 0.5f, 0.5f, 0.1f, 0.2f, 0.0f, 255, 255, 255, 255);

It works fine a few tips: Always and i mean always use curly brakets for any statement you make. Also make sure to use literals on all your floats.
 

Untitled.jpg

  • Like 1
Link to comment
Share on other sites

Read my post again, there is no magic involved its all basic stuff check if the dictionary is loaded if not request it, if it is loaded draw the sprite.

Had a quick look again and i see your issue..check the image.


 

//Example
if (TEXTURE::HAS_STREAMED_TEXTURE_DICT_LOADED("inventory_items_mp")) {
  GRAPHICS::DRAW_SPRITE("inventory_items_mp", "kit_camp_wilderness", 0.5f, 0.5f, 0.1f, 0.2f, 0.0f, 255, 255, 255, 255, 0);
} else {
  TEXTURE::REQUEST_STREAMED_TEXTURE_DICT("inventory_items_mp", 0);
}

 

Screenshot_54.png.b8873ba81f9fdb3375217b33e4dc1fe3.png

Edited by Lambda
  • Thanks 1
Link to comment
Share on other sites

Ohhh I see it now. I am not gonna lie, this code was an example I found somewhere, I simply pasted it and since it worked I didn't tweak with it. Thank you so much!!! I have no idea how I didn't pay attention that the TEXTURE_DICT_LOADED reffered to sprite, but in the NO_LONGER_NEEDED there was category.

Edited by bolmin
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...