Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loading custom assets (graphics) into mod
ghoststeam217 Offline
Junior Member

Posts: 7
Threads: 2
Joined: Apr 2016
Reputation: 0
#1
Question  Loading custom assets (graphics) into mod

So I'm stuck on this and after hours of trying I am getting desperate. I am making a mod that involves unlocking and locking doors from a computer terminal (similar to the theta map where you had to get down the elevator). However I am having difficulties loading my own map on the computer monitor.

I had looked over the code used in the theta map and I copied it. One part of this code involved loading the 'background map' which was an image of the theta rooms and hallways.

settings.mMapBackground = cImGuiGfx("theta_securitymap", eImGuiGfx_Texture);

This file was simply called 'theta_securitymap' which was located in the 'graphics/imgui/station/theta_securitymap' directory. Whenever I edited the actual file (.dds) in Paint.Net it changed, however when I tried to change the image and put it in a different location in cImGuiGfx() to something like;

settings.mMapBackground = cImGuiGfx("mods/test/graphics/theta_securitymap.dds", eImGuiGfx_Texture);

It simply showed the original map again. It seems like it doesn't point to any file not in the predefined '/graphics' folder in the original game folder.

When I renamed the file to something like;

settings.mMapBackground = cImGuiGfx("mods/test/graphics/upsilon_securitymap.dds", eImGuiGfx_Texture);

no background on the terminal was displayed (obviously the file wasn't found). I looked around and I found that I needed to change my resources.cfg file to point to a '/graphics' folder in my mod folder . So I did;

<Resources>
    <Directory Path="/config" AddSubDirs="true"/>
    <Directory Path="/graphics" AddSubDirs="true"/>
    <Directory Path="/maps" AddSubDirs="true"/>
</Resources>

and in my mod folder I added the directory 'graphics/imgui/station/theta_securitymap/' and added the 'theta_securitymap.dds' file in it but I still got the original image and not my modified one.

WTF? - to put it simply. Why isn't this working? Can someone give me a good explanation on how I would add my own textures (in this case for the cImGuiGfx() function) into my mod?

Cheers.
04-15-2016, 10:15 AM
Find
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#2
RE: Loading custom assets (graphics) into mod

To clarify, are you adding those lines to your mod's resources file, or are you editing the existing SOMA resources file? And are you running your mod in the SomaDev.Bat or through the ModLauncher?

Also, I'm not 100% certain, but I'm pretty sure that when a non-script file gets loaded, it gets ignored if an asset of the same name already exists. Try renaming your updated security map to some other name. (Any particular reason you're trying to leave it as the same name?)
04-15-2016, 11:07 AM
Find
ghoststeam217 Offline
Junior Member

Posts: 7
Threads: 2
Joined: Apr 2016
Reputation: 0
#3
RE: Loading custom assets (graphics) into mod

(04-15-2016, 11:07 AM)Abion47 Wrote: To clarify, are you adding those lines to your mod's resources file, or are you editing the existing SOMA resources file? And are you running your mod in the SomaDev.Bat or through the ModLauncher?

Also, I'm not 100% certain, but I'm pretty sure that when a non-script file gets loaded, it gets ignored if an asset of the same name already exists. Try renaming your updated security map to some other name. (Any particular reason you're trying to leave it as the same name?)

I'm running this game through SomaDev.bat. And those lines are in my mod's resources.cfg file. I was leaving it as the file as the same name because when I try to replace a script I needed to include the '/script' folder in my mod along the same file name with a reference to it in my resources.cfg file. So I figured it was the same for my graphics. I will try running it through soma.exe -mod and see what happens.
04-16-2016, 01:58 AM
Find
ghoststeam217 Offline
Junior Member

Posts: 7
Threads: 2
Joined: Apr 2016
Reputation: 0
#4
RE: Loading custom assets (graphics) into mod

Never mind. Running it as a mod worked as it actually read the entry.hpc file. However how would I run this 'mod' in developer mod so that it loads my custom assets and allows me to reload the map? (So I can test what the new security map would look like)
04-16-2016, 03:52 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#5
RE: Loading custom assets (graphics) into mod

(04-16-2016, 03:52 AM)ghoststeam217 Wrote: Never mind. Running it as a mod worked as it actually read the entry.hpc file. However how would I run this 'mod' in developer mod so that it loads my custom assets and allows me to reload the map? (So I can test what the new security map would look like)

At the end of SOMA's resource file (in the root), add a directory for the "/mods" folder, with true for adding subdirectories. That should include it when SomaDev.bat is run.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
04-16-2016, 08:06 AM
Find
WALP Offline
Posting Freak

Posts: 1,221
Threads: 34
Joined: Aug 2012
Reputation: 45
#6
RE: Loading custom assets (graphics) into mod

SomaDev.bat behaved weird for me as far as I remember, so I just use the non steam modlauncher, and edit the profile to have dev settings.
04-16-2016, 07:32 PM
Find




Users browsing this thread: 1 Guest(s)