Skip to content

Commit 1e8d73d

Browse files
committed
v0.1.2 release
1 parent 99154a1 commit 1e8d73d

9 files changed

Lines changed: 922 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ignore ScheduleOne and ScheduleLua directories (This is so my, Bars, PC doesn't commit them)
2-
/ScheduleOne/
32
/ScheduleLua/
3+
/ScheduleOne/
44

55
# Node dependencies
66
node_modules/

docs/.vitepress/config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = {
2121
{ text: 'Guide', link: '/guide/' },
2222
{ text: 'API Reference', link: '/api/' },
2323
{ text: 'Examples', link: '/examples/' },
24+
{ text: 'Database', link: '/database/' },
2425
{
2526
text: 'Development',
2627
items: [
@@ -177,6 +178,19 @@ module.exports = {
177178
}
178179
]
179180
}
181+
],
182+
'/database/': [
183+
{
184+
text: 'Game Database',
185+
collapsed: false,
186+
items: [
187+
{ text: 'Overview', link: '/database/' },
188+
{ text: 'NPC Database', link: '/database/npcs' },
189+
{ text: 'Item Database', link: '/database/items' },
190+
{ text: 'Prefab Database', link: '/database/prefabs' },
191+
{ text: 'Region Database', link: '/database/regions' },
192+
]
193+
}
180194
]
181195
},
182196

docs/api/npc/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ When creating commands that utilize the NPC API, follow these best practices:
210210
4. **Include proper error handling** for cases when NPCs don't exist or parameters are invalid
211211
5. **Return success/failure status** to provide feedback to the user
212212

213-
See the [Command API documentation](../registry/commands.md) for more details on registering and managing console commands.
213+
See the [Command API documentation](../core/commands.md) for more details on registering and managing console commands.
214214

215215
Stay tuned for updates to the API as development progresses.
216216

docs/database/index.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Game Database
2+
3+
Welcome to the Schedule 1 Game Database. This section provides searchable reference tables for various game IDs and assets.
4+
5+
## Available Databases
6+
7+
- [NPC Database](./npcs) - Find NPCs by ID, name and region
8+
- [Item Database](./items) - Find items by ID, category and properties
9+
- [Prefab Database](./prefabs) - Find prefabs by ID and type
10+
- [Region Database](./regions) - Find information about game regions
11+
12+
## About This Database
13+
14+
This database section provides structured information about game objects that can be referenced when writing Lua scripts. Each database page includes:
15+
16+
- Searchable tables with filtering capabilities
17+
- Key information for each object type
18+
- Copy-to-clipboard functionality for IDs
19+
- Example code snippets for common use cases
20+
21+
Select a database from the menu to begin browsing.

docs/database/items.md

Lines changed: 344 additions & 0 deletions
Large diffs are not rendered by default.

docs/database/npcs.md

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# NPC Database
2+
3+
<div class="custom-block tip">
4+
<p><strong>Usage:</strong> Use the search box to filter NPCs by ID, name, or region. Click on an NPC ID to copy it to clipboard.</p>
5+
</div>
6+
7+
<div class="custom-block warning">
8+
<p><strong>Incomplete Database:</strong> This NPC database is currently under development and does not contain all NPCs available in the game. More entries will be added in future updates.</p>
9+
</div>
10+
11+
<script setup>
12+
import { ref, computed, onMounted } from 'vue'
13+
14+
const npcs = ref([
15+
{ id: 'doris_lubbin', name: 'Doris Lubbin', region: 'DOWNTOWN', description: 'Local shop owner' },
16+
])
17+
18+
const searchQuery = ref('')
19+
const selectedRegion = ref('ALL')
20+
21+
const regions = computed(() => {
22+
const uniqueRegions = new Set(['ALL'])
23+
npcs.value.forEach(npc => uniqueRegions.add(npc.region))
24+
return Array.from(uniqueRegions)
25+
})
26+
27+
const filteredNpcs = computed(() => {
28+
return npcs.value.filter(npc => {
29+
const matchesSearch = searchQuery.value === '' ||
30+
npc.id.toLowerCase().includes(searchQuery.value.toLowerCase()) ||
31+
npc.name.toLowerCase().includes(searchQuery.value.toLowerCase()) ||
32+
npc.description.toLowerCase().includes(searchQuery.value.toLowerCase())
33+
34+
const matchesRegion = selectedRegion.value === 'ALL' || npc.region === selectedRegion.value
35+
36+
return matchesSearch && matchesRegion
37+
})
38+
})
39+
40+
const copyToClipboard = (text) => {
41+
navigator.clipboard.writeText(text)
42+
alert(`Copied: ${text}`)
43+
}
44+
</script>
45+
46+
<div class="database-controls">
47+
<div class="search-box">
48+
<input
49+
v-model="searchQuery"
50+
type="text"
51+
placeholder="Search by ID, name or description..."
52+
/>
53+
</div>
54+
55+
<div class="filter-box">
56+
<label for="region-filter">Filter by region:</label>
57+
<select v-model="selectedRegion" id="region-filter">
58+
<option v-for="region in regions" :key="region" :value="region">
59+
{{ region }}
60+
</option>
61+
</select>
62+
</div>
63+
</div>
64+
65+
<table class="database-table">
66+
<thead>
67+
<tr>
68+
<th>NPC ID</th>
69+
<th>Name</th>
70+
<th>Region</th>
71+
<th>Description</th>
72+
</tr>
73+
</thead>
74+
<tbody>
75+
<tr v-for="npc in filteredNpcs" :key="npc.id">
76+
<td class="id-cell" @click="copyToClipboard(npc.id)">{{ npc.id }}</td>
77+
<td>{{ npc.name }}</td>
78+
<td>{{ npc.region }}</td>
79+
<td>{{ npc.description }}</td>
80+
</tr>
81+
<tr v-if="filteredNpcs.length === 0">
82+
<td colspan="4" class="no-results">No NPCs match your search criteria</td>
83+
</tr>
84+
</tbody>
85+
</table>
86+
87+
## Example Usage
88+
89+
```lua
90+
-- Get information about an NPC
91+
local npc = GetNPC("doris_lubbin")
92+
93+
if npc then
94+
Log("Found NPC: " .. npc.FullName)
95+
Log("Current region: " .. npc.Region)
96+
97+
-- Get NPC position
98+
local position = GetNPCPosition(npc)
99+
Log("Position: " .. position.x .. ", " .. position.y .. ", " .. position.z)
100+
end
101+
102+
-- Check if NPC is in a specific region
103+
if IsNPCInRegion("mayor_wilson", "CITY_HALL") then
104+
Log("The mayor is at City Hall")
105+
else
106+
Log("The mayor is not at City Hall")
107+
end
108+
```
109+
110+
<style>
111+
.database-controls {
112+
display: flex;
113+
flex-wrap: wrap;
114+
gap: 1rem;
115+
margin-bottom: 1rem;
116+
}
117+
118+
.search-box input {
119+
width: 300px;
120+
padding: 0.5rem;
121+
border: 1px solid var(--vp-c-divider);
122+
border-radius: 4px;
123+
}
124+
125+
.filter-box {
126+
display: flex;
127+
align-items: center;
128+
gap: 0.5rem;
129+
}
130+
131+
.filter-box select {
132+
padding: 0.5rem;
133+
border: 1px solid var(--vp-c-divider);
134+
border-radius: 4px;
135+
background-color: var(--vp-c-bg);
136+
color: var(--vp-c-text-1);
137+
}
138+
139+
.database-table {
140+
width: 100%;
141+
border-collapse: collapse;
142+
margin-bottom: 2rem;
143+
}
144+
145+
.database-table th,
146+
.database-table td {
147+
padding: 0.75rem;
148+
border: 1px solid var(--vp-c-divider);
149+
text-align: left;
150+
}
151+
152+
.database-table th {
153+
background-color: var(--vp-c-bg-soft);
154+
font-weight: bold;
155+
}
156+
157+
.database-table tr:nth-child(even) {
158+
background-color: var(--vp-c-bg-soft);
159+
}
160+
161+
.id-cell {
162+
font-family: monospace;
163+
cursor: pointer;
164+
color: var(--vp-c-brand);
165+
transition: background-color 0.2s;
166+
}
167+
168+
.id-cell:hover {
169+
background-color: var(--vp-c-brand-dimm);
170+
}
171+
172+
.no-results {
173+
text-align: center;
174+
font-style: italic;
175+
color: var(--vp-c-text-2);
176+
}
177+
</style>

0 commit comments

Comments
 (0)