mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
Add model to NPC lua
This commit is contained in:
parent
093d86353f
commit
4fcacd59aa
@ -4,6 +4,7 @@
|
||||
#include <components/esm3/loadfact.hpp>
|
||||
#include <components/esm3/loadnpc.hpp>
|
||||
#include <components/lua/luastate.hpp>
|
||||
#include <components/misc/resourcehelpers.hpp>
|
||||
|
||||
#include "apps/openmw/mwbase/environment.hpp"
|
||||
#include "apps/openmw/mwbase/mechanicsmanager.hpp"
|
||||
@ -78,6 +79,8 @@ namespace MWLua
|
||||
= sol::readonly_property([](const ESM::NPC& rec) -> int { return (int)rec.mNpdt.mDisposition; });
|
||||
record["head"]
|
||||
= sol::readonly_property([](const ESM::NPC& rec) -> std::string { return rec.mHead.serializeText(); });
|
||||
record["model"] = sol::readonly_property(
|
||||
[](const ESM::NPC& rec) -> std::string { return Misc::ResourceHelpers::correctMeshPath(rec.mModel); });
|
||||
record["isMale"] = sol::readonly_property([](const ESM::NPC& rec) -> bool { return rec.isMale(); });
|
||||
record["baseGold"] = sol::readonly_property([](const ESM::NPC& rec) -> int { return rec.mNpdt.mGold; });
|
||||
addActorServicesBindings<ESM::NPC>(record, context);
|
||||
|
@ -939,6 +939,7 @@
|
||||
-- @field #string name
|
||||
-- @field #string race
|
||||
-- @field #string class Name of the NPC's class (e. g. Acrobat)
|
||||
-- @field #string model Path to the model associated with this NPC, used for animations.
|
||||
-- @field #string mwscript MWScript that is attached to this NPC
|
||||
-- @field #string hair Path to the hair body part model
|
||||
-- @field #string head Path to the head body part model
|
||||
|
Loading…
Reference in New Issue
Block a user