Skip to content

Commit fb37a62

Browse files
authored
Guides (#205)
# Changes * Moved scripting guides to `_datafiles/guides` * Added community provided guides * Fleshed out several sections * Fixed paths that were bad * Updated some guides that were obviously out of date with changes that have occured over the past year
1 parent 5d391d3 commit fb37a62

18 files changed

+472
-73
lines changed

README.md

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ If you have comments, questions, suggestions:
1414

1515
[Discord Server](https://discord.gg/cjukKvQWyy) - Get more interactive help in the GoMud Discord server.
1616

17+
[Guides](_datafiles/guides/README.md) - Community created guides to help get started.
18+
1719
## Screenshots
1820

1921
Click below to see in-game screenshots of just a handful of features:
@@ -24,10 +26,6 @@ Click below to see in-game screenshots of just a handful of features:
2426

2527
Colorization is handled through extensive use of my [github.com/Volte6/ansitags](https://github.com/Volte6/ansitags) library.
2628

27-
## Scripting
28-
29-
Information on scripting in GoMud can be found in the [scripting README](scripting/README.md).
30-
3129
## Small Feature Demos
3230

3331
- [Auto-complete input](https://youtu.be/7sG-FFHdhtI)
@@ -46,28 +44,6 @@ Information on scripting in GoMud can be found in the [scripting README](scripti
4644
- [Web Socket "Virtual Terminal"](https://www.youtube.com/watch?v=L-qtybXO4aw)
4745
- [Alternate Characters](https://www.youtube.com/watch?v=VERF2l70W34)
4846

49-
# Quick Start
50-
51-
You can download the latest release from the [releases page](https://github.com/Volte6/GoMud/releases), unzip it and run the binary to get started, or if you prefer to build it yourself, follow the instructions below.
52-
53-
A youtube playlist to getting started has been set up here:
54-
55-
[![Getting Started Videos](https://i.ytimg.com/vi/OOZqX01aHt8/hqdefault.jpg "Getting Started Playlist")](https://www.youtube.com/watch?v=OOZqX01aHt8&list=PL20JEmG_bxBuaOE9oFziAhAmx1pyXhQ1p)
56-
57-
You can compile and run it locally with:
58-
59-
> `go run .`
60-
61-
Or you can just build the binary if you prefer:
62-
63-
> `go build -o GoMudServer`
64-
65-
> `./GoMudServer`
66-
67-
Or if you have docker installed:
68-
69-
> `docker compose up --build`
70-
7147
## Connecting
7248

7349
_TELNET_ : connect to `localhost` on port `33333` with a telnet client
@@ -86,21 +62,6 @@ When running several environment variables can be set to alter behaviors of the
8662
- **LOG_PATH**_=/path/to/log.txt_ - This will write all logs to a specified file. If unspecified, will write to _stderr_.
8763
- **LOG_LEVEL**_={LOW/MEDIUM/HIGH}_ - This sets how verbose you want the logs to be. _(Note: Log files rotate every 100MB)_
8864

89-
## Platform specific
90-
91-
### Raspberry pi
92-
93-
Want to run GoMud on a raspberry pi? No problem! I do it all the time! It runs great on a [$15 Raspberry Pi Zero 2](https://www.raspberrypi.com/products/raspberry-pi-zero-2-w/). However, in my experience the raspberry pi struggles to compile the binary directly,
94-
so it is recommended that you compile the binary locally and then copy it over to the raspberry pi.
95-
96-
There is a convenient `make` command to compile the pi chipset provided:
97-
98-
`make build_rpi` ( this will output a binary named: `go-mud-server-rpi` )
99-
100-
Or (window user?) just use the build comand directly:
101-
102-
`env GOOS=linux GOARCH=arm GOARM=5 go build -o go-mud-server-rpi`
103-
10465
# Why Go?
10566

10667
Why not?

_datafiles/guides/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Guides
2+
3+
- [Running GoMud](running/README.md)
4+
- [Playing GoMud](playing/README.md)
5+
- [World Building](building/README.md)
6+
- [Scripting](building/scripting/README.md)
7+
8+
## TODO
9+
10+
- Disambiguate between running from cloned source files and running a downloaded release.
11+
- Move from `go run .` to `go build -o my-output-binary` and running that. This helps with the above.
12+
- Further sectionalize the various guides and help them make sense now that they are fragmented from an original single guide
13+
- Add a TOC to each `.md` file to help navigate sections quicker when looking for key information.
14+
- Consider making guides loadable/viewable either in world or via the admin web interface.
15+
16+
## Need specific help or want to contribute?
17+
18+
Join the GoMUD community forums or Discord for tips and inspiration:
19+
20+
- [GoMud Central Discord](https://discord.gg/TqeM85QFdJ)
21+
- [Github Discussions](https://github.com/Volte6/GoMud/discussions)
22+
23+
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# World Building
2+
3+
This section contains instructions on how to add content to your world, mostly using in-game admin commands.
4+
Not everything is possible via admin commands, and more advanced building may require editing the `.yaml` datafiles for a given room, item, mob, etc.
5+
6+
### Creating Your Own Zone
7+
Zones are essentially a collection of rooms and will help to organize your room creation process.
8+
9+
#### Step 1: Define the Zone
10+
11+
Use the `build zone` command to create a new zone:
12+
```
13+
build zone "My Custom Zone"
14+
```
15+
This will automatically create an empty room within the zone.
16+
17+
#### Step 2: Configure Zone Properties
18+
19+
1. Retrieve the zone configuration information using:
20+
```
21+
zone info
22+
```
23+
2. Set auto-scaling for MOBs (optional): MOBs, or "mobile objects," are characters or creatures in the game world that can interact with players. Auto-scaling adjusts their difficulty based on the specified range, making gameplay more balanced and engaging.
24+
```
25+
zone set autoscale [lowend] [highend]
26+
```
27+
Example: `zone set autoscale 5 10`
28+
29+
---
30+
31+
### Creating Rooms, Exits, and Defining Nouns
32+
33+
#### Step 1: Create a Room
34+
35+
1. Move to the desired zone using the `room [room #]` command (e.g., `room 1`).
36+
2. Set properties for the room:
37+
- To set a title: `room set title "A Castle Drawbridge"`
38+
- To set a description: `room set description "You see a drawbridge."`
39+
- To set idle messages: `room set idlemessages "The wind blows.;The sand falls."`
40+
3. Verify or retrieve room information using:
41+
42+
```
43+
room info
44+
```
45+
46+
Make sure to note down the room number, as it will help you navigate back to it quickly later.
47+
48+
#### Step 2: Add Exits
49+
50+
1. Create an exit linking rooms:
51+
```
52+
room exit [exit_name] [room_id]
53+
```
54+
Example: `room exit west 159`
55+
2. Rename an existing exit (non-numeric names only):
56+
```
57+
room exit edit [exit_name] [new_exit_name]
58+
```
59+
Example: `room exit edit climb jump`
60+
3. Toggle the secrecy of an exit:
61+
```
62+
room secretexit [exit_name]
63+
```
64+
Example: `room secretexit south`
65+
66+
#### Step 3: Define Nouns
67+
To add more detail to your environment, you may choose to give certain nouns their own description.
68+
69+
1. Add or overwrite nouns in the room:
70+
```
71+
room noun [name] [description]
72+
```
73+
Example: `room noun chair "A wooden chair with intricate carvings."`
74+
2. List all nouns in the room using:
75+
```
76+
room nouns
77+
```
78+
79+
---
80+
81+
### Creating a MOB/NPC
82+
83+
1. Use the `mob create` command to start the interactive tutorial for creating a new MOB. Follow the prompts to define the name, description, and other properties.
84+
2. Once created, spawn the NPC into a room with
85+
```
86+
mob spawn [name]
87+
```
88+
Replace `[name]` with the name of your NPC to place it in the current room. 
89+
3. Once you've tested your mob, be sure to add the mob to the room's YAML configuration file; otherwise, the NPC will be lost during server cleanup processes. For example, in your room YAML file, you can add the following:
90+
91+
```yaml
92+
spawninfo:
93+
- mobid: 2
94+
message: A town guard emerges from a nearby building.
95+
idlecommands:
96+
- say did you know there's a sign in the Townsquare with a map of the area?
97+
98+
```
99+
---
100+
### Maintaining and Restarting the Server
101+
102+
1\. To stop the running server for maintenance or to restart it, press `Ctrl + C` in the terminal where the server is running. This will safely terminate the process.
103+
104+
2\. Type ''go run .'' again to restart the server.
105+
106+
---
107+
### Starting your own empty MUD world
108+
Now that you've got the basics down, it's time to start a fresh world and begin your creation journey.
109+
The ``_datafiles/world`` folder has a folder called ``empty`` inside of it. Make a copy of that folder and give it your own name (i.e. ``sudo cp -r empty/ myworld/``).
110+
Then edit your ``_datafiles/config.yaml`` ``FolderDataFiles:`` field to point to your new world folder.
111+
112+
## Updating from master branch
113+
To update your local GoMUD installation when new updates are available on the master branch of the GitHub repository:
114+
115+
cd GoMud
116+
117+
git pull origin master
118+
119+
go build
120+
121+
This will fetch the latest updates and rebuild the application.
122+

internal/scripting/docs/FUNCTIONS_ACTORS.md renamed to _datafiles/guides/building/scripting/FUNCTIONS_ACTORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ Check whether an ActorObject has an item id in their backpack
365365
## [ActorObject.GetBackpackItems() []ItemObject](/internal/scripting/actor_func.go)
366366
Get a list of Item objects in the ActorObjects backpack
367367

368-
_Note: See [/scripting/docs/FUNCTIONS_ITEMS.md](/internal/scripting/docs/FUNCTIONS_ITEMS.md) for details on ItemObject objects._
368+
_Note: See [/scripting/docs/FUNCTIONS_ITEMS.md](FUNCTIONS_ITEMS.md) for details on ItemObject objects._
369369

370370
## [ActorObject.GetAlignment() int](/internal/scripting/actor_func.go)
371371
Get the numeric representation of a ActorObjects alignment, from -100 to 100
File renamed without changes.
File renamed without changes.

internal/scripting/docs/FUNCTIONS_ROOMS.md renamed to _datafiles/guides/building/scripting/FUNCTIONS_ROOMS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ _Note: This is useful for long term saving/retrieving data between room scripts,
8282
## [RoomObject.GetItems() []ItemObject](/internal/scripting/room_func.go)
8383
Returns an array of items on the floor of the room.
8484

85-
_Note: See [/scripting/docs/FUNCTIONS_ITEMS.md](/internal/scripting/docs/FUNCTIONS_ITEMS.md) for details on ItemObject objects._
85+
_Note: See [/scripting/docs/FUNCTIONS_ITEMS.md](FUNCTIONS_ITEMS.md) for details on ItemObject objects._
8686

8787
## [RoomObject.DestroyItem(itm ScriptItem) ](/internal/scripting/room_func.go)
8888
Destroy an item from the ground.
File renamed without changes.

internal/scripting/README.md renamed to _datafiles/guides/building/scripting/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@
33
All scripting is in [ECMAScript 5.1](https://en.wikipedia.org/wiki/ECMAScript) (AKA javascript).
44

55
# Room Scripting
6-
See [Room Scripting](/internal/scripting/docs/SCRIPTING_ROOMS.md)
6+
See [Room Scripting](SCRIPTING_ROOMS.md)
77

88
# Mob Scripting
9-
See [Mob Scripting](/internal/scripting/docs/SCRIPTING_MOBS.md)
9+
See [Mob Scripting](SCRIPTING_MOBS.md)
1010

1111
# Item Scripting
12-
See [Item Scripting](/internal/scripting/docs/SCRIPTING_ITEMS.md)
12+
See [Item Scripting](SCRIPTING_ITEMS.md)
1313

1414
# Buff Scripting
15-
See [Buff Scripting](/internal/scripting/docs/SCRIPTING_BUFFS.md)
15+
See [Buff Scripting](SCRIPTING_BUFFS.md)
1616

1717
# Spell Scripting
18-
See [Spell Scripting](/internal/scripting/docs/SCRIPTING_SPELLS.md)
18+
See [Spell Scripting](SCRIPTING_SPELLS.md)
1919

2020
# Script Functions
2121

22-
[ActorObject Functions](/internal/scripting/docs/FUNCTIONS_ACTORS.md) - Functions that query or alter user/mob data.
22+
[ActorObject Functions](FUNCTIONS_ACTORS.md) - Functions that query or alter user/mob data.
2323

24-
[RoomObject Functions](/internal/scripting/docs/FUNCTIONS_ROOMS.md) - Functions that query or alter room data.
24+
[RoomObject Functions](FUNCTIONS_ROOMS.md) - Functions that query or alter room data.
2525

26-
[ItemObject Functions](/internal/scripting/docs/FUNCTIONS_ITEMS.md) - Functions that query or alter item data.
26+
[ItemObject Functions](FUNCTIONS_ITEMS.md) - Functions that query or alter item data.
2727

28-
[Utility Functions](/internal/scripting/docs/FUNCTIONS_UTIL.md) - Helper and info functions.
28+
[Utility Functions](FUNCTIONS_UTIL.md) - Helper and info functions.
2929

30-
[Messaging Functions](/internal/scripting/docs/FUNCTIONS_MESSAGING.md) - Helper and info functions.
30+
[Messaging Functions](FUNCTIONS_MESSAGING.md) - Helper and info functions.
3131

3232
# Special symbols in user or mob commands:
3333

internal/scripting/docs/SCRIPTING_BUFFS.md renamed to _datafiles/guides/building/scripting/SCRIPTING_BUFFS.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
# Buff Scripting
22

33
Example Script:
4-
* [Mob Script Tag Instance Script (hungry)](../../../_datafiles/mobs/frostfang/scripts/2-hungry.js)
5-
* [Mob Script Tag defined in Spawninfo (hungry)](../../../_datafiles/rooms/frostfang/271.yaml)
4+
* [Buff Definition](/_datafiles/world/default/buffs/1-illumination.yaml)
5+
* [Buff Script](/_datafiles/world/default/buffs/1-illumination.js)
66

77
## Script paths
88

99
All mob scripts reside in a subfolder of their zone/definition file.
1010

11-
For example, the mob located at `../../../_datafiles/mobs/frostfang/2.yaml` would place its script at `../../../_datafiles/mobs/frostfang/scripts/2.js`
12-
13-
If a mob defined in a rooms spawninfo has a `scripttag` defined, it will be appended to the mobs script path with a hyphen.
14-
15-
For example, `scripttag: hungry` for mob `2` (as above) would load the script `../../../_datafiles/mobs/frostfang/scripts/2-hungry.js`
16-
17-
In this way you can have generic scripts for a mob id, or specific scripts for special rooms or circumstances.
11+
For example, the mob located at [/_datafiles/world/default/buffs/1-illumination.yaml](/_datafiles/world/default/buffs/1-illumination.yaml) would place its script at [/_datafiles/world/default/buffs/1-illumination.js](/_datafiles/world/default/buffs/1-illumination.js)
1812

1913
# Script Functions and Rules
2014

0 commit comments

Comments
 (0)