Index: source/simulation2/components/CCmpVisualActor.cpp =================================================================== --- source/simulation2/components/CCmpVisualActor.cpp +++ source/simulation2/components/CCmpVisualActor.cpp @@ -23,6 +23,7 @@ #include "simulation2/MessageTypes.h" #include "ICmpFootprint.h" +#include "ICmpIdentity.h" #include "ICmpUnitRenderer.h" #include "ICmpOwnership.h" #include "ICmpPosition.h" @@ -66,7 +67,7 @@ DEFAULT_COMPONENT_ALLOCATOR(VisualActor) private: - std::wstring m_BaseActorName, m_ActorName; + std::wstring m_BaseActorName, m_ActorName, m_BaseActorString; bool m_IsFoundationActor; // Not initialized in non-visual mode @@ -202,7 +203,15 @@ if (m_IsFoundationActor) m_BaseActorName = m_ActorName = paramNode.GetChild("FoundationActor").ToString(); else - m_BaseActorName = m_ActorName = paramNode.GetChild("Actor").ToString(); + { + m_BaseActorString = paramNode.GetChild("Actor").ToString(); + + CmpPtr cmpIdentity(GetEntityHandle()); + if (m_BaseActorString.find(L"{gender}") != std::wstring::npos) + m_BaseActorString.replace(m_BaseActorString.find(L"{gender}"),8,cmpIdentity.GetGender()); + + m_BaseActorName = m_ActorName = m_BaseActorString; + } m_VisibleInAtlasOnly = paramNode.GetChild("VisibleInAtlasOnly").ToBool(); m_IsActorOnly = paramNode.GetChild("ActorOnly").IsOk(); Index: source/simulation2/components/ICmpIdentity.h =================================================================== --- source/simulation2/components/ICmpIdentity.h +++ source/simulation2/components/ICmpIdentity.h @@ -29,6 +29,8 @@ public: virtual std::string GetSelectionGroupName() = 0; + virtual std::string GetGender() = 0; + DECLARE_INTERFACE_TYPE(Identity) }; Index: source/simulation2/components/ICmpIdentity.cpp =================================================================== --- source/simulation2/components/ICmpIdentity.cpp +++ source/simulation2/components/ICmpIdentity.cpp @@ -35,6 +35,11 @@ { return m_Script.Call("GetSelectionGroupName"); } + + virtual std::string GetGender() + { + return m_Script.Call("GetGender"); + } }; REGISTER_COMPONENT_SCRIPT_WRAPPER(IdentityScripted)