diff --git a/Documentation/doc/1 modules/Effects.html b/Documentation/doc/1 modules/Effects.html index 1fc0fca36..bd8122a19 100644 --- a/Documentation/doc/1 modules/Effects.html +++ b/Documentation/doc/1 modules/Effects.html @@ -140,7 +140,7 @@ Emit blood. - EmitAirBubble(pos[, size][, amplitude]) + EmitAirBubble(pos[, size][, amp]) Emit air bubble in a water room. @@ -251,51 +251,51 @@
  • gravity float - (default 0) Specifies if the particle will fall over time. Positive values ascend, negative values descend. Recommended range: [-1000 and 1000]. + Specifies if the particle will fall over time. Positive values ascend, negative values descend. Recommended range: [-1000 and 1000]. Default: 0
  • rotVel float - (default 0) Rotational velocity in degrees. + Rotational velocity in degrees. Default: 0
  • startColor Color - (default Color(255, 255, 255)) Color at start of life. + Color at start of life. Default: Color(255, 255, 255)
  • endColor Color - (default Color(255, 255, 255)) Color to fade toward. This will finish long before the end of the particle's life due to internal math. + Color to fade toward. This will finish long before the end of the particle's life due to internal math. Default: Color(255, 255, 255)
  • blendMode BlendID - (default TEN.Effects.BlendID.ALPHABLEND) Render blend mode. + Render blend mode. TEN.Effects.BlendID.ALPHABLEND
  • startSize float - (default 10) Size at start of life. + Size at start of life. Default: 10
  • endSize float - (default 0) Size at end of life. The particle will linearly shrink or grow toward this size over its lifespan. + Size at end of life. The particle will linearly shrink or grow toward this size over its lifespan. Default: 0
  • life float - (default 2) Lifespan in seconds. + Lifespan in seconds. Default: 2
  • applyDamage bool - (default false) Specifies if the particle will harm the player on collision. + Specify if the particle will harm the player on collision. Default: false
  • applyPoison bool - (default false) Specifies if the particle will poison the player on collision. + Specify if the particle will poison the player on collision. Default: false
  • spriteSeqID ObjID - (default Objects.ObjID.DEFAULT_SPRITES) ID of the sprite sequence object. + ID of the sprite sequence object. Default: Objects.ObjID.DEFAULT_SPRITES
  • startRot float - (default random) Rotation at start of life. + Rotation at start of life. Default: random
  • @@ -504,7 +504,7 @@
    - EmitAirBubble(pos[, size][, amplitude]) + EmitAirBubble(pos[, size][, amp])
    Emit air bubble in a water room. @@ -515,16 +515,16 @@ diff --git a/Documentation/doc/1 modules/Objects.html b/Documentation/doc/1 modules/Objects.html index 7c87793aa..6656fc58d 100644 --- a/Documentation/doc/1 modules/Objects.html +++ b/Documentation/doc/1 modules/Objects.html @@ -107,7 +107,7 @@

    Table Objects

    -

    Moveables, statics, cameras, and so on.

    +

    Objects including moveables, statics, cameras, and others.

    diff --git a/Documentation/doc/2 classes/Objects.Moveable.html b/Documentation/doc/2 classes/Objects.Moveable.html index 1e6f612e2..63a80a38c 100644 --- a/Documentation/doc/2 classes/Objects.Moveable.html +++ b/Documentation/doc/2 classes/Objects.Moveable.html @@ -108,7 +108,7 @@

    Class Objects.Moveable

    Represents a moveable object in the game world.

    -

    Examples include traps, enemies, doors, pickups, and the player. See also Objects.LaraObject for player-specific features.

    +

    Examples include the player, traps, enemies, doors, and pickups. See also Objects.LaraObject for player-specific features.

    pragma nostrip

    @@ -436,7 +436,7 @@ most can just be ignored (see usage).
  • name string - Lua name of the item + Lua name.
  • position Vec3 @@ -460,11 +460,11 @@ most can just be ignored (see usage).
  • hp int - HP of item + Hit points.
  • OCB int - ocb of item + Object code bits.
  • AIBits table diff --git a/Documentation/doc/2 classes/Objects.Static.html b/Documentation/doc/2 classes/Objects.Static.html index 0c47b297b..1f1daa85c 100644 --- a/Documentation/doc/2 classes/Objects.Static.html +++ b/Documentation/doc/2 classes/Objects.Static.html @@ -107,7 +107,7 @@

    Class Objects.Static

    -

    Statics

    +

    Represents a static object in the game world.

    @@ -115,88 +115,85 @@

    Functions

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - +
    Static:Enable()Enable the static, for cases when it was shattered or manually disabled before.
    Static:Disable()Disable the static
    Static:GetActive()Get static mesh visibility
    Static:GetSolid()Get static mesh solid collision state
    Static:SetSolid(solidState)Set static mesh solid collision state
    Static:GetPosition()Get the static's position
    Static:SetPosition(position)Set the static's position
    Static:GetRotation()Get the static's rotation
    Static:SetRotation(rotation)Set the static's rotation
    Static:GetScale()Get the static's scale
    Static:SetScale(scale)Set the static's scale
    Static:GetHP()Get current HP (hit points/health points) - Used only with shatterable static meshes.
    Static:SetHP(HP)Set current HP (hit points/health points) - Used only with shatterable static meshes.
    Static:GetName()Get the static's unique string identifier
    Static:SetName(name)Set the static's name (its unique string identifier) - e.g.Get this static's unique string identifier.
    Static:GetSlot()Get the static's slot number (as listed in Tomb Editor and WadTool)Get this static's slot ID.
    Static:SetSlot(slot)Set the static's slot number (as listed in Tomb Editor and WadTool)Static:GetPosition()Get this static's world position.
    Static:GetRotation()Get this static's world rotation.
    Static:GetScale()Get this static's world scale.
    Static:GetColor()Get the static's colorGet this static's color.
    Static:GetHP()Get this static's hit points.
    Static:GetActive()Get this static's visibility state.
    Static:GetSolid()Get this static's solid collision state.
    Static:SetName(name)Set this static's unique identifier string.
    Static:SetSlot(New)Set this static's slot ID.
    Static:SetPosition(New)Set this static's world position.
    Static:SetRotation(New)Set this static's rotation.
    Static:SetScale(New)Set this static's world scale.
    Static:SetColor(color) Set the static's color
    Static:SetHP(New)Set this static's hit points.
    Static:SetSolid(Solid)Set this static's solid collision state.
    Static:Enable()Enable this static.
    Static:Disable()Disable this static.
    Static:Shatter()Shatter static meshShatter this static.
    @@ -208,30 +205,147 @@
    - - Static:Enable() + + Static:GetName()
    - Enable the static, for cases when it was shattered or manually disabled before. + Get this static's unique string identifier. +

    Returns:

    +
      + + string + Name string. +
    - - Static:Disable() + + Static:GetSlot()
    - Disable the static + Get this static's slot ID. +

    Returns:

    +
      + + int + Slot ID. +
    + + + + +
    +
    + + Static:GetPosition() +
    +
    + Get this static's world position. + + + + +

    Returns:

    +
      + + Vec3 + World position. +
    + + + + +
    +
    + + Static:GetRotation() +
    +
    + Get this static's world rotation. + + + + +

    Returns:

    +
      + + Rotation + World rotation. +
    + + + + +
    +
    + + Static:GetScale() +
    +
    + Get this static's world scale. + + + + +

    Returns:

    +
      + + float + World scale. +
    + + + + +
    +
    + + Static:GetColor() +
    +
    + Get this static's color. + + + + +

    Returns:

    +
      + + Color + Color. +
    + + + + +
    +
    + + Static:GetHP() +
    +
    + Get this static's hit points. Used only with shatterable statics. + + + + +

    Returns:

    +
      + + int + Hit points. +
    @@ -242,7 +356,7 @@ Static:GetActive()
    - Get static mesh visibility + Get this static's visibility state. @@ -251,7 +365,7 @@
      bool - visibility state + Visibility state.
    @@ -263,7 +377,7 @@ Static:GetSolid()
    - Get static mesh solid collision state + Get this static's solid collision state. @@ -272,224 +386,7 @@
      bool - solid collision state (true if solid, false if soft) -
    - - - - -
    -
    - - Static:SetSolid(solidState) -
    -
    - Set static mesh solid collision state - - - -

    Parameters:

    -
      -
    • solidState - bool - if set, collision will be solid, if not, will be soft -
    • -
    - - - - - -
    -
    - - Static:GetPosition() -
    -
    - Get the static's position - - - - -

    Returns:

    -
      - - Vec3 - a copy of the static's position -
    - - - - -
    -
    - - Static:SetPosition(position) -
    -
    - Set the static's position - - - -

    Parameters:

    -
      -
    • position - Vec3 - the new position of the static -
    • -
    - - - - - -
    -
    - - Static:GetRotation() -
    -
    - Get the static's rotation - - - - -

    Returns:

    -
      - - Rotation - a copy of the static's rotation -
    - - - - -
    -
    - - Static:SetRotation(rotation) -
    -
    - Set the static's rotation - - - -

    Parameters:

    -
      -
    • rotation - Rotation - the static's new rotation -
    • -
    - - - - - -
    -
    - - Static:GetScale() -
    -
    - Get the static's scale - - - - -

    Returns:

    -
      - - float - current static scale -
    - - - - -
    -
    - - Static:SetScale(scale) -
    -
    - Set the static's scale - - - -

    Parameters:

    -
      -
    • scale - Scale - the static's new scale -
    • -
    - - - - - -
    -
    - - Static:GetHP() -
    -
    - Get current HP (hit points/health points) - Used only with shatterable static meshes. - - - - -

    Returns:

    -
      - - int - the amount of HP the static currently has -
    - - - - -
    -
    - - Static:SetHP(HP) -
    -
    - Set current HP (hit points/health points) - Used only with shatterable static meshes. - - - -

    Parameters:

    -
      -
    • HP - int - the amount of HP to give the static -
    • -
    - - - - - -
    -
    - - Static:GetName() -
    -
    - Get the static's unique string identifier - - - - -

    Returns:

    -
      - - string - the static's name + Solid collision state. True: solid, False: soft
    @@ -501,8 +398,7 @@ Static:SetName(name)
    - Set the static's name (its unique string identifier) - e.g. "my_vase" or "oldrubble" + Set this static's unique identifier string. @@ -510,7 +406,7 @@
    • name string - The static's new name + New name.
    @@ -518,42 +414,21 @@ -
    -
    - - Static:GetSlot() -
    -
    - Get the static's slot number (as listed in Tomb Editor and WadTool) - - - - -

    Returns:

    -
      - - string - the static's slot number -
    - - - -
    - Static:SetSlot(slot) + Static:SetSlot(New)
    - Set the static's slot number (as listed in Tomb Editor and WadTool) + Set this static's slot ID.

    Parameters:

      -
    • slot +
    • New int - The static's slot number + slot ID.
    @@ -563,21 +438,66 @@
    - - Static:GetColor() + + Static:SetPosition(New)
    - Get the static's color + Set this static's world position. + + + +

    Parameters:

    +
      +
    • New + Vec3 + world position. +
    • +
    -

    Returns:

    -
      - Color - a copy of the static's color -
    +
    +
    + + Static:SetRotation(New) +
    +
    + Set this static's rotation. + + + +

    Parameters:

    + + + + + + +
    +
    + + Static:SetScale(New) +
    +
    + Set this static's world scale. + + + +

    Parameters:

    +
      +
    • New + Scale + world scale. +
    • +
    + @@ -604,13 +524,87 @@ +
    +
    + + Static:SetHP(New) +
    +
    + Set this static's hit points. Used only with shatterable statics. + + + +

    Parameters:

    +
      +
    • New + int + hit points. +
    • +
    + + + + + +
    +
    + + Static:SetSolid(Solid) +
    +
    + Set this static's solid collision state. + + + +

    Parameters:

    +
      +
    • Solid + bool + collision state. True: solid, False: soft +
    • +
    + + + + + +
    +
    + + Static:Enable() +
    +
    + Enable this static. Used when previously shattered disabled manually. + + + + + + + + +
    +
    + + Static:Disable() +
    +
    + Disable this static. + + + + + + + +
    Static:Shatter()
    - Shatter static mesh + Shatter this static. diff --git a/Documentation/doc/index.html b/Documentation/doc/index.html index d0f8c98d0..6af8aaac3 100644 --- a/Documentation/doc/index.html +++ b/Documentation/doc/index.html @@ -153,7 +153,7 @@ local door = GetMoveableByName("door_type4_14") Objects - Moveables, statics, cameras, and so on. + Objects including moveables, statics, cameras, and others. Sound @@ -216,7 +216,7 @@ local door = GetMoveableByName("door_type4_14") Objects.Static - Statics + Represents a static object in the game world. Objects.Volume diff --git a/TombEngine/Scripting/Internal/ReservedScriptNames.h b/TombEngine/Scripting/Internal/ReservedScriptNames.h index 99d48a6f2..60efd3357 100644 --- a/TombEngine/Scripting/Internal/ReservedScriptNames.h +++ b/TombEngine/Scripting/Internal/ReservedScriptNames.h @@ -16,7 +16,6 @@ static constexpr char ScriptReserved_Util[] = "Util"; static constexpr char ScriptReserved_Effects[] = "Effects"; // Classes -static constexpr char ScriptReserved_Static[] = "Static"; static constexpr char ScriptReserved_Camera[] = "Camera"; static constexpr char ScriptReserved_Sink[] = "Sink"; static constexpr char ScriptReserved_SoundSource[] = "SoundSource"; @@ -401,6 +400,10 @@ static constexpr char ScriptReserved_LogLevelError[] = "ERROR"; // Internal static constexpr char ScriptReserved_LaraObject[] = "LaraObject"; +// ======= +// OBJECTS +// ======= + // Room constexpr char ScriptReserved_Room[] = "Room"; @@ -415,6 +418,39 @@ constexpr char ScriptReserved_RoomSetFlag[] = "SetFlag"; constexpr char ScriptReserved_RoomSetName[] = "SetName"; constexpr char ScriptReserved_RoomSetReverbType[] = "SetReverbType"; +// Static + +constexpr char ScriptReserved_Static[] = "Static"; +constexpr char ScriptReserved_StaticDisable[] = "Disable"; +constexpr char ScriptReserved_StaticEnable[] = "Enable"; +constexpr char ScriptReserved_StaticGetActive[] = "GetActive"; +constexpr char ScriptReserved_StaticGetColor[] = "GetColor"; +constexpr char ScriptReserved_StaticGetHP[] = "GetHP"; +constexpr char ScriptReserved_StaticGetName[] = "GetName"; +constexpr char ScriptReserved_StaticGetPosition[] = "GetPosition"; +constexpr char ScriptReserved_StaticGetRotation[] = "GetRotation"; +constexpr char ScriptReserved_StaticGetScale[] = "GetScale"; +constexpr char ScriptReserved_StaticGetSlot[] = "GetSlot"; +constexpr char ScriptReserved_StaticGetSolid[] = "GetSolid"; +constexpr char ScriptReserved_StaticSetColor[] = "SetColor"; +constexpr char ScriptReserved_StaticSetHitPoints[] = "SetHP"; +constexpr char ScriptReserved_StaticSetName[] = "SetName"; +constexpr char ScriptReserved_StaticSetPosition[] = "SetPosition"; +constexpr char ScriptReserved_StaticSetRotation[] = "SetRotation"; +constexpr char ScriptReserved_StaticSetScale[] = "SetScale"; +constexpr char ScriptReserved_StaticSetSlot[] = "SetSlot"; +constexpr char ScriptReserved_StaticSetSolid[] = "SetSolid"; +constexpr char ScriptReserved_StaticShatter[] = "Shatter"; + +// ===== +// TYPES +// ===== + +// Rotation + +constexpr char ScriptReserved_Rotation[] = "Rotation"; +constexpr char ScriptReserved_RotationDirection[] = "Direction"; + // Vec2 constexpr char ScriptReserved_Vec2[] = "Vec2"; @@ -439,8 +475,3 @@ constexpr char ScriptReserved_Vec3Lerp[] = "Lerp"; constexpr char ScriptReserved_Vec3Normalize[] = "Normalize"; constexpr char ScriptReserved_Vec3Rotate[] = "Rotate"; constexpr char ScriptReserved_Vec3Translate[] = "Translate"; - -// Rotation object - -constexpr char ScriptReserved_Rotation[] = "Rotation"; -constexpr char ScriptReserved_RotationDirection[] = "Direction"; diff --git a/TombEngine/Scripting/Internal/ScriptAssert.h b/TombEngine/Scripting/Internal/ScriptAssert.h index e55dc9ac6..94b3fdf7b 100644 --- a/TombEngine/Scripting/Internal/ScriptAssert.h +++ b/TombEngine/Scripting/Internal/ScriptAssert.h @@ -1,7 +1,6 @@ #pragma once -#include + #include -#include enum class ErrorMode { @@ -16,7 +15,8 @@ ErrorMode GetScriptErrorMode(); void ScriptWarn(const std::string& msg); bool ScriptAssert(bool cond, const std::string& msg, std::optional forceMode = std::nullopt); -template bool ScriptAssertF(bool cond, std::string_view str, Ts...args) +template +bool ScriptAssertF(bool cond, std::string_view str, Ts...args) { if (!cond) { @@ -36,7 +36,8 @@ template bool ScriptAssertF(bool cond, std::string_view str, T return cond; } -template bool ScriptAssertTerminateF(bool cond, std::string_view str, Ts...args) +template +bool ScriptAssertTerminateF(bool cond, std::string_view str, Ts...args) { if (!cond) { diff --git a/TombEngine/Scripting/Internal/ScriptUtil.h b/TombEngine/Scripting/Internal/ScriptUtil.h index add1584de..04a58fd37 100644 --- a/TombEngine/Scripting/Internal/ScriptUtil.h +++ b/TombEngine/Scripting/Internal/ScriptUtil.h @@ -2,21 +2,20 @@ #include "Scripting/Internal/ScriptAssert.h" -#define index_error_maker(CPP_TYPE, LUA_CLASS_NAME) [](CPP_TYPE& item, sol::object key) \ +#define IndexErrorMaker(CPP_TYPE, LUA_CLASS_NAME) [](CPP_TYPE& item, sol::object key) \ { \ std::string err = "Attempted to read missing variable \"" + key.as() + "\" from " + LUA_CLASS_NAME; \ ScriptAssert(false, err);\ } -#define newindex_error_maker(CPP_TYPE, LUA_CLASS_NAME) [](CPP_TYPE& item, sol::object key) \ +#define NewIndexErrorMaker(CPP_TYPE, LUA_CLASS_NAME) [](CPP_TYPE& item, sol::object key) \ { \ std::string err = "Attempted to set missing variable \"" + key.as() + "\" of " + LUA_CLASS_NAME; \ ScriptAssert(false, err);\ } -// Helper type to allow us to more easily specify "give a value of type X or just give nil" parameters. -// Sol doesn't (at the time of writing) have any mechanisms to do this kind of optional argument without -// drawbacks, or at least no mechanisms that I could find. +// Helper type to allow specification of optional parameters. +// Sol doesn't (at the time of writing) have any mechanisms to do this kind of optional argument without drawbacks. // // sol::optional doesn't distinguish between nil values and values of the wrong type // (so we can't provide the user with an error message to tell them they messed up). diff --git a/TombEngine/Scripting/Internal/TEN/Flow/Settings/Settings.cpp b/TombEngine/Scripting/Internal/TEN/Flow/Settings/Settings.cpp index 89b51b80f..4e41497cb 100644 --- a/TombEngine/Scripting/Internal/TEN/Flow/Settings/Settings.cpp +++ b/TombEngine/Scripting/Internal/TEN/Flow/Settings/Settings.cpp @@ -48,7 +48,7 @@ namespace TEN::Scripting parent.new_usertype(ScriptReserved_Settings, sol::constructors(), - sol::meta_function::new_index, newindex_error_maker(Settings, ScriptReserved_Settings), + sol::meta_function::new_index, NewIndexErrorMaker(Settings, ScriptReserved_Settings), ScriptReserved_AnimSettings, &Settings::Animations, ScriptReserved_FlareSettings, &Settings::Flare, ScriptReserved_CameraSettings, &Settings::Camera, @@ -68,7 +68,7 @@ namespace TEN::Scripting parent.create().new_usertype( ScriptReserved_AnimSettings, sol::constructors(), sol::call_constructor, sol::constructors(), - sol::meta_function::new_index, newindex_error_maker(AnimSettings, ScriptReserved_AnimSettings), + sol::meta_function::new_index, NewIndexErrorMaker(AnimSettings, ScriptReserved_AnimSettings), /// Extended crawl moveset. // @tfield bool crawlExtended when enabled, player will be able to traverse across one-click steps in crawlspaces. @@ -111,7 +111,7 @@ namespace TEN::Scripting { parent.create().new_usertype(ScriptReserved_CameraSettings, sol::constructors(), sol::call_constructor, sol::constructors(), - sol::meta_function::new_index, newindex_error_maker(CameraSettings, ScriptReserved_CameraSettings), + sol::meta_function::new_index, NewIndexErrorMaker(CameraSettings, ScriptReserved_CameraSettings), /// Determines highlight color in binocular mode. // @tfield Color binocularLightColor color of highlight, when player presses action. Zero color means there will be no highlight. @@ -134,7 +134,7 @@ namespace TEN::Scripting { parent.create().new_usertype(ScriptReserved_FlareSettings, sol::constructors(), sol::call_constructor, sol::constructors(), - sol::meta_function::new_index, newindex_error_maker(FlareSettings, ScriptReserved_FlareSettings), + sol::meta_function::new_index, NewIndexErrorMaker(FlareSettings, ScriptReserved_FlareSettings), /// Flare color. // @tfield Color color flare color. Used for sparks and lensflare coloring as well. @@ -183,7 +183,7 @@ namespace TEN::Scripting { parent.create().new_usertype(ScriptReserved_HairSettings, sol::constructors(), sol::call_constructor, sol::constructors(), - sol::meta_function::new_index, newindex_error_maker(HairSettings, ScriptReserved_HairSettings), + sol::meta_function::new_index, NewIndexErrorMaker(HairSettings, ScriptReserved_HairSettings), /// Root mesh to which hair object will attach to. // @tfield int mesh index of a root mesh to which hair will attach. Root mesh may be different for each hair object. @@ -206,7 +206,7 @@ namespace TEN::Scripting { parent.create().new_usertype(ScriptReserved_HudSettings, sol::constructors(), sol::call_constructor, sol::constructors(), - sol::meta_function::new_index, newindex_error_maker(HudSettings, ScriptReserved_HudSettings), + sol::meta_function::new_index, NewIndexErrorMaker(HudSettings, ScriptReserved_HudSettings), /// Toggle in-game status bars visibility. // @tfield bool statusBars if disabled, all status bars (health, air, stamina) will be hidden. @@ -233,7 +233,7 @@ namespace TEN::Scripting { parent.create().new_usertype(ScriptReserved_PhysicsSettings, sol::constructors(), sol::call_constructor, sol::constructors(), - sol::meta_function::new_index, newindex_error_maker(PhysicsSettings, ScriptReserved_PhysicsSettings), + sol::meta_function::new_index, NewIndexErrorMaker(PhysicsSettings, ScriptReserved_PhysicsSettings), /// Global world gravity. // @tfield float gravity specifies global gravity. Mostly affects Lara and several other objects. @@ -253,7 +253,7 @@ namespace TEN::Scripting { parent.create().new_usertype(ScriptReserved_WeaponSettings, sol::constructors(), sol::call_constructor, sol::constructors(), - sol::meta_function::new_index, newindex_error_maker(WeaponSettings, ScriptReserved_WeaponSettings), + sol::meta_function::new_index, NewIndexErrorMaker(WeaponSettings, ScriptReserved_WeaponSettings), /// Shooting accuracy. // @tfield float accuracy determines accuracy range in angles (smaller angles mean higher accuracy). Applicable only for firearms. @@ -320,7 +320,7 @@ namespace TEN::Scripting { parent.create().new_usertype(ScriptReserved_SystemSettings, sol::constructors(), sol::call_constructor, sol::constructors(), - sol::meta_function::new_index, newindex_error_maker(SystemSettings, ScriptReserved_SystemSettings), + sol::meta_function::new_index, NewIndexErrorMaker(SystemSettings, ScriptReserved_SystemSettings), /// How should the application respond to script errors? // @tfield Flow.ErrorMode errorMode error mode to use. */ diff --git a/TombEngine/Scripting/Internal/TEN/Flow/Statistics/Statistics.cpp b/TombEngine/Scripting/Internal/TEN/Flow/Statistics/Statistics.cpp index a412cc18a..d84b3bec4 100644 --- a/TombEngine/Scripting/Internal/TEN/Flow/Statistics/Statistics.cpp +++ b/TombEngine/Scripting/Internal/TEN/Flow/Statistics/Statistics.cpp @@ -18,7 +18,7 @@ namespace TEN::Scripting parent.new_usertype( ScriptReserved_Statistics, sol::constructors(), sol::call_constructor, sol::constructors(), - sol::meta_function::new_index, newindex_error_maker(Statistics, ScriptReserved_Statistics), + sol::meta_function::new_index, NewIndexErrorMaker(Statistics, ScriptReserved_Statistics), /*** Ammo hits. @tfield int ammoHits amount of successful enemy hits. diff --git a/TombEngine/Scripting/Internal/TEN/Objects/AIObject/AIObject.cpp b/TombEngine/Scripting/Internal/TEN/Objects/AIObject/AIObject.cpp index c8a6530ba..cbcb5548b 100644 --- a/TombEngine/Scripting/Internal/TEN/Objects/AIObject/AIObject.cpp +++ b/TombEngine/Scripting/Internal/TEN/Objects/AIObject/AIObject.cpp @@ -14,8 +14,8 @@ AI object @pragma nostrip */ -static auto IndexError = index_error_maker(AIObject, ScriptReserved_AIObject); -static auto NewIndexError = newindex_error_maker(AIObject, ScriptReserved_AIObject); +static auto IndexError = IndexErrorMaker(AIObject, ScriptReserved_AIObject); +static auto NewIndexError = NewIndexErrorMaker(AIObject, ScriptReserved_AIObject); AIObject::AIObject(AI_OBJECT & ref) : m_aiObject{ref} {}; diff --git a/TombEngine/Scripting/Internal/TEN/Objects/Camera/CameraObject.cpp b/TombEngine/Scripting/Internal/TEN/Objects/Camera/CameraObject.cpp index 95ba0b13b..1420b3058 100644 --- a/TombEngine/Scripting/Internal/TEN/Objects/Camera/CameraObject.cpp +++ b/TombEngine/Scripting/Internal/TEN/Objects/Camera/CameraObject.cpp @@ -16,8 +16,8 @@ Basic cameras that can point at Lara or at a CAMERA_TARGET. @pragma nostrip */ -static auto IndexError = index_error_maker(CameraObject, ScriptReserved_Camera); -static auto NewIndexError = newindex_error_maker(CameraObject, ScriptReserved_Camera); +static auto IndexError = IndexErrorMaker(CameraObject, ScriptReserved_Camera); +static auto NewIndexError = NewIndexErrorMaker(CameraObject, ScriptReserved_Camera); CameraObject::CameraObject(LevelCameraInfo & ref) : m_camera{ref} {}; diff --git a/TombEngine/Scripting/Internal/TEN/Objects/Moveable/MoveableObject.cpp b/TombEngine/Scripting/Internal/TEN/Objects/Moveable/MoveableObject.cpp index 0befd895a..c2eee9fbc 100644 --- a/TombEngine/Scripting/Internal/TEN/Objects/Moveable/MoveableObject.cpp +++ b/TombEngine/Scripting/Internal/TEN/Objects/Moveable/MoveableObject.cpp @@ -31,8 +31,8 @@ using namespace TEN::Math; // @tenclass Objects.Moveable // pragma nostrip -static auto IndexError = index_error_maker(Moveable, ScriptReserved_Moveable); -static auto NewIndexError = newindex_error_maker(Moveable, ScriptReserved_Moveable); +static auto IndexError = IndexErrorMaker(Moveable, ScriptReserved_Moveable); +static auto NewIndexError = NewIndexErrorMaker(Moveable, ScriptReserved_Moveable); /*** Used to generate a new moveable dynamically at runtime. For more information on each parameter, see the diff --git a/TombEngine/Scripting/Internal/TEN/Objects/Room/RoomObject.cpp b/TombEngine/Scripting/Internal/TEN/Objects/Room/RoomObject.cpp index 4ad45be2e..34f7afbc1 100644 --- a/TombEngine/Scripting/Internal/TEN/Objects/Room/RoomObject.cpp +++ b/TombEngine/Scripting/Internal/TEN/Objects/Room/RoomObject.cpp @@ -19,8 +19,8 @@ //namespace TEN::Scripting //{ - static auto IndexError = index_error_maker(Room, ScriptReserved_Volume); - static auto NewIndexError = newindex_error_maker(Room, ScriptReserved_Volume); + static auto IndexError = IndexErrorMaker(Room, ScriptReserved_Volume); + static auto NewIndexError = NewIndexErrorMaker(Room, ScriptReserved_Volume); Room::Room(ROOM_INFO& room) : _room(room) diff --git a/TombEngine/Scripting/Internal/TEN/Objects/Sink/SinkObject.cpp b/TombEngine/Scripting/Internal/TEN/Objects/Sink/SinkObject.cpp index b72fb15c9..71e5f7950 100644 --- a/TombEngine/Scripting/Internal/TEN/Objects/Sink/SinkObject.cpp +++ b/TombEngine/Scripting/Internal/TEN/Objects/Sink/SinkObject.cpp @@ -14,8 +14,8 @@ Sink @pragma nostrip */ -static auto IndexError = index_error_maker(Sink, ScriptReserved_Sink); -static auto NewIndexError = newindex_error_maker(Sink, ScriptReserved_Sink); +static auto IndexError = IndexErrorMaker(Sink, ScriptReserved_Sink); +static auto NewIndexError = NewIndexErrorMaker(Sink, ScriptReserved_Sink); Sink::Sink(SinkInfo& ref) : m_sink{ref} {}; diff --git a/TombEngine/Scripting/Internal/TEN/Objects/SoundSource/SoundSourceObject.cpp b/TombEngine/Scripting/Internal/TEN/Objects/SoundSource/SoundSourceObject.cpp index ccc2c68d8..7a1ccf031 100644 --- a/TombEngine/Scripting/Internal/TEN/Objects/SoundSource/SoundSourceObject.cpp +++ b/TombEngine/Scripting/Internal/TEN/Objects/SoundSource/SoundSourceObject.cpp @@ -14,8 +14,8 @@ Sound source @pragma nostrip */ -static auto IndexError = index_error_maker(SoundSource, ScriptReserved_SoundSource); -static auto NewIndexError = newindex_error_maker(SoundSource, ScriptReserved_SoundSource); +static auto IndexError = IndexErrorMaker(SoundSource, ScriptReserved_SoundSource); +static auto NewIndexError = NewIndexErrorMaker(SoundSource, ScriptReserved_SoundSource); SoundSource::SoundSource(SoundSourceInfo& ref) : m_soundSource{ref} {}; diff --git a/TombEngine/Scripting/Internal/TEN/Objects/Static/StaticObject.cpp b/TombEngine/Scripting/Internal/TEN/Objects/Static/StaticObject.cpp index faf256e58..eb9c7618b 100644 --- a/TombEngine/Scripting/Internal/TEN/Objects/Static/StaticObject.cpp +++ b/TombEngine/Scripting/Internal/TEN/Objects/Static/StaticObject.cpp @@ -1,269 +1,240 @@ #include "framework.h" #include "Game/effects/debris.h" +#include "Scripting/Internal/ReservedScriptNames.h" +#include "Scripting/Internal/ScriptUtil.h" #include "Scripting/Internal/ScriptAssert.h" #include "Scripting/Internal/TEN/Objects/Static/StaticObject.h" -#include "Scripting/Internal/TEN/Types/Vec3/Vec3.h" -#include "Scripting/Internal/TEN/Types/Rotation/Rotation.h" #include "Scripting/Internal/TEN/Types/Color/Color.h" -#include "Scripting/Internal/ScriptUtil.h" -#include "Scripting/Internal/ReservedScriptNames.h" +#include "Scripting/Internal/TEN/Types/Rotation/Rotation.h" +#include "Scripting/Internal/TEN/Types/Vec3/Vec3.h" -using namespace TEN::Scripting; +/// Represents a static object in the game world. +// +// @tenclass Objects.Static +// @pragma nostrip -/*** -Statics - -@tenclass Objects.Static -@pragma nostrip -*/ - -static auto IndexError = index_error_maker(Static, ScriptReserved_Static); -static auto NewIndexError = newindex_error_maker(Static, ScriptReserved_Static); - -Static::Static(MESH_INFO & ref) : m_mesh{ref} -{}; - -void Static::Register(sol::table & parent) +namespace TEN::Scripting { - parent.new_usertype( - ScriptReserved_Static, sol::no_constructor, // Ability to spawn new ones could be added later. - sol::meta_function::index, IndexError, - sol::meta_function::new_index, NewIndexError, + static auto IndexError = IndexErrorMaker(Static, ScriptReserved_Static); + static auto NewIndexError = NewIndexErrorMaker(Static, ScriptReserved_Static); - /// Enable the static, for cases when it was shattered or manually disabled before. - // @function Static:Enable - ScriptReserved_Enable, &Static::Enable, - - /// Disable the static - // @function Static:Disable - ScriptReserved_Disable, &Static::Disable, - - /// Get static mesh visibility - // @function Static:GetActive - // @treturn bool visibility state - ScriptReserved_GetActive, &Static::GetActive, - - /// Get static mesh solid collision state - // @function Static:GetSolid - // @treturn bool solid collision state (true if solid, false if soft) - ScriptReserved_GetSolid, &Static::GetSolid, - - /// Set static mesh solid collision state - // @function Static:SetSolid - // @tparam bool solidState if set, collision will be solid, if not, will be soft - ScriptReserved_SetSolid, &Static::SetSolid, - - /// Get the static's position - // @function Static:GetPosition - // @treturn Vec3 a copy of the static's position - ScriptReserved_GetPosition, &Static::GetPos, - - /// Set the static's position - // @function Static:SetPosition - // @tparam Vec3 position the new position of the static - ScriptReserved_SetPosition, &Static::SetPos, - - /// Get the static's rotation - // @function Static:GetRotation - // @treturn Rotation a copy of the static's rotation - ScriptReserved_GetRotation, &Static::GetRot, - - /// Set the static's rotation - // @function Static:SetRotation - // @tparam Rotation rotation the static's new rotation - ScriptReserved_SetRotation, &Static::SetRot, - - /// Get the static's scale - // @function Static:GetScale - // @treturn float current static scale - ScriptReserved_GetScale, &Static::GetScale, - - /// Set the static's scale - // @function Static:SetScale - // @tparam Scale scale the static's new scale - ScriptReserved_SetScale, &Static::SetScale, - - /// Get current HP (hit points/health points) - // Used only with shatterable static meshes. - // @function Static:GetHP - // @treturn int the amount of HP the static currently has - ScriptReserved_GetHP, &Static::GetHP, - - /// Set current HP (hit points/health points) - // Used only with shatterable static meshes. - // @function Static:SetHP - // @tparam int HP the amount of HP to give the static - ScriptReserved_SetHP, &Static::SetHP, - - /// Get the static's unique string identifier - // @function Static:GetName - // @treturn string the static's name - ScriptReserved_GetName, &Static::GetName, - - /// Set the static's name (its unique string identifier) - // e.g. "my\_vase" or "oldrubble" - // @function Static:SetName - // @tparam string name The static's new name - ScriptReserved_SetName, &Static::SetName, - - /// Get the static's slot number (as listed in Tomb Editor and WadTool) - // @function Static:GetSlot - // @treturn string the static's slot number - ScriptReserved_GetSlot, &Static::GetSlot, - - /// Set the static's slot number (as listed in Tomb Editor and WadTool) - // @function Static:SetSlot - // @tparam int slot The static's slot number - ScriptReserved_SetSlot, &Static::SetSlot, - - /// Get the static's color - // @function Static:GetColor - // @treturn Color a copy of the static's color - ScriptReserved_GetColor, &Static::GetColor, - - /// Set the static's color - // @function Static:SetColor - // @tparam Color color the new color of the static - ScriptReserved_SetColor, &Static::SetColor, - - /// Shatter static mesh - // @function Static:Shatter - ScriptReserved_Shatter, &Static::Shatter); -} - -void Static::Enable() -{ - m_mesh.flags |= StaticMeshFlags::SM_VISIBLE; -} - -void Static::Disable() -{ - m_mesh.flags &= ~StaticMeshFlags::SM_VISIBLE; -} - -bool Static::GetActive() -{ - return (m_mesh.flags & StaticMeshFlags::SM_VISIBLE) != 0; -} - -bool Static::GetSolid() -{ - return (m_mesh.flags & StaticMeshFlags::SM_SOLID) != 0; -} - -void Static::SetSolid(bool yes) -{ - if (yes) - m_mesh.flags |= StaticMeshFlags::SM_SOLID; - else - m_mesh.flags &= ~StaticMeshFlags::SM_SOLID; -} - -Vec3 Static::GetPos() const -{ - return Vec3(m_mesh.pos.Position.x, m_mesh.pos.Position.y, m_mesh.pos.Position.z); -} - -void Static::SetPos(Vec3 const& pos) -{ - m_mesh.pos.Position.x = pos.x; - m_mesh.pos.Position.y = pos.y; - m_mesh.pos.Position.z = pos.z; - m_mesh.Dirty = true; -} - -float Static::GetScale() const -{ - return m_mesh.scale; -} - -void Static::SetScale(float const& scale) -{ - m_mesh.scale = scale; - m_mesh.Dirty = true; -} - -int Static::GetHP() const -{ - return m_mesh.HitPoints; -} - -void Static::SetHP(short hitPoints) -{ - m_mesh.HitPoints = hitPoints; -} - -// This does not guarantee that the returned value will be identical -// to a value written in via SetRot - only that the angle measures -// will be mathematically equal -// (e.g. 90 degrees = -270 degrees = 450 degrees) -Rotation Static::GetRot() const -{ - return + void Static::Register(sol::table& parent) + { + // Register type. + parent.new_usertype( + ScriptReserved_Static, + sol::no_constructor, // TODO: Add feature to spawn statics. + sol::meta_function::index, IndexError, + sol::meta_function::new_index, NewIndexError, + + ScriptReserved_StaticGetName, &Static::GetName, + ScriptReserved_StaticGetSlot, &Static::GetSlot, + ScriptReserved_StaticGetPosition, &Static::GetPosition, + ScriptReserved_StaticGetRotation, &Static::GetRotation, + ScriptReserved_StaticGetScale, &Static::GetScale, // TODO: Deprecate. Should return Vec3 converted from static.Pose.Scale. + ScriptReserved_StaticGetColor, &Static::GetColor, + ScriptReserved_StaticGetHP, &Static::GetHitPoints, // TODO: Deprecate. + ScriptReserved_StaticGetActive, &Static::GetActiveStatus, // TODO: Deprecate. Rename Lua func to GetActiveStatus. + ScriptReserved_StaticGetSolid, &Static::GetSolidStatus, // TODO: Deprecate. Rename Lua func to GetSolidStatus. + + ScriptReserved_StaticSetName, &Static::SetName, + ScriptReserved_StaticSetSlot, &Static::SetSlot, + ScriptReserved_StaticSetPosition, &Static::SetPosition, + ScriptReserved_StaticSetRotation, &Static::SetRotation, + ScriptReserved_StaticSetScale, &Static::SetScale, + ScriptReserved_StaticSetColor, &Static::SetColor, + ScriptReserved_StaticSetHitPoints, &Static::SetHitPoints, // TODO: Deprecate. Rename Lua func to SetHitPoints. + ScriptReserved_StaticSetSolid, &Static::SetSolidStatus, // TODO: Deprecate. Rename Lua func to SetSolidStatus. + + ScriptReserved_StaticEnable, &Static::Enable, + ScriptReserved_StaticDisable, &Static::Disable, + ScriptReserved_StaticShatter, &Static::Shatter); + } + + Static::Static(MESH_INFO& staticObj) : + _static(staticObj) { - TO_DEGREES(m_mesh.pos.Orientation.x), - TO_DEGREES(m_mesh.pos.Orientation.y), - TO_DEGREES(m_mesh.pos.Orientation.z) }; -} -void Static::SetRot(Rotation const& rot) -{ - m_mesh.pos.Orientation.x = ANGLE(rot.x); - m_mesh.pos.Orientation.y = ANGLE(rot.y); - m_mesh.pos.Orientation.z = ANGLE(rot.z); - m_mesh.Dirty = true; -} - -std::string Static::GetName() const -{ - return m_mesh.Name; -} - -void Static::SetName(std::string const & name) -{ - if (!ScriptAssert(!name.empty(), "Name cannot be blank. Not setting name.")) + /// Get this static's unique string identifier. + // @function Static:GetName + // @treturn string Name string. + std::string Static::GetName() const { - return; + return _static.Name; } - if (_callbackSetName(name, m_mesh)) + /// Get this static's slot ID. + // @function Static:GetSlot + // @treturn int Slot ID. + int Static::GetSlot() const { - // remove the old name if we have one - _callbackRemoveName(m_mesh.Name); - m_mesh.Name = name; + return _static.staticNumber; } - else + + /// Get this static's world position. + // @function Static:GetPosition + // @treturn Vec3 World position. + Vec3 Static::GetPosition() const { - ScriptAssertF(false, "Could not add name {} - does an object with this name already exist?", name); - TENLog("Name will not be set", LogLevel::Warning, LogConfig::All); + return Vec3(_static.pos.Position); + } + + /// Get this static's world rotation. + // @function Static:GetRotation + // @treturn Rotation World rotation. + Rotation Static::GetRotation() const + { + return Rotation(_static.pos.Orientation); + } + + /// Get this static's world scale. + // @function Static:GetScale + // @treturn float World scale. + float Static::GetScale() const + { + return _static.scale; + } + + /// Get this static's color. + // @function Static:GetColor + // @treturn Color Color. + ScriptColor Static::GetColor() const + { + return ScriptColor(_static.color); + } + + /// Get this static's hit points. Used only with shatterable statics. + // @function Static:GetHP + // @treturn int Hit points. + int Static::GetHitPoints() const + { + return _static.HitPoints; + } + + /// Get this static's visibility state. + // @function Static:GetActive + // @treturn bool Visibility state. + bool Static::GetActiveStatus() + { + return ((_static.flags & StaticMeshFlags::SM_VISIBLE) != 0); + } + + /// Get this static's solid collision state. + // @function Static:GetSolid + // @treturn bool Solid collision state. __True: solid__, __False: soft__ + bool Static::GetSolidStatus() + { + return ((_static.flags & StaticMeshFlags::SM_SOLID) != 0); + } + + /// Set this static's unique identifier string. + // @function Static:SetName + // @tparam string name New name. + void Static::SetName(const std::string& name) + { + if (!ScriptAssert(!name.empty(), "Name cannot be blank. Not setting name.")) + return; + + if (_callbackSetName(name, _static)) + { + _callbackRemoveName(_static.Name); + _static.Name = name; + } + else + { + ScriptAssertF(false, "Could not add name {} - an object with this name may already exist.", name); + TENLog("Name will not be set.", LogLevel::Warning, LogConfig::All); + } + } + + /// Set this static's slot ID. + // @function Static:SetSlot + // @tparam int New slot ID. + void Static::SetSlot(int slotID) + { + _static.staticNumber = slotID; + _static.Dirty = true; + } + + /// Set this static's world position. + // @function Static:SetPosition + // @tparam Vec3 New world position. + void Static::SetPosition(const Vec3& pos) + { + _static.pos.Position = pos.ToVector3i(); + _static.Dirty = true; + } + + /// Set this static's rotation. + // @function Static:SetRotation + // @tparam Rotation New rotation. + void Static::SetRotation(const Rotation& rot) + { + _static.pos.Orientation = rot.ToEulerAngles(); + _static.Dirty = true; + } + + /// Set this static's world scale. + // @function Static:SetScale + // @tparam Scale New world scale. + void Static::SetScale(float scale) + { + _static.scale = scale; + _static.Dirty = true; + } + + /// Set the static's color + // @function Static:SetColor + // @tparam Color color the new color of the static + void Static::SetColor(ScriptColor const& col) + { + _static.color = col; + _static.Dirty = true; + } + + /// Set this static's hit points. Used only with shatterable statics. + // @function Static:SetHP + // @tparam int New hit points. + void Static::SetHitPoints(int hitPoints) + { + _static.HitPoints = hitPoints; + } + + /// Set this static's solid collision state. + // @function Static:SetSolid + // @tparam bool Solid collision state. __True: solid__, __False: soft__ + void Static::SetSolidStatus(bool status) + { + if (status) + { + _static.flags |= StaticMeshFlags::SM_SOLID; + } + else + { + _static.flags &= ~StaticMeshFlags::SM_SOLID; + } + } + + /// Enable this static. Used when previously shattered disabled manually. + // @function Static:Enable + void Static::Enable() + { + _static.flags |= StaticMeshFlags::SM_VISIBLE; + } + + /// Disable this static. + // @function Static:Disable + void Static::Disable() + { + _static.flags &= ~StaticMeshFlags::SM_VISIBLE; + } + + /// Shatter this static. + // @function Static:Shatter + void Static::Shatter() + { + ShatterObject(nullptr, &_static, -128, _static.roomNumber, 0); } } - -int Static::GetSlot() const -{ - return m_mesh.staticNumber; -} - -void Static::SetSlot(int slot) -{ - m_mesh.staticNumber = slot; - m_mesh.Dirty = true; -} - -ScriptColor Static::GetColor() const -{ - return ScriptColor{ m_mesh.color }; -} - -void Static::SetColor(ScriptColor const& col) -{ - m_mesh.color = col; - m_mesh.Dirty = true; -} - -void Static::Shatter() -{ - ShatterObject(nullptr, &m_mesh, -128, m_mesh.roomNumber, 0); -} \ No newline at end of file diff --git a/TombEngine/Scripting/Internal/TEN/Objects/Static/StaticObject.h b/TombEngine/Scripting/Internal/TEN/Objects/Static/StaticObject.h index 4683dc54c..a10c6d985 100644 --- a/TombEngine/Scripting/Internal/TEN/Objects/Static/StaticObject.h +++ b/TombEngine/Scripting/Internal/TEN/Objects/Static/StaticObject.h @@ -3,46 +3,67 @@ #include "Game/room.h" #include "Scripting/Internal/TEN/Objects/NamedBase.h" +namespace sol { class state; } + class ScriptColor; class Vec3; -namespace sol { class state; } -namespace TEN::Scripting { class Rotation; } -using namespace TEN::Scripting; - -class Static : public NamedBase +namespace TEN::Scripting { -public: - using IdentifierType = std::reference_wrapper; - Static(MESH_INFO& id); - ~Static() = default; + class Rotation; - Static& operator=(Static const& other) = delete; - Static(Static const& other) = delete; + class Static : public NamedBase + { + public: + static void Register(sol::table& parent); - static void Register(sol::table & parent); + private: + // Fields - void Enable(); - void Disable(); - bool GetActive(); - bool GetSolid(); - void SetSolid(bool yes); - Rotation GetRot() const; - void SetRot(Rotation const& rot); - Vec3 GetPos() const; - void SetPos(Vec3 const& pos); - float GetScale() const; - void SetScale(float const& scale); - int GetHP() const; - void SetHP(short hitPoints); - std::string GetName() const; - void SetName(std::string const& name); - int GetSlot() const; - void SetSlot(int slot); - ScriptColor GetColor() const; - void SetColor(ScriptColor const& col); - void Shatter(); + MESH_INFO& _static; -private: - MESH_INFO& m_mesh; -}; + public: + // Aliases + + using IdentifierType = std::reference_wrapper; + + // Constructors, destructors + + Static(MESH_INFO& staticObj); + Static(const Static& staticObj) = delete; + ~Static() = default; + + // Getters + + std::string GetName() const; + int GetSlot() const; + Vec3 GetPosition() const; + Rotation GetRotation() const; + float GetScale() const; + ScriptColor GetColor() const; + int GetHitPoints() const; + bool GetActiveStatus(); + bool GetSolidStatus(); + + // Setters + + void SetName(const std::string& name); + void SetSlot(int slotID); + void SetPosition(const Vec3& pos); + void SetRotation(const Rotation& rot); + void SetScale(float scale); + void SetColor(const ScriptColor& color); + void SetHitPoints(int hitPoints); + void SetSolidStatus(bool status); + + // Utilities + + void Enable(); + void Disable(); + void Shatter(); + + // Operators + + Static& operator =(const Static& staticObj) = delete; + }; +} diff --git a/TombEngine/Scripting/Internal/TEN/Objects/Volume/VolumeObject.cpp b/TombEngine/Scripting/Internal/TEN/Objects/Volume/VolumeObject.cpp index 011220dd1..08d4a87cf 100644 --- a/TombEngine/Scripting/Internal/TEN/Objects/Volume/VolumeObject.cpp +++ b/TombEngine/Scripting/Internal/TEN/Objects/Volume/VolumeObject.cpp @@ -16,8 +16,8 @@ Activator volume. @pragma nostrip */ -static auto IndexError = index_error_maker(Volume, ScriptReserved_Volume); -static auto NewIndexError = newindex_error_maker(Volume, ScriptReserved_Volume); +static auto IndexError = IndexErrorMaker(Volume, ScriptReserved_Volume); +static auto NewIndexError = NewIndexErrorMaker(Volume, ScriptReserved_Volume); Volume::Volume(TriggerVolume& volume) : _volume(volume)