Creating a Level
This is a tutorial that lets you create a very basic level with no scripted events. This level sets up a spawning spot, spawns monsters and adds an exit.
Please note: The chat commands are case sensitive! You must match upper/lower case exactly!
Step 1: Build your level
This is not something I can help much with. I am sure there are tutorials that teach you how to use the SL building tools. But here are a few suggestions:
Create a 10x10x0.5 prim as a base, and build everything 10m above it. It reduces the chance of you spawning the level on top of somebody. Here is a basic setup with a root prim "anchor" and a platform for players to walk on.

Build your level and make sure that the "anchor" remains the root prim by linking it last.

Step 2: Add the scripts
- Unpack your GoThongs Devkit that came with your GoThongs unpacker. Wear the devhud and unpack the level scripts.
- Drag _MAIN (not _MAIN challenge dungeon), got Level, all the slave scripts, Trigger and TriggerSensor into your level. Also wear your GoThongs HUD!
- Hold ctrl while you press enter after typing the following into chat (shout): debug got Level
- You will get a message saying "Updating level code..." and if you edit your level you will find that it has added additional scripts!
Step 3: Add a spawn point
- Click the Spawn button on your dev HUD. Then right click and sit on the P1 mesh that spawned.
- Edit yourself into a position where you want your players to start.
- Say "add" in chat to save your spawn point. You will get a message like "Saved start point at <-12.57,-10.92,10.92>".
- Warning: At this point you should not do drastic changes to your level. All spawn points and monsters are relative to the root prim. If you move the root prim relative to the level you have to redo all the spawn points and monsters.

Step 4: Adding the exit.
- Edit your exit door prim. Set the description to D$Exit$$LVIN$EXIT
- Note: D$Exit makes the prim interactive by pressing E, with the label "Exit". LVIN$EXIT raises a level interact event inside of _MAIN. The event task is set to "EXIT".
- The default _MAIN script comes with a default handling of LVIN$EXIT. But it also requires you to kill a monster with the ID "finalGoblin". So we will add that.
Step 5: Adding monsters.
There are two ways of rezzing the monsters that you want to add. One way is to drag all the monsters from the GoThongs monster repository prim into your inventory. To do that you edit your HUD, and check "edit linked" in the build tool. Then scroll down to zoom out and edit the red prim with the monster on it. The monster inventory may take a minute to load. After that you can drag the items to your inventory and rez them from there.

The second way to rez the monsters is to use the command "spawn <name>" such as "spawn Cock Goblin 2" to spawn it in front of you. Most of the monsters with a 2 after the name are the animesh versions. And those are what you want to use.
The monsters will be rezzed in "dummy mode" in either way you choose. This means that they will not attack or be attacked.
- Rez and position the monster that you want to add to your level.
- Say "add" in chat to add all your rezzed monsters to the level spawn database.
- The HUD will tell you something like: Inserted 0 >>> [0,"Cock Goblin 2","<-3.5,-3.68,11.15>","<0,0,-0.707,.707>","",""] (Remove)
- When it says "Inserted 0", the 0 is the index of the spawn. The index is unique to each spawn and is how to you can modify a spawn afterwards. That is followed by a list of the monster settings. The first entry of the list says 0 if the monster is a spawn (located in your HUD), or 1 if it is an asset (located in the level itself). The second entry is the name of the monster object. The third is the spawn position relative to the root prim. The fourth is the absolute rotation. The 5th is custom spawn data (more on that later). The 6th is spawn group (more on that later).
- You can click the remove button to remove your spawn.
- Delete the monster (either manually or by saying Yes Close in chat, which cleans up ALL spawns). You can also click the Clean button on your dev HUD. Otherwise you will add them to the spawn table again the next time you save, and have double-spawns.
- Click the Spawns button on your dev HUD to see a list of all the stored spawns. From that list you can also click the DEL button to delete a spawn, the DUM button to spawn a monster in dummy mode, or LVE to spawn it with in game behaviors (it will attack you).
- Place some more monsters and say "add" again to save them as spawns. But do not place a "boss" yet!
Step 6: Adding a "boss" and other monster customization
The default _MAIN script requires you to kill a monster with the ID of "finalGoblin" in order to let you exit. This is to prevent players from running straight through a level and ignoring all of the monsters.
Spawns let you customize some monster settings by setting the monster object description to "$[[taskA,dataA],[taskB,dataB]...]" Starting with a $ is REQUIRED or the spawn data will not save! If you are familiar with JSON. You will understand the syntax. But if not. I will try to explain the basics afterwards.
- First take a quick look at the monster setting cheat sheet https://github.com/JasXSL/GoThongs/wiki/Dev-%7C-Monster-Setting-Sheet
- As you can see, the task "ID" sets a monster ID. This is needed for the LevelEvt$idDied event that _MAIN is listening to. To set an ID we simply set the monster's description to: $[["ID","finalGoblin"]]
- Now when the monster dies, the _MAIN script sees that finalGoblin has been defeated and will let players use the exit.
- But let's make our boss a little harder by increasing its HP. If we look at Monster INI_DATA, we see that 6 sets a monster's max HP. So we will update the description to $[["ID","finalGoblin"],[6,500]]
- This sets the boss HP to 500. Final bosses often have 600-800 HP. Normal monsters have 60-200 HP.
- After setting the description, we add all spawned monsters to the spawn list by typing "add" into chat.
- In my case I got this message: Inserted 2 >>> [0,"Cock Goblin Bully 2","<6.61,11.7,11.35>","<0,0,1,0>",[["ID","finalGoblin"],[6,500]],""] (Remove)
- As you can see, the 5th value is now the data we set in the description.
- If you made a mistake the easiest way to edit the spawn is via chat commands. Let's assume we want to lower his HP to 300.
- The goblin has the unique spawn ID 2. You can always click the Spawns button on the HUD to see a list of all your spawns and their ID. The position of the value in the list above is 5. But arrays in SL start at 0, so you must subtract 1.
- Assuming your spawn ID is 2, then type in chat: "setSpawnVal 2 4 [["ID","finalGoblin"],[6,300]]"
- If you did it correct, you will see the spawn before the change and after the change. Note: The spawn data is always 4, so the command to replace the spawn data will always be setSpawnVal <id> 4 <data> Note: Do not start your data with $ when updating it this way. The $ is ONLY for the object description.
- Remember to clean up spawns after you save them by saying "Yes Close" or deleting the objects! You can also click the Clean button on your dev HUD.
Syntax explanation: The opening and closing brackets [ ] indicate a group of data. This group of data can have multiple groups of data wrapped in brackets inside of it and separated by a comma [[],[],[]]. The inner groups of data has variables, also separated by comma: [[1,"A"],[2,"B"]]. If a piece of data is a number you can type the number directly [1]. But if it is not a number you must wrap it in citation marks ["text"]. As far as the monsters go there is one primary group of data that can have multiple smaller groups of data. Each smaller group sets a property of the monster. To better illustrate I will use newlines:
The main data block: [ Sub data blocks go inside [task,value0,value1...] ] For an instance: [ ["ID","finalGoblin"], [3,1.5], [5,10] ] Sets the task "ID" to "finalGoblin" Sets the task 3 (attack speed, see monster setting sheet linked above) to 1.5 Sets the task 5 (idle wandering distance) to 10 meters
Another fun customization is setting a monster idle animation. You can use the xobj debug commands which uses chat messages: "debug <scriptName>, <methodID>, <arg0>, <arg1...>"
Should you want to dig in, you can see the header files in the GoThongs git repository in the classes folder. But for now we will only take a look at the "got AniAnim" script which is a script that all animesh NPCs have that handles their animations.
- Rez a new humanoid monster such as a cock goblin. (Cock Goblin 2)
- The "got AniAnim" script has a method with the id 100. This method plays an animation and allows it to fetch an animation from the GoThongs HUD animation repo. Edit the HUD the same way as you did in step 5 but select the grey prim with the handstand icon. This prim inventory will take a loooong time to load because there are so many animations. Any animation in that repo can be played by the NPC but may not look right.
- There are a few good idle animations that work well with the humanoids: lean_folded, stand_folded, goblin_kneel, sit_bored
- To preview an animation, say in chat: debug got AniAnim, 100, lean_folded, 1
- After saying it, the monsters that can hear you will play the lean_folded animation. For reference, the syntax of the command is debug got AniAnim, 100, <animName>, <start>
- Position your goblin and edit its description: $[["IDL","lean_folded"]]
- The "IDL" task sets an idle animation. The idle animation is ended when the monster enters combat.
- Say "add" to add your spawned monsters: Inserted 3 >>> [0,"Cock Goblin Bully 2","<13.21,1.19,11.37>","<0,0,1,0>",[["IDL","lean_folded"]],""] (Remove)
- Remember to delete the monster object after, either manually or by saying "Yes Close" to despawn any rezzed monsters.
Step 7: Testing your simple level
Say "load live". This will teleport you to the start and spawn the monsters. If everything worked right it will clean up any spawns when you kill the boss and reach the exit.
Step 8: Making it playable in the HUD

First you must create a level item.
- Follow the guide on how to create a mod: Creating a Mod
- In your mod at the mod page click New Quest.
- Fill out the basic details.
- Click Add Cell and in cell name make the cell the same name as your level object name in SL.
- Describe a short backstory for the cell in the description field. Ignore sub-cells. You can add more cells here if you want your level to have multiple cells.
- Press insert to create your level.
- You can test your quest by pressing Start Quest on My Character. If you get an error that the quest is not available to you, then you must make sure that you have enabled the mod in your GoThongs HUD.
- While testing, you can edit the HUD level repo prim and manually drop your level cell in.
Next you can add your quest to the world map.
- Go to your mod editor. Click on New Land.
- In extend existing map I suggest that you select _MAIN_ | Breezy Mounds.
- At the bottom you can click insert new landmark and pick an existing icon. Try the challenge mode icon.
- Give your icon a name like "Test Dungeon"
- Put your quest in Offer Quest.
- Check Hide if Quest completed.
- Press insert.
Now your quest should show up on the world map.
If everything is working as it should. You can go to Advanced Level Features