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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script error (Again)
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#11
RE: Script error (Again)

(07-08-2016, 05:29 PM)Hypercube Wrote: I wasn't saying that Venom should use eMusicPrio_BgAmb but it was an example because that's what I had used for the moment. Interesting though, I didn't realize the compiler automatically converted it into a float. I thought I remember it just not working, is it okay to leave it at one or should you include the decimal point? I remember encountering issues with this before

It depends on who you ask, I suppose. Strictly speaking, according to convention you should always use the type of constant that a variable/parameter/whatever is asking for to make it clear as to what you are doing. And sure, there can be cases in which a float is required such that an int wouldn't be able to get converted, but I'm not sure where in SOMA modding script those cases would arise (unless you start getting crazy with delegates, maybe).

In practice, this is one of those conventions that people would probably recommend you follow, but not following it doesn't really hurt much in most circumstances.

(07-08-2016, 05:33 PM)Venom Fox Wrote: To be sure that the audio file wasn't.. um.. broken, I used an audio track from Soma's soundtrack.
It didn't work either.

Also I want to make sure I'm doing it right. I have a folder called music in my folder, which contains the song, and I've added this to the resources.cfg; <Directory Path="/music" AddSubDirs="true"/>

So no errors in that regard?

In which folder? SOMA's folder? Your mod folder? Are you talking about SOMA's resources file or your mod's resources file? Did you copy the song from SOMA's folder into yours before you tested it?
(This post was last modified: 07-08-2016, 05:45 PM by Abion47.)
07-08-2016, 05:43 PM
Find
Venom Fox Offline
Junior Member

Posts: 32
Threads: 9
Joined: Mar 2016
Reputation: 0
#12
RE: Script error (Again)

(07-08-2016, 05:43 PM)Abion47 Wrote:
(07-08-2016, 05:29 PM)Hypercube Wrote: I wasn't saying that Venom should use eMusicPrio_BgAmb but it was an example because that's what I had used for the moment. Interesting though, I didn't realize the compiler automatically converted it into a float. I thought I remember it just not working, is it okay to leave it at one or should you include the decimal point? I remember encountering issues with this before

It depends on who you ask, I suppose. Strictly speaking, according to convention you should always use the type of constant that a variable/parameter/whatever is asking for to make it clear as to what you are doing. And sure, there can be cases in which a float is required such that an int wouldn't be able to get converted, but I'm not sure where in SOMA modding script those cases would arise (unless you start getting crazy with delegates, maybe).

In practice, this is one of those conventions that people would probably recommend you follow, but not following it doesn't really hurt much in most circumstances.

(07-08-2016, 05:33 PM)Venom Fox Wrote: To be sure that the audio file wasn't.. um.. broken, I used an audio track from Soma's soundtrack.
It didn't work either.

Also I want to make sure I'm doing it right. I have a folder called music in my folder, which contains the song, and I've added this to the resources.cfg; <Directory Path="/music" AddSubDirs="true"/>

So no errors in that regard?

In which folder? SOMA's folder? Your mod folder? Are you talking about SOMA's resources file or your mod's resources file? Did you copy the song from SOMA's folder into yours before you tested it?

I copied the song from Soma folders in to my mod folder. And I'm talking about my resources.cfg.

Also, what a delight; My message module has stopped functioning aswell! *sighs*

The heck is wrong with my pc...
07-08-2016, 06:36 PM
Find
Hypercube Offline
Member

Posts: 124
Threads: 20
Joined: Sep 2015
Reputation: 1
#13
RE: Script error (Again)

Did you put it in your mod's music folder though?
07-08-2016, 06:37 PM
Find
Venom Fox Offline
Junior Member

Posts: 32
Threads: 9
Joined: Mar 2016
Reputation: 0
#14
RE: Script error (Again)

(07-08-2016, 06:37 PM)Hypercube Wrote: Did you put it in your mod's music folder though?

Yeah, I did.
07-08-2016, 06:53 PM
Find
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#15
RE: Script error (Again)

The dev mode doesn't load your mod's resources folder, so it doesn't know to look in your mod's music folder. You need to either add that folder to SOMA's resources file or add the music to SOMA's sound folder. Otherwise, you are telling the game to play a music file that it doesn't even know exists. The same thing goes for the message module - the files in your mod's script folder aren't going to be loaded.

Try playing "00_00_apartment.ogg" to make sure that you can hear music at all.
07-08-2016, 06:58 PM
Find
Venom Fox Offline
Junior Member

Posts: 32
Threads: 9
Joined: Mar 2016
Reputation: 0
#16
RE: Script error (Again)

(07-08-2016, 06:58 PM)Abion47 Wrote: The dev mode doesn't load your mod's resources folder, so it doesn't know to look in your mod's music folder. You need to either add that folder to SOMA's resources file or add the music to SOMA's sound folder. Otherwise, you are telling the game to play a music file that it doesn't even know exists. The same thing goes for the message module - the files in your mod's script folder aren't going to be loaded.

Try playing "00_00_apartment.ogg" to make sure that you can hear music at all.

Tried playing the 00_00_apartment.ogg. Did not work... :/

Nothing should be wrong with my script files, my fade in function still works on the second map. I also tried to play the music in the second map aswell, but no luck there either.

VERY weird... I wish my soma modding "career" won't end like this.
(This post was last modified: 07-08-2016, 07:12 PM by Venom Fox.)
07-08-2016, 07:07 PM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#17
RE: Script error (Again)

wait, don't quit yet. xD
There are two resources.cfg in this scenario. the one in soma/ and the other in soma/mods/yourmod/.
The game itself and tools like level editor use the one in soma/, that's the main resources.cfg. So if you're editing your mod and you got new files, you gotta tell the game where to find them. This is the line I added to my soma/resources.cfg to let the game know where my files are:
PHP Code: (Select All)
<Directory Path="/mods" AddSubDirs="true"/> 
This means it's gonna load every file it can find inside /mods.
But if you're using stuff from soma you don't need to add the directory, it's already there. That's why they tell you to try first with existing sounds from soma.

That's for level editor and such. For testing -I don't know others- I launch the game with parameters like this:
PHP Code: (Select All)
Soma.exe -user Dev -cfg ./mods/Sinneromo/Config/main_init.cfg 

Sinneromo is my mod I'm working on. If you look inside my main_init.cfg it tells the game which resources.cfg my mod wants to use.
PHP Code: (Select All)
    Resources "mods/Sinneromo/resources.cfg" 
So the game runs with the user Dev and my mod's main_init.cfg, which uses Sinneromo/resources.cfg.
In this resources.cfg I got one extra line:
PHP Code: (Select All)
<Directory Path="/mods/Sinneromo" AddSubDirs="true"/> 
This will tell the game to load first -cause it's first on the list- all the files inside my mod directory, giving them priority when finding later more files with the same name.
For example, I got in my mod a copy of the script file InputHandler.hps which I modified. And the game always reads my file instead of the original from the game cause my resources.cfg is loading my files first.

07-08-2016, 10:58 PM
Find
Venom Fox Offline
Junior Member

Posts: 32
Threads: 9
Joined: Mar 2016
Reputation: 0
#18
RE: Script error (Again)

(07-08-2016, 10:58 PM)Daemian Wrote: wait, don't quit yet. xD
There are two resources.cfg in this scenario. the one in soma/ and the other in soma/mods/yourmod/.
The game itself and tools like level editor use the one in soma/, that's the main resources.cfg. So if you're editing your mod and you got new files, you gotta tell the game where to find them. This is the line I added to my soma/resources.cfg to let the game know where my files are:
PHP Code: (Select All)
<Directory Path="/mods" AddSubDirs="true"/> 
This means it's gonna load every file it can find inside /mods.
But if you're using stuff from soma you don't need to add the directory, it's already there. That's why they tell you to try first with existing sounds from soma.

That's for level editor and such. For testing -I don't know others- I launch the game with parameters like this:
PHP Code: (Select All)
Soma.exe -user Dev -cfg ./mods/Sinneromo/Config/main_init.cfg 

Sinneromo is my mod I'm working on. If you look inside my main_init.cfg it tells the game which resources.cfg my mod wants to use.
PHP Code: (Select All)
    Resources "mods/Sinneromo/resources.cfg" 
So the game runs with the user Dev and my mod's main_init.cfg, which uses Sinneromo/resources.cfg.
In this resources.cfg I got one extra line:
PHP Code: (Select All)
<Directory Path="/mods/Sinneromo" AddSubDirs="true"/> 
This will tell the game to load first -cause it's first on the list- all the files inside my mod directory, giving them priority when finding later more files with the same name.
For example, I got in my mod a copy of the script file InputHandler.hps which I modified. And the game always reads my file instead of the original from the game cause my resources.cfg is loading my files first.

Yeah, I have the <Directory Path="/mods" AddSubDirs="true"/> in my soma config already, can't remember if I added that myself or if that was already there, though.

I think I'll give myself a one last chance, I delete every single Soma file and redownload the game. Maybe. Haven't decided yet... :/

So absurd that the music doesn't work, though. Can't even play music directly from Soma... I might have some goddamn curse on me or something.
07-09-2016, 03:11 PM
Find
Hypercube Offline
Member

Posts: 124
Threads: 20
Joined: Sep 2015
Reputation: 1
#19
RE: Script error (Again)

Don't give up, just because this issue isn't solved right now doesn't mean you should give one last chance or whatever. I've made a SOMA map with a glitch and abandoned that one but you yourself can't stop modding entirely, if that' what you even meant by what you were saying. I just remember you talking about how this might be the end of your modding career or whatever. Try making a new SOMA map and test if it works there, because it could just simply be a problem with your current mod.
07-09-2016, 07:36 PM
Find
Venom Fox Offline
Junior Member

Posts: 32
Threads: 9
Joined: Mar 2016
Reputation: 0
#20
RE: Script error (Again)

(07-09-2016, 07:36 PM)Hypercube Wrote: Don't give up, just because this issue isn't solved right now doesn't mean you should give one last chance or whatever. I've made a SOMA map with a glitch and abandoned that one but you yourself can't stop modding entirely, if that' what you even meant by what you were saying. I just remember you talking about how this might be the end of your modding career or whatever. Try making a new SOMA map and test if it works there, because it could just simply be a problem with your current mod.

Yeah, I'll try to! Maybe next time it'll be better!

Ps. Thanks for the motivation Big Grin
07-09-2016, 08:32 PM
Find




Users browsing this thread: 3 Guest(s)