-
Notifications
You must be signed in to change notification settings - Fork 2
Loading files into Smash Hit
Once you have created a set of segments you would like to make an APK from, you will need to:
- Copy the segment files to the APK
- Create a room file (possibly based on Quick Test settings)
- Create a level XML file
- Add your level to
game.xml
If you know how to navigate folders and edit text files, you can probably skip some of this guide.
Android ships apps in "packages" that contain the data and libraries needed for the application to work. To distribute your custom segments and load them in game, you need to create an Android package, also called an APK.
To do this, we download a normal Smash Hit APK and add our segments into it.
To start, you will want to download APK Editor Studio if you have not already. It lets you easily edit and save modified APK files, and we will use it here.
Also, if you don't already have a default Smash Hit APK file, you need to download one.
If you use Windows, you also might want a text editor better than Notepad, like Notepad++.
To start, you will need to open APK Editor Studio.
- Click the folder in the top left and browse to the Smash Hit APK, then open it.
- Once it is open, wait a few seconds and it will have loaded:
- Click Open Contents, and we will now see the files in the Smash Hit APK:
- We can now modify the game files and mod Smash Hit.
When making a Smash Hit mod, you will probably want to change the package name, title and icon. Please note that if you don't change the package name, your progress in non-modded Smash Hit could be erased.
TODO: Write this!
- Export and find your segment files in a file explorer window.
- Follow the first guide to open the APK contents.
- In the window with the apk contents, go to
assets
→segments
. - Create a folder named whatever you want your level to be called. For example,
forest
,beehive
ortunnel
. - Copy and paste your segment files from where you exported them to this folder.
- Go to the APK contents.
- Navigate to
assets
→rooms
. - Copy an existing room file. For example:
- go to
basic
- copy
basic.lua
- go back
- paste
basic.lua
- rename the file
- Open the copied file in your text editor (Notepad, Notepad++, or whatever you like).
- You will see something like this:
function init()
pStart = mgGetBool("start", true)
pEnd = mgGetBool("end", true)
mgMusic("0")
mgReverb(0.2, 0.8, 0.3)
mgEcho(0.3, 0.2, 0.5, 0.5)
mgFogColor(1.8, 1.6, 1.9, .05, .3, 0)
confSegment("basic/basic/chasms", 1)
confSegment("basic/basic/chasms2", 1)
confSegment("basic/basic/stairs", 1)
confSegment("basic/basic/stairs2", 1)
l = 0
if pStart then
l = l + mgSegment("basic/basic/start", -l)
end
-- ... and there is more
- The only thing we need to change to view our segments is the
confSegment
lines. Edit them with the path to your segment, for example:
confSegment("forest/door", 1)
confSegment("beehive/hexagons", 1)
confSegment("tunnel/long", 1)
- Save the file.
- Open the APK contents.
- Go to
assets
→levels
. - Create a new file:
my_level_name.xml
. - Open the file.
- Start with the basic level structure of one room:
<level>
<room type="[room name]" length="100"/>
</level>
- Replace
[room name]
with the name of your room, and maybe edit the length. - Save the file.
- Open the APK contents.
- Go to
assets
. - Open
game.xml
. You will see something like this:
<game>
<levels>
<level name="basic"/>
<level name="night"/>
<level name="holodeck"/>
<level name="cave"/>
<level name="canyon"/>
<level name="ocean"/>
<level name="cave2"/>
<level name="river"/>
<level name="brownie"/>
<level name="phosphor"/>
<level name="hyperspace"/>
<level name="city"/>
<level name="endless"/>
<level name="endless"/>
<level name="endless"/>
</levels>
</game>
- Add your level anywhere you want (the very start is recommender for easier testing). The name comes from the file in the
levels
folder. - Save the file.
- Go to APK Editor Studio.
- Click
Save APK
. - Choose a nice filename.
- Save the file.
Created by the Blender Tools Documentation Authors. Licenced under the Creative Commons Zero licence.