Page 1 of 1

random docking music / oxp vs. oxz

Posted: Tue Oct 05, 2021 11:59 pm
by Slartibartfast
Hello

montana05 has thankfully reactivated the link to that oxp.

but -- i little bit playing around with that
-- i saw some problems making it osz ( !! i am not able to do that anyway )

--OXP is a simple subdirectory
-- OXZ -- a packed ZIP ( not so simple - especially for automatic configuration )

AND editing the .js script and copying files to an zipped folder -- i thing - for "normal " players -- too much

-- editing the .js script -- o.k. that could be managed via script
--but adding new music.. ?

...my question ( i don't know java/php/... or something like that // only LInux/Bash )
-a) isn't it possible to move the /music out of the "zip"?
-b) isn't it possible to load an (external/simple) file with the list of music files into the .js script?
--------------- making changes on a executable script -- i think ...not very userfriendly :?

idea:
-- add some music files to a subdirectory
-- and -- atfer next oolite-start -- you can listen
-- and ...maybe ( examples)
--------------- docking on "Saloon" --> "one Bourbon, one Scotch and one Beer..; Milk & Alcohol"
--------------- docking on "SIRF" --> " welcome to the machine"
--------------- docking an "Anarchie-Stations" => Hmm ..(i'm old") maybe ...Sex-Pistols
--------------- docking on Communist-Station => "Völker hört die Signale ...."
------------------------------ O.K german text ----- but Marx & Lenin were germans :wink:
-------------------------------------- i don't know in english :(


btw.
for the future -- ...not only .ogg -- this makes direct surround sound with an modern digital-amplifier impossible
-> add simple .wav / .pcm ( we now have enough place on SSD-Disks )

Cheers
matthias

P.S.
please look at this post not as negative criticism
but as a little ( beer caused) brainstorming

Re: random docking music / oxp vs. oxz

Posted: Wed Oct 06, 2021 1:23 am
by phkb
Slartibartfast wrote: Tue Oct 05, 2021 11:59 pm
-a) isn't it possible to move the /music out of the "zip"?
No. All resources used by an OXP/OXZ should be in the OXP folder structure (textures in the "Textures" folder, music in the "Music" folder, etc). It doesn't matter if that folder is in a ZIP (ie the OXZ format) or as a plain folder (ie the OXP format).
Slartibartfast wrote: Tue Oct 05, 2021 11:59 pm
-b) isn't it possible to load an (external/simple) file with the list of music files into the .js script?
Not exactly. You could put the list of music filenames in an entry in the "descriptions.plist" file.
For example:

Code: Select all

{
	my_music_files = ("song1.ogg", "song2.ogg", "song3.ogg");
}
Then, to get a single song filename, you would just need this line of js code:

Code: Select all

	var filename = expandDescription("[my_music_files]");
That will pick one of the song files at random from the list in "my_music_files".

Re: random docking music / oxp vs. oxz

Posted: Wed Oct 06, 2021 1:50 am
by Slartibartfast
Hi
No. All resources used by an OXP/OXZ should be in the OXP folder structure (textures in the "Textures" folder, music in the "Music" folder, etc). It doesn't matter if that folder is in a ZIP (ie the OXZ format) or as a plain folder (ie the OXP format).
o.k. :(

so i have to do it the other way ( only works with OXP ) // make a link from outside "Folder i like" to inside OXP (/music)
-- works!! // listening to "john lee hooker" on docking .. and other

but ...only OXP -- not OXZ ( in the future )

Not exactly. You could put the list of music filenames in an entry in the "descriptions.plist" file.
Hmmm?
It is not possible in an .js script to import (for example.) .txt files and work with them?
-- can't believe it -- even the (very) old bash can do that.

matthias

Re: random docking music / oxp vs. oxz

Posted: Wed Oct 06, 2021 3:49 am
by phkb
Slartibartfast wrote: Wed Oct 06, 2021 1:50 am
It is not possible in an .js script to import (for example.) .txt files and work with them?
For security reasons, the game will only import and use predefined plist files (descriptions.plist, missiontext.plist, etc).
Slartibartfast wrote: Wed Oct 06, 2021 1:50 am
but ...only OXP -- not OXZ ( in the future )
If you want to keep moving music in/out of the OXP, then yes, OXP only. OXZ is designed to make distribution and installation easier. The OXP format is designed to encourage tweaking and changing. There is no right/wrong answer here.

But even given that distinction, there are tools that allow you to add/change/remove files from a ZIP directly, working with it as you would any file explorer. So you could theoretically have an OXZ file with the flexibility of an OXP.