Can I use custom sounds/graphics in my level?

Can I use custom sounds/graphics in my level?

Postby darkhog » 15 Feb 2018, 13:08

I have few ideas, but it would require me to put custom sounds/graphics in my levelpack. Can I do that and if so how?
User avatar
darkhog
 
Posts: 35
Joined: 10 Feb 2018, 06:44

Re: Can I use custom sounds/graphics in my level?

Postby mteufel » 15 Feb 2018, 13:45

Yes, this is possible!

If you're right now only editing it using the level editor: Go to wherever the level editor saves its levels. On Linux, that is usually in `~/.local/share/supertux2/`. The levelsets are usually saved (as folders on their own) in the `levels` subdirectory of that folder. For music, create a `music` subdirectory in `~/.local/share/supertux2/`, for sounds a `sounds` subdirectory, for graphics an `images` subdirectory (for images, it is advisable to follow the subdirectory structure as used in the main game). You should then be able to access those from the level editor.

If you want to create an add-on, you have to include these folders and files as well!
SuperTux developer
mteufel
 
Posts: 139
Joined: 03 Jan 2016, 09:27

Re: Can I use custom sounds/graphics in my level?

Postby manuel » 15 Feb 2018, 13:50

Make sure that you are allowed to share those sounds/graphics (e.g. make them yourself or get the creator's permission).
manuel
 
Posts: 190
Joined: 19 Sep 2017, 09:03

Re: Can I use custom sounds/graphics in my level?

Postby darkhog » 15 Feb 2018, 15:15

Yeah, I want to share that set later on so I'd need an addon, I think. How would I make one though?
User avatar
darkhog
 
Posts: 35
Joined: 10 Feb 2018, 06:44

Re: Can I use custom sounds/graphics in my level?

Postby manuel » 15 Feb 2018, 15:56

Add-ons are packed like this:
[this is a folder]
-this file is in the folder above

<Worldmap ID>.nfo (See below for how this file should look like)
[levels]
-[<worldmapid>]
--levels.stl
--worldmap.stwm
--info-file (See below, just copied it from your other packing question)
[images] (only if you have custom textures)
-[tiles] (for tiles, obviously)
-[creatures] (for sprite files)
-[worldmap] (for worldmap tiles)
-tiles.strf (if you use custom tiles)

Make sure to select youraddon.nfo, [levels] and [images] and zip those three together without creating a folder around them.


<Worldmap ID>.nfo
{l Code}: {l Select All Code}
(supertux-addoninfo
  (id "Worldmap-ID")
  (version 1)
  (type "world")
  (title "Your Worldmap Name")
  (author "Your Name")
  (license "CC-by-sa 4.0")
)

For "Worldmap ID" use only letters, numbers and _ or - , no spaces. You should name it YourName_Worldmap-Name to avoid two identical IDs.
Type should be "world", "worldmap" or "levelset" (if you have no worldmap).
Title: The name of your world, which should be displayed (spaces are allowed)
Author: Your name
License: Keep it as-is to allow sharing and modification of your Worldmap

{l Code}: {l Select All Code}
(supertux-level-subset
(title (_ "Name that should be displayed"))
(description (_ "A short description"))
(levelset #f)
(hide-from-contribs #f)
)

So for title and description just enter a short text between the "".
If your levels don't have a worldmap, change levelset to #t.
If you don't want to see your world in-game, change hide-from-contribs to #t. So, just leave it as-is.
Last edited by manuel on 15 Feb 2018, 16:11, edited 2 times in total.
manuel
 
Posts: 190
Joined: 19 Sep 2017, 09:03

Re: Can I use custom sounds/graphics in my level?

Postby manuel » 15 Feb 2018, 16:02

Here's a screenshot for an example add-on.
Attachments
example-addon.jpg
example-addon.jpg (17.34 KiB) Viewed 6833 times
manuel
 
Posts: 190
Joined: 19 Sep 2017, 09:03

Re: Can I use custom sounds/graphics in my level?

Postby mteufel » 15 Feb 2018, 18:50

manuel, you'd do everyone in the community a great favor (I think) if you contributed this stuff to the wiki (https://github.com/SuperTux/wiki). Feel free to get back to me if you need assistance.
SuperTux developer
mteufel
 
Posts: 139
Joined: 03 Jan 2016, 09:27

Who is online

Users browsing this forum: No registered users and 1 guest