Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

How to import JPEG or PNG into the map?


emmyidk
 Share

Recommended Posts

emmyidk

I need to import a picture into the map... I know you can make custom skins and stuff, I feel like this would be simpler.

Like literally just a big picture in the sky.

Im using ScriptHookDotNet

Link to comment
Share on other sites

On 4/25/2022 at 1:42 AM, emmyidk said:

I need to import a picture into the map... I know you can make custom skins and stuff, I feel like this would be simpler.

Like literally just a big picture in the sky.

Im using ScriptHookDotNet

 

Create a custom prop, apply UV mapping and the texture to it in 3DS Max, export the prop and the ytyp file, add it to a custom maps/props dlc and spawn that prop in the sky.

 

You can't just make an image appear in the sky, there has to be something the image is applied to.

Link to comment
Share on other sites

  • 3 weeks later...
emmyidk
On 4/28/2022 at 4:40 AM, LeeC22 said:

 

Create a custom prop, apply UV mapping and the texture to it in 3DS Max, export the prop and the ytyp file, add it to a custom maps/props dlc and spawn that prop in the sky.

 

You can't just make an image appear in the sky, there has to be something the image is applied to.

 

@LeeC22

I dont have 3DS Max and I am not familiar with the other stuff you mentioned...

I have hit up sooo many other modders and they always put it at the bottom of their priorities!

I literally just need a big picture floating in the sky: no collision, no doublesided

Could you do this for me?

I will p** you good m**** for it

Link to comment
Share on other sites

LeeC22
Posted (edited)
40 minutes ago, emmyidk said:

 

@LeeC22

I dont have 3DS Max and I am not familiar with the other stuff you mentioned...

I have hit up sooo many other modders and they always put it at the bottom of their priorities!

I literally just need a big picture floating in the sky: no collision, no doublesided

Could you do this for me?

I will p** you good m**** for it

 

Depending on how big you want it, you could spawn v_ilev_cin_screen, which is the screen used in the cinemas. That has a texture in it (script_rt_cinscreen) that can be used as a Rendertarget, meaning you can display custom images on it via script.

 

Most modders won't take these things on because they never run as smoothly as you'd think they should. I would suggest that if you are a scripter, start with the cinema screen and check the thread I made here https://gtaforums.com/topic/982201-tutorial-custom-props-and-rendertargets/ for some info about using Rendertargets. You have to remember though that you can't scale props, so whatever size you have something, that's as big as it will get without making a bigger version... and that's where the problems can start when it becomes "Can you just make it a bit bigger" or "It needs to be wider" etc...

 

If you need to try and get an idea of how big a screen you would need, use the Native DRAW_POLY to draw some rectangles to get an idea. That native draws a poly between 3 points, so using it twice will draw a rectangle. You can't draw images on it but it will give you a scale to think about.

Edited by LeeC22
Link to comment
Share on other sites

emmyidk
3 minutes ago, LeeC22 said:

 

Depending on how big you want it, you could spawn v_ilev_cin_screen, which is the screen used in the cinemas. That has a texture in it (script_rt_cinscreen) that can be used as a Rendertarget, meaning you can display custom images on it via script.

 

Most modders won't take these things on because they never run as smoothly as you'd think they should. I would suggest that if you are a scripter, start with the cinema screen and check the thread I made here for some info about using Rendertargets. You have to remember though that you can't scale props, so whatever size you have something, that's as big as it will get without making a bigger version... and that's where the problems can start when it becomes "Can you just make it a bit bigger" or "It needs to be wider" etc...

 

If you need to try and get an idea of how big a screen you would need, use the Native DRAW_POLY to draw some rectangles to get an idea. That native draws a poly between 3 points, so using it twice will draw a rectangle.

@LeeC22

Thats very interesting, I never knew that!

If it makes any difference the image is just a black and white checkerboard pattern with a white border around it.

I have heard from other modders that there is a checkerboard texture that could be used to replicate it.

The white border around it is pretty straightforward as well.

Does this provide me with any alternatives?

 

btw I like your youtube videos!

Link to comment
Share on other sites

LeeC22
Posted (edited)
15 minutes ago, emmyidk said:

@LeeC22

Thats very interesting, I never knew that!

If it makes any difference the image is just a black and white checkerboard pattern with a white border around it.

I have heard from other modders that there is a checkerboard texture that could be used to replicate it.

The white border around it is pretty straightforward as well.

Does this provide me with any alternatives?

 

btw I like your youtube videos!

 

There is a checkerboard texture but it's just a 2x2 grid of white - black, then black - white as far as I remember. The problem with that is you would have to draw it as a sprite multiple times to fill the area. You would be better off creating a full screen texture that matches the aspect ratio of whatever you are drawing to and then just drawing that once.

 

Whatever option you choose, to get anyone interested in creating what you need, you're going to have to be far more precise than "I need a big picture in the sky". You are going to have to work out how far away it needs to be displayed to get an idea of how big it needs to be. a 100m wide screen might seem pretty big, unless it has to be visible from 2km away, in which case it's going to be tiny. So you need to come up with some sizes for scale and some aspect ratio details if you need the option to have it display images from a certain source (i.e. 1920x1080 game screenshots for instance). That's why I say, play with the cinema screen to get some ideas about things. You can create a custom ytd file with your texture in it and put it in mods\update\update.rpf\x64\textures\script_txds.rpf\, that will let you use the texture as a Sprite.

 

Do some experimentation and then come back with some more specific info if the screen doesn't do what you need. SHVDN can draw custom sprites, you just give it the ytd name as the texture library and the texture name as the image you want to draw. It was called a UISprite in SHVDN v2 but it might be different if you are using SHVDN 3.

Edited by LeeC22
Link to comment
Share on other sites

emmyidk
5 minutes ago, LeeC22 said:

That's why I say, play with the cinema screen to get some ideas about things.

The problem with the cinema screen is that it is curved:

https://gta-objects.xyz/objects/v_ilev_cin_screen

I need the picture to be flat in-game.

 

7 minutes ago, LeeC22 said:

You would be better off creating a full screen texture that matches the aspect ratio of whatever you are drawing

I'm not familiar with creating textures like this. How would I go about this?

Link to comment
Share on other sites

LeeC22
Posted (edited)
2 hours ago, emmyidk said:

The problem with the cinema screen is that it is curved:

https://gta-objects.xyz/objects/v_ilev_cin_screen

I need the picture to be flat in-game.

 

I'm not familiar with creating textures like this. How would I go about this?

 

Here's a 7z file with two textures to give you an example. https://drive.google.com/file/d/1PntDmaBqzi70VWMTRtJP_Ze1jXl5wJCe/view?usp=sharing

 

There is a 2048x1024 and 1024x512 version. Both of those are scaled from a 16:9 aspect ratio size, so if you draw it to a 16:9 screen, the squares should actually be square. In other words, if the screen model was 192 x 108 metres, that texture would fit and scale properly.

 

I made the dimensions based on power-of-two values as that is the most memory efficient way of doing it.

 

If any of this is confusing let me know, I'm not so good at explaining things clearly these days. :blush:

 

Edit: 192m x 108m from 200m away... just to give you an idea of scale.

 

big-screen.jpg

Edited by LeeC22
Link to comment
Share on other sites

LeeC22
Posted (edited)

Annnnnndddddd... here's a 7z file with everything you need to create the above image, because I can just never end up doing half the job. :sad:

 

https://drive.google.com/file/d/1ciBPskRkNGLZak_EXXIn-JjI0HcmDUHo/view?usp=sharing

 

Inside this file are 4 things:

1) prop_big_screen_01.ydr which is the 192m x 108m prop. The screen material is set as Emissive, so it lights up at night.

2) script_sprites.ytd containing the two textures I linked above. This goes into either mods\update\update.rpf\x64\textures\script_txds.rpf\ or into your own custom props rpf file

3) prop_big_screen_01.ytyp.xml an XML file containing the ytyp entry for the prop. I don't know if the flags are correct for it but it appears so they can't be too wrong I guess.

4) cRendertargetTest.cs a script which spawns the screen when you enter the cheat "renderme". It is set to spawn the prop at an offset from the player 200m on the Y and 10m up on the Z.

 

I don't know why but it isn't appearing where I would expect it to appear because the prop is 102m high, so I would expect the Z offset to be 51m but that makes it much higher. It's as if the origin is at the bottom but the model and bone are in the centre, so I don't know what is going wrong.

 

Edit: Just something to consider... using SHVDN's UISprite will probably reduce the resolution of the sprite to 1280x720. If you use the actual DRAW_SPRITE natives, it will probably use 1920x1280... maybe. I'm tired and guessing at this point, so treat that as mere speculation as I have never got round to testing that theory.

Edited by LeeC22
Link to comment
Share on other sites

emmyidk
3 hours ago, LeeC22 said:

here's a 7z file with everything you need to create the above image

Oh my god this is incredible thank you!

I really appreciate it!

I'm havin some trouble installing it... I'm used to installing regular dlc.rpf mods from gta-mods.com

where do you use the ydr and the ytyp.xml file?

Link to comment
Share on other sites

LeeC22
Posted (edited)
6 hours ago, emmyidk said:

Oh my god this is incredible thank you!

I really appreciate it!

I'm havin some trouble installing it... I'm used to installing regular dlc.rpf mods from gta-mods.com

where do you use the ydr and the ytyp.xml file?

 

Create a custom props or maps dlc.rpf and put them into that... there are even tools to make that part easy. https://www.gta5-mods.com/tools/dlc-pack-creator

 

Edit: And the ytyp.xml file is only called that because the ytyp tool in 3DS Max outputs xml format files. Inside the game they are just called ytyp files and you would normally just copy the single entry for a prop into an existing ytyp file. I don't know if that ytyp file will work as-is because I have a custom props dlc for stuff like this... it should do though.

Edited by LeeC22
Link to comment
Share on other sites

  • 3 weeks later...
emmyidk
On 5/18/2022 at 12:00 AM, LeeC22 said:

 

Create a custom props or maps dlc.rpf and put them into that... there are even tools to make that part easy. https://www.gta5-mods.com/tools/dlc-pack-creator

 

Edit: And the ytyp.xml file is only called that because the ytyp tool in 3DS Max outputs xml format files. Inside the game they are just called ytyp files and you would normally just copy the single entry for a prop into an existing ytyp file. I don't know if that ytyp file will work as-is because I have a custom props dlc for stuff like this... it should do though.

Hi again! Im having some trouble using the mod... heres what I did:

 

First I created the dlc pack. Then I put prop_big_screen_01.ydr and script_sprites.ytd into the regular rpf file.

I also put script_sprites.ytd into mods\update\update.rpf\x64\textures\script_txds.rpf like you mentioned.

Then I put prop_big_screen_01.ytyp.xml into the metadata.rpf file.

Finally I added the name of the dlc pack to the dlclist.xml file.

 

When I tried running the script it says "Invalid Model" from this code here:

Model screenModel = new Model(PropName);

if (!screenModel.IsValid)
{
	UI.Notify("Invalid Model");
	return;
}

It also said something about the constructor not being able to find a file.

Link to comment
Share on other sites

LeeC22

A custom maps or custom props dlc isn't just a dlc called custommaps or customprops, it has to be set up a specific way. I told you what type of dlc it needed to be so that you could search online and find the info to either set one up or download one... like this for instance. https://www.gta5-mods.com/tools/addonprops

 

The xml files will need fixing because it has all the XML on a single line, so wherever it has > directly followed by <, you will need to add a newline in between.

 

For instance, the setup2.xml in that dlc looks like this:

 

<?xml version="1.0" encoding="UTF-8"?><SSetupData><deviceName>dlc_addonProps</deviceName><datFile>content.xml</datFile><timeStamp>04/07/2016 17:26:39</timeStamp><nameHash>addonProps</nameHash><contentChangeSets /><contentChangeSetGroups><Item><NameHash>GROUP_STARTUP</NameHash><ContentChangeSets><Item>ADDONPROPS_AUTOGEN</Item></ContentChangeSets></Item></contentChangeSetGroups><startupScript /><scriptCallstackSize value="0" /><type>EXTRACONTENT_COMPAT_PACK</type><order value="25" /><minorOrder value="0" /><isLevelPack value="false" /><dependencyPackHash /><requiredVersion /><subPackCount value="0" /></SSetupData>

 

and it should look like this:

 

<?xml version="1.0" encoding="UTF-8"?>
<SSetupData>
    <deviceName>dlc_addonProps</deviceName>
    <datFile>content.xml</datFile>
    <timeStamp>04/07/2016 17:26:39</timeStamp>
    <nameHash>addonProps</nameHash>
    <contentChangeSets />
    <contentChangeSetGroups>
        <Item>
            <NameHash>GROUP_STARTUP</NameHash>
            <ContentChangeSets>
                <Item>ADDONPROPS_AUTOGEN</Item>
            </ContentChangeSets>
        </Item>
    </contentChangeSetGroups>
    <startupScript />
    <scriptCallstackSize value="0" />
    <type>EXTRACONTENT_COMPAT_PACK</type>
    <order value="25" />
    <minorOrder value="0" />
    <isLevelPack value="false" />
    <dependencyPackHash />
    <requiredVersion />
    <subPackCount value="0" />
</SSetupData>

 

It will work like it is but it will be hard to edit it.

 

You will also need to use Codewalker to edit the ytyp file because OpenIV won't open it. Early versions of Codewalker used to create incompatible ytyp files that OpenIV wouldn't open and this seems to be one of them

Link to comment
Share on other sites

emmyidk

Sorry! Im very confused right now! I appreciate your help.

 

5 hours ago, LeeC22 said:

The xml files will need fixing because it has all the XML on a single line, so wherever it has > directly followed by <, you will need to add a newline in between.

Where is this setup2.xml file you're talking about?

Does this formatting issue apply to the prop_big_screen_01.ytyp.xml file that you provided?

When I open that file in CodeWalker explorer it looks well formatted.

What exactly do I need to add to it?

5 hours ago, LeeC22 said:

I told you what type of dlc it needed to be so that you could search online and find the info to either set one up or download one... like this for instance. https://www.gta5-mods.com/tools/addonprops

I downloaded this and installed it like any other mod (I added it to the dlcpacks folder and updated the dlclist.xml file).

Next I put the prop_big_screen_01.ydr file and the script_sprites.ytd file into the props.rpf folder that was in the addonprops folder.

Then I launched Props Editor.exe and made two manual props: prop_big_screen_01 and script_sprites.

Finally I updated the def_props.ytyp file with those props.

 

Will this work?

Where do I need to put the prop_big_screen_01.ytyp file?

Am I supposed to put it into props.rpf too?

Link to comment
Share on other sites

emmyidk

Obviously Im not a modder and I dont plan on doing much modding after I get this thing working so forgive me if I seem overwhelmed.
The sample image you provided was truly incredible but it still needs some modifications.

 

  • Inside the border there can only be full and complete squares, no partial squares. The design does not need to fit perfectly in the cinema screen either so the white border could be larger on some sides than others to fill in the gaps (if needed). The size of the squares doesnt necessarily matter either, just as long as their square. The current size is awesome!
  • The border should be about 4 times as thick as it currently is. And I mean this as a minimum size. Again its ok to fill in extra space with white.
  • That skinny black line between the border and the (white) squares ideally wouldn't be there, but its not a deal braker if its not possible.

I have no clue how you made that texture but I would really appreciate you helping me get this final product!

Link to comment
Share on other sites

LeeC22
Posted (edited)

prop_big_screen_01.ytyp.xml

5 hours ago, emmyidk said:

Obviously Im not a modder and I dont plan on doing much modding after I get this thing working so forgive me if I seem overwhelmed.
The sample image you provided was truly incredible but it still needs some modifications.

 

  • Inside the border there can only be full and complete squares, no partial squares. The design does not need to fit perfectly in the cinema screen either so the white border could be larger on some sides than others to fill in the gaps (if needed). The size of the squares doesnt necessarily matter either, just as long as their square. The current size is awesome!
  • The border should be about 4 times as thick as it currently is. And I mean this as a minimum size. Again its ok to fill in extra space with white.
  • That skinny black line between the border and the (white) squares ideally wouldn't be there, but its not a deal braker if its not possible.

I have no clue how you made that texture but I would really appreciate you helping me get this final product!

 

Sorry, I don't have any more time for working on this.

 

If you are getting involved in modding, then you ultimately have to learn more about modding to do so, it's just the nature of how modding works. You can't expect people to provide things to exact specifications when they are already spending their time providing the majority of the functionality. I provided a model, the texture and the script, any modifications required to those are for you to do.

 

Sorry if that seems a bit harsh but the people who provide help on here are only providing help, not fulfilling commission requests. We give you the basics to work with and anything beyond that is for you to do as part of your learning experience. All you need to do is export the texture from OpenIV as a PNG or JPG, edit the texture and then Replace the original texture in OpenIV with the edited version.

 

I didn't see the other replay as well...

 

With the addonprops dlc, all you need to do is to add the prop_big_screen_01.ydr and script_sprites.ytd to the props.rpf. Open def_props.ytyp in that addonprops in OpenIV (making sure Edit Mode is turned on first) and copy this section of prop_big_screen_01.ytyp.xml into that file with the other similar entries:

 

    <Item type="CBaseArchetypeDef">
      <lodDist value="500.218" />
      <flags value="0" />
      <specialAttribute value="0" />
      <bbMin x="-96.0" y="-8.79772e-006" z="-54.0" />
      <bbMax x="96.0" y="8.79772e-006" z="54.0" />
      <bsCentre x="0.0" y="0.0" z="0.0" />
      <bsRadius value="110.145" />
      <hdTextureDist value="198.914" />
      <name>prop_big_screen_01</name>
      <textureDictionary>prop_big_screen_01</textureDictionary>
      <clipDictionary />
      <drawableDictionary />
      <physicsDictionary />
      <assetType>ASSET_TYPE_DRAWABLE</assetType>
      <assetName>prop_big_screen_01</assetName>
      <extensions />
    </Item>

 

That should be all you need to do. I only mentioned setup2.xml because it was the smallest file I could use to give an example of what the problem is with the xml files in that addonprops dlc.

Edited by LeeC22
Link to comment
Share on other sites

LeeC22
Posted (edited)

You know... I am actually convinced at this point that what I have given you isn't actually what you needed. My solution was to give you something where you could change the image on the screen during gameplay, which is why there is a script with it. The fact that you have such specific requirements for the texture now makes me think that isn't the case. With the solution I gave, you could put more images into the script_sprites.ytd and then change the name in the script to display the alternate images. But if you wanted a fixed-image prop, then my solution is not much use if you didn't want the script to be always running. You might want to create a ymap file that makes the object appear in the world all of the time.

 

However, here's where it gets complicated... I have only ever created props that have the textures built into the ydr file (called embedded textures) and that's because they are easy to work with, unless you want to change the texture that is. With ydr files that have embedded textures, you have to export the prop through Codewalker as XML, edit the texture and then import the prop back into the game through Codewalker. The issue there is that Codewalker exports the textures as DDS files, meaning you need a paint package that supports reading and writing DDS files.

 

I have never created a prop that uses an external texture file and I don't know how to set that up. I have just tried and it didn't work, there were just random textures on the screen that kept changing.

 

Hmmm, changing the name of the ytd file to be the same as the prop solved that problem, so here's a link to another version of the prop that won't need the script running. https://drive.google.com/file/d/1JFedBUBivGWEpdbePvxxkXIcQB_L3m2Z/view?usp=sharing

 

This contains 3 files:

prop_big_screen_02.ydr - This is the alternatee prop

prop_big_screen_02.ytd - This is the texture dictionary for that prop which contains a texture called big_screen_checkerboard

prop_big_screen_02.ytyp.xml - this contains the ytyp entry for this second prop

 

prop_big_screen_02.ydr and prop_big_screen_02.ytd go into props.rpf and you need to copy this xml into the def_props.ytyp file with the other entries:

 

    <Item type="CBaseArchetypeDef">
      <lodDist value="500.218" />
      <flags value="0" />
      <specialAttribute value="0" />
      <bbMin x="-96.0" y="-8.79772e-006" z="-54.0" />
      <bbMax x="96.0" y="8.79772e-006" z="54.0" />
      <bsCentre x="0.0" y="0.0" z="0.0" />
      <bsRadius value="110.145" />
      <hdTextureDist value="198.914" />
      <name>prop_big_screen_02</name>
      <textureDictionary>prop_big_screen_02</textureDictionary>
      <clipDictionary />
      <drawableDictionary />
      <physicsDictionary />
      <assetType>ASSET_TYPE_DRAWABLE</assetType>
      <assetName>prop_big_screen_02</assetName>
      <extensions />
    </Item>

 

I called it _02 so that you can have both versions and you can choose whichever you prefer to use. The texture changes are still your task to complete. There would need to be some changes made to the script if you wanted to use the _02 version of the prop by spawning it into the world when the game runs.

 

I am adding this Disclaimer here for clarity:

 

Disclaimer: I suffer from severe mental health issues (the specifics of such don't really need to be known) and as a result, I do not cope well with some of the things that came up in this thread. I have an absolutely minimal tolerance before I become irrationally angry over things and as a consequence, my responses can become abrupt, terse, aggressive etc... This is nothing personal, it is just the result of almost 10 years living a reclusive life with almost zero contact with real people.

 

TL;DR I am almost 60 years old, don't want to be here anymore, I get angry for no reason.

Edited by LeeC22
Link to comment
Share on other sites

emmyidk
4 hours ago, LeeC22 said:

You know... I am actually convinced at this point that what I have given you isn't actually what you needed. My solution was to give you something where you could change the image on the screen during gameplay, which is why there is a script with it. The fact that you have such specific requirements for the texture now makes me think that isn't the case. With the solution I gave, you could put more images into the script_sprites.ytd and then change the name in the script to display the alternate images. But if you wanted a fixed-image prop, then my solution is not much use if you didn't want the script to be always running. You might want to create a ymap file that makes the object appear in the world all of the time.

 

 

To avoid getting off topic I would like to message you privately about what I am trying to do. I think it would really help put all of this into perspective.

Do you have discord or something? I cant message you on here...

Link to comment
Share on other sites

LeeC22
12 minutes ago, emmyidk said:

 

 

To avoid getting off topic I would like to message you privately about what I am trying to do. I think it would really help put all of this into perspective.

Do you have discord or something? I cant message you on here...

 

I do have a Discord ID but I don't allow it to receive messages... I don't do messaging, it generally doesn't go very well.

Link to comment
Share on other sites

emmyidk
Posted (edited)
1 hour ago, LeeC22 said:

it generally doesn't go very well.

This time is different.

 

No matter what you will always be remembered for your contributions to the GTA modding comunity, but I want to propose something that would make you a legend.

Edited by emmyidk
Link to comment
Share on other sites

LeeC22
13 minutes ago, emmyidk said:

This time is different.

discordapp.com/users/monkey_button_weapon#0522

No matter what you will always be remembered for your contributions to the GTA modding comunity, but I want to propose something that would make you a legend.

 

Very bold statement.

 

I am curious, can you not message me on here because you don't want to say something on this site, because my messenger isn't blocked on here. Or is because of low reputation that won't let you access messages?

Link to comment
Share on other sites

emmyidk
1 minute ago, LeeC22 said:

Or is because of low reputation that won't let you access messages?

It says Im allowed to send 0 messages per day on the gtaforums messaging.

Link to comment
Share on other sites

LeeC22
1 minute ago, emmyidk said:

It says Im allowed to send 0 messages per day on the gtaforums messaging.

 

It's probably a low rep limitation, I think you might have to have 10+ rep... if so, that's not a problem if I intiate the message.

Link to comment
Share on other sites

emmyidk
8 hours ago, LeeC22 said:

I called it _02 so that you can have both versions and you can choose whichever you prefer to use. The texture changes are still your task to complete. There would need to be some changes made to the script if you wanted to use the _02 version of the prop by spawning it into the world when the game runs.

So does the _02 version work without a script?

Where does the screen spawn?

Link to comment
Share on other sites

LeeC22
4 minutes ago, emmyidk said:

So does the _02 version work without a script?

Where does the screen spawn?

 

You could create a Ymap in Codewalker to load it at a specific location, or you could use an alternate script to load it in the same way the current one does.

 

The script I originally created is meant to be used with the Rendertarget stuff, so create a file called cPropSpawn.cs and paste this code into it. It uses a cheat code of "spawnscreen".

 

using System;
using System.Drawing;

using GTA;
using GTA.Math;
using GTA.Native;

using Font = GTA.Font;

namespace PropSpawn
{
    public class cPropSpawn : Script
    {
        const string SettingsFilePrefix = "scripts\\";

        private Ped PlayerPed;

        private Prop ScreenProp;

        private string PropName = "prop_big_screen_02";

        public cPropSpawn()
        {
            Tick += onTick;
            Aborted += onAborted;

            Interval = 0;
        }

        public static bool CheatEntered(string cheatString)
        {
            return Function.Call<bool>(Hash._0x557E43C447E700A8, Game.GenerateHash(cheatString));
        }

        private void SpawnProp()
        {
            if (ScreenProp == null)
            {
                Model screenModel = new Model(PropName);
                
                if (!screenModel.IsValid)
                {
                    UI.Notify("Invalid Model");
                    return;
                }
                
                screenModel.Request();
                
                while (!screenModel.IsLoaded)
                {
                    Yield();
                }
                
                ScreenProp = World.CreateProp(screenModel, PlayerPed.GetOffsetInWorldCoords(new Vector3(0, 200f, 10f)), new Vector3(0, 0, PlayerPed.Rotation.Z), false, false);

                while (!ScreenProp.Exists())
                {
                    Yield();
                }

                UI.Notify("Prop Created");
                
                ScreenProp.FreezePosition = true;
                ScreenProp.IsPersistent = true;
                
                screenModel.MarkAsNoLongerNeeded();
            }
            else
            {
                if (ScreenProp.Exists()) ScreenProp.Delete();
                ScreenProp = null;
            }
        }

        private void onTick(object sender, EventArgs e)
        {
            if (Game.IsLoading) return;

            if (PlayerPed != Game.Player.Character) PlayerPed = Game.Player.Character;

            if (CheatEntered("spawnscreen"))
            {
                SpawnProp();
            }

        }

        private void onAborted(object sender, EventArgs e)
        {
            if (ScreenProp != null && ScreenProp.Exists())
            {
                ScreenProp.Delete();
            }
        }
    }
}

 

Link to comment
Share on other sites

emmyidk
23 minutes ago, LeeC22 said:

The script I originally created is meant to be used with the Rendertarget stuff, so create a file called cPropSpawn.cs and paste this code into it.

I think it finds the props and stuff but it keeps getting stuck here:

while (!ScreenProp.Exists())
{
	Yield();
}

The prop never exists and I dont know how to get the error message. No errors show up in the script hook console (F4).

Link to comment
Share on other sites

LeeC22
Posted (edited)
20 minutes ago, emmyidk said:

I think it finds the props and stuff but it keeps getting stuck here:

while (!ScreenProp.Exists())
{
	Yield();
}

The prop never exists and I dont know how to get the error message. No errors show up in the script hook console (F4).

 

That means the model is not valid as far as it is concerned and that usually implies an error with the ytyp file. I tested the script before posting the code, so the error is possibly in the setup of the dlc. If you can zip and share a link to the dlc (via message if you want) I can have a look at it.

 

Edit: Simpler solution... here's an addonprops dlc that I just created and tested which contains all the files I have sent for both props. https://drive.google.com/file/d/1YScAkfGbgE6RUPZNwXPe9ZIg2g1rFCSS/view?usp=sharing

 

Edited by LeeC22
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.