Skip to content

Commit

Permalink
docs(VParticleEffectController): add documentation for zCPFXController
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Dec 28, 2023
1 parent 9fbaf72 commit cfb0cb9
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 7 deletions.
44 changes: 44 additions & 0 deletions docs/engine/objects/zCPFXController.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# zCPFXController

!!! abstract inline end "Quick Infos"
**Type:** Virtual Object<br/>
**Format Name:** ZenGin Archive<br/>
**File Extension:** `.ZEN`<br/>
**Class Name:** `zCPFXControler`<br/>
**Version Identifiers:**<br />
— Gothic I: `12289`<br/>
— Gothic II: `52224`<br/>
**ZenKit Class:** `VParticleEffectController`

A particle system in virtual space. Its effect can be activated and deactivated using the `OnTrigger` and `OnUntrigger`
events.

<ul class="sp-list">
<li class="sp-type"><a href="../zCVob/">zCVob</a></li>
<li class="sp-type">
<span>zCPFXController</span>
<ul class="sp-list">
<li class="sp-string"><a href="#pfxName">pfxName</a> = ""</li>
<li class="sp-bool"><a href="#killVobWhenDone">killVobWhenDone</a> = TRUE</li>
<li class="sp-bool"><a href="#pfxStartOn">pfxStartOn</a> = TRUE</li>
</ul>
</li>
</ul>

## Properties

<a name="pfxName" class="t-str"></a> `pfxName`

: The name of the particle effect. Corresponds to a `.ZEN` file containing the particle system definition.

<a name="killVobWhenDone" class="t-bool"></a> `killVobWhenDone`

: Disable the particle effect after it runs once.

<a name="pfxStartOn" class="t-bool"></a> `pfxStartOn`

: Whether to start the particle effect when the level is loaded.

* `TRUE` — Start the particle effect when loading the world.
* `FALSE` — Don't start the particle effect automatically.

30 changes: 23 additions & 7 deletions include/zenkit/vobs/Misc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -147,25 +147,41 @@ namespace zenkit {
[[nodiscard]] ZKAPI uint16_t get_version_identifier(GameVersion game) const override;
};

/// \brief A VOb representing a particle system controller.
/// \brief A particle system in virtual space.
///
/// Its effect can be activated and deactivated using the `OnTrigger` and `OnUntrigger` events.
///
/// \see https://zk.gothickit.dev/engine/objects/zCPFXController/
struct VParticleEffectController : VirtualObject {
ZK_OBJECT(ObjectType::zCPFXController);

public:
/// \brief The name of the particle effect.
///
/// Corresponds to a `.ZEN` file containing the particle system definition.
///
/// \see https://zk.gothickit.dev/engine/objects/zCPFXController/#pfxName
std::string pfx_name;

/// \brief Disable the particle effect after it runs once.
/// \see https://zk.gothickit.dev/engine/objects/zCPFXController/#killVobWhenDone
bool kill_when_done;

/// \brief Whether to start the particle effect when the level is loaded.
/// \see https://zk.gothickit.dev/engine/objects/zCPFXController/#pfxStartOn
bool initially_running;

/// \brief Parses a particle system controller VOb the given *ZenGin* archive.
/// \param[out] obj The object to read.
/// \param[in,out] ctx The archive reader to read from.
/// \note After this function returns the position of \p ctx will be at the end of the parsed object.
/// \throws ParserError if parsing fails.
/// \see vob::parse
ZKREM("use ::load()")
ZKAPI static void parse(VParticleEffectController& obj, ReadArchive& ctx, GameVersion version);

/// \brief Load this object from the given archive.
/// \param r The archive to read from;
/// \param version The version of the game the object was made for.
ZKAPI void load(ReadArchive& r, GameVersion version) override;

/// \brief Save this object to the given archive.
/// \param w The archive to save to.
/// \param version The version of the game to save for.
ZKAPI void save(WriteArchive& w, GameVersion version) const override;
};

Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ nav:
- 'zCVobSpot': 'engine/objects/zCVobSpot.md'
- 'zCVobStair': 'engine/objects/zCVobStair.md'
- 'zCVobStartpoint': 'engine/objects/zCVobStartpoint.md'
- 'zCPFXControler': 'engine/objects/zCPFXControler.md'
- 'oCItem': 'engine/objects/oCItem.md'
- 'zCVisual': 'engine/objects/zCVisual.md'
- 'zCDecal': 'engine/objects/zCDecal.md'
Expand Down

0 comments on commit cfb0cb9

Please sign in to comment.