First commit
This commit is contained in:
+45
@@ -0,0 +1,45 @@
|
||||
# FAQ
|
||||
|
||||
## Where did `MinigameAreaVolume` go?
|
||||
|
||||
It was removed. The mod now uses normal Hytale trigger volumes for areas and interactions. Create a Hytale trigger volume, shape it around the arena, name or tag it for the minigame, and attach minigame trigger conditions/effects.
|
||||
|
||||
## Why remove custom minigame volume types?
|
||||
|
||||
They duplicated Hytale's trigger-volume system. The current approach is closer to Hytale's built-in style: use the engine's volume system and register only the minigame-specific conditions/effects that the engine did not already have.
|
||||
|
||||
## Why is `MinigameId` a dropdown now?
|
||||
|
||||
`MinigameCorePlugin` registers `MinigameDefinition` as a trigger-volume asset source and registers `MinigameId` fields against it. The trigger-volume editor can then show loaded minigames instead of requiring a typed string.
|
||||
|
||||
## Why is my minigame not in the dropdown?
|
||||
|
||||
Check:
|
||||
|
||||
- The JSON is under `Server/Minigames/`.
|
||||
- The filename matches the `Id`.
|
||||
- The asset loaded without codec errors.
|
||||
- The server was restarted or the asset was reloaded after adding the file.
|
||||
|
||||
## Can I still start games with commands?
|
||||
|
||||
Yes.
|
||||
|
||||
```text
|
||||
/minigame enable My_Game
|
||||
/minigame start My_Game
|
||||
```
|
||||
|
||||
Commands are useful for testing and admin control. In-world game flow should use Hytale trigger volumes with minigame trigger effects.
|
||||
|
||||
## Can two minigames run at the same time?
|
||||
|
||||
Yes. Active runtimes are keyed by runtime ID, and one minigame can have multiple active runtimes on different discovered maps or variants.
|
||||
|
||||
## How do I award score from a volume?
|
||||
|
||||
Attach `ModifyPlayerScore` or `ModifyTeamScore` to a normal Hytale trigger volume. Add `PlayerInMinigame` if the effect should only run for players already participating.
|
||||
|
||||
## My condition has an optional `PlayerId`. Should I fill it?
|
||||
|
||||
Usually leave it blank for player-caused trigger-volume events. The effect or condition will try to resolve the triggering player from the trigger context. Use an explicit `PlayerId` only for non-player-driven logic.
|
||||
@@ -0,0 +1,61 @@
|
||||
# Getting Started
|
||||
|
||||
## 1. Build and run
|
||||
|
||||
```bash
|
||||
gradlew.bat shadowJar
|
||||
gradlew.bat runServer
|
||||
```
|
||||
|
||||
## 2. Create a minigame asset
|
||||
|
||||
Create `src/main/resources/Server/Minigames/My_Game.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"Id": "My_Game",
|
||||
"Name": "My Game",
|
||||
"Description": "A quick test minigame.",
|
||||
"Enabled": true,
|
||||
"MinPlayers": 1,
|
||||
"MaxPlayers": 4,
|
||||
"TeamMode": "SOLO",
|
||||
"WinCondition": "HIGHEST_SCORE",
|
||||
"RoundLengthSeconds": 120,
|
||||
"CountdownSeconds": 5
|
||||
}
|
||||
```
|
||||
|
||||
The filename and `Id` should match.
|
||||
|
||||
## 3. Confirm the asset loaded
|
||||
|
||||
```text
|
||||
/minigame list
|
||||
/minigame info My_Game
|
||||
/minigame validate My_Game
|
||||
```
|
||||
|
||||
## 4. Add trigger-volume logic
|
||||
|
||||
Use the Hytale trigger-volume editor:
|
||||
|
||||
1. Create a normal trigger volume.
|
||||
2. Add the `StartMinigame` effect.
|
||||
3. Set `MinigameId` to `My_Game` from the dropdown.
|
||||
|
||||
To make the volume award score:
|
||||
|
||||
1. Add the `PlayerInMinigame` condition.
|
||||
2. Add the `ModifyPlayerScore` effect.
|
||||
3. Set `Operation = ADD` and `Amount = 1`.
|
||||
|
||||
## 5. Start from commands when needed
|
||||
|
||||
```text
|
||||
/minigame enable My_Game
|
||||
/minigame join My_Game
|
||||
/minigame start My_Game
|
||||
```
|
||||
|
||||
Command starts are useful for testing. Production interaction should normally come from Hytale trigger volumes.
|
||||
@@ -0,0 +1,46 @@
|
||||
# core-minigames Wiki
|
||||
|
||||
core-minigames is a Hytale-native minigame extension. It adds minigame definitions, runtime state, and minigame-specific trigger conditions/effects while reusing Hytale's asset store, trigger-volume system, and event bus.
|
||||
|
||||
## What It Provides
|
||||
|
||||
1. `MinigameDefinition` assets in `Server/Minigames/`.
|
||||
2. A runtime service for active minigames, players, teams, scores, lives, counters, and phases.
|
||||
3. Hytale `TriggerCondition` entries for checking minigame state.
|
||||
4. Hytale `TriggerEffect` entries for mutating minigame state.
|
||||
5. `MinigameEvent` dispatch through Hytale's event bus.
|
||||
|
||||
## Important Refactor Note
|
||||
|
||||
The old custom minigame volume layer is gone. There is no `MinigameAreaVolume`, `JoinQueueVolume`, or `ScoreVolume` class to place. Use normal Hytale trigger volumes and attach core-minigames trigger conditions/effects to them.
|
||||
|
||||
## Pages
|
||||
|
||||
| Page | Description |
|
||||
|------|-------------|
|
||||
| [Getting Started](Getting-Started.md) | Create a definition and wire a trigger volume |
|
||||
| [How It Works](How-It-Works.md) | How assets, runtime, event bus, and trigger logic fit together |
|
||||
| [FAQ](FAQ.md) | Common questions and troubleshooting |
|
||||
|
||||
## Quick Reference
|
||||
|
||||
```text
|
||||
/minigame create My_Game "My Game"
|
||||
/minigame enable My_Game
|
||||
/minigame start My_Game
|
||||
```
|
||||
|
||||
Minimal asset:
|
||||
|
||||
```json
|
||||
{
|
||||
"Id": "My_Game",
|
||||
"Name": "My Game",
|
||||
"Enabled": true,
|
||||
"MinPlayers": 1,
|
||||
"MaxPlayers": 8,
|
||||
"TeamMode": "SOLO",
|
||||
"WinCondition": "HIGHEST_SCORE",
|
||||
"RoundLengthSeconds": 180
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,102 @@
|
||||
# How It Works
|
||||
|
||||
## Assets
|
||||
|
||||
Each minigame is a `MinigameDefinition` asset loaded from `Server/Minigames/`. Hytale's asset store owns loading and editor integration.
|
||||
|
||||
## Runtime
|
||||
|
||||
When a minigame starts, the runtime service creates a `MinigameRuntime` keyed by runtime ID. Runtime state tracks phase, players, teams, scores, lives, counters, objectives, spectators, eliminated players, map ID, and variant ID.
|
||||
|
||||
## Events
|
||||
|
||||
Runtime lifecycle events are emitted as `MinigameEvent` and dispatched through Hytale's event bus.
|
||||
|
||||
Current emitted event IDs:
|
||||
|
||||
- `on_game_start`
|
||||
- `on_game_end`
|
||||
- `on_arena_reset`
|
||||
- `on_phase_change`
|
||||
- `on_round_start`
|
||||
- `on_round_end`
|
||||
- `on_game_rounds_complete`
|
||||
- `on_timer_expired`
|
||||
- `on_player_eliminated`
|
||||
- `on_objective_complete`
|
||||
- `on_kill_score`
|
||||
|
||||
## Trigger Conditions
|
||||
|
||||
Minigame conditions are Hytale `TriggerCondition` types. They check runtime state and can be attached to normal Hytale trigger volumes or trigger effect assets.
|
||||
|
||||
Current condition type IDs:
|
||||
|
||||
- `MinigamePhase`
|
||||
- `PlayerInMinigame`
|
||||
- `PlayerStatus`
|
||||
- `PlayerScore`
|
||||
- `TeamScore`
|
||||
- `Counter`
|
||||
- `CurrentRound`
|
||||
- `PlayerLives`
|
||||
- `TeamCondition`
|
||||
- `TimerElapsed`
|
||||
- `ObjectiveStatus`
|
||||
- `WinConditionMet`
|
||||
|
||||
## Trigger Effects
|
||||
|
||||
Minigame effects are Hytale `TriggerEffect` types. They mutate runtime state or call runtime lifecycle operations.
|
||||
|
||||
Current effect type IDs:
|
||||
|
||||
- `StartMinigame`
|
||||
- `EndMinigame`
|
||||
- `ResetMinigame`
|
||||
- `SetMinigamePhase`
|
||||
- `ResetScores`
|
||||
- `ModifyPlayerScore`
|
||||
- `ModifyTeamScore`
|
||||
- `ModifyCounter`
|
||||
- `ModifyPlayerLives`
|
||||
- `SetPlayerStatus`
|
||||
- `JoinMinigameQueue`
|
||||
- `LeaveMinigameQueue`
|
||||
- `VoteForMap`
|
||||
- `StartQueuedMinigame`
|
||||
- `SpawnItem`
|
||||
- `SetRound`
|
||||
- `StartTimer`
|
||||
- `StopTimer`
|
||||
- `SetSpawnPoint`
|
||||
- `RespawnPlayer`
|
||||
- `SendMinigameMessage`
|
||||
- `AssignTeam`
|
||||
- `SaveInventory`
|
||||
- `RestoreInventory`
|
||||
- `ClearInventory`
|
||||
- `SetObjectiveStatus`
|
||||
- `ModifyObjectiveProgress`
|
||||
- `AwardKillScore`
|
||||
|
||||
## Volumes
|
||||
|
||||
Volumes are Hytale trigger volumes. core-minigames does not define separate volume classes.
|
||||
|
||||
The normal flow is:
|
||||
|
||||
```text
|
||||
Hytale trigger volume fires
|
||||
|
|
||||
v
|
||||
Minigame TriggerCondition entries evaluate
|
||||
|
|
||||
v
|
||||
Minigame TriggerEffect entries execute
|
||||
|
|
||||
v
|
||||
MinigameRuntime changes
|
||||
```
|
||||
|
||||
Fields named `MinigameId` are registered as asset picker fields, so the editor can show loaded minigame assets as dropdown options.
|
||||
Reference in New Issue
Block a user