Jump to content

pxd2050

Members
  • Posts

    181
  • Joined

  • Last visited

Everything posted by pxd2050

  1. how to get a actors list in PlayerTeammate? or get a actor by name? thank
  2. class NiNodeUpdateEventHandler : public RE::BSTEventSink<SKSE::NiNodeUpdateEvent> { public: static NiNodeUpdateEventHandler* GetSingleton() { static NiNodeUpdateEventHandler singleton; return &singleton; } virtual EventResult ProcessEvent(const SKSE::NiNodeUpdateEvent* a_event, RE::BSTEventSource<SKSE::NiNodeUpdateEvent>*) { auto actor = a_event->reference->As<RE::Actor>(); auto wig = actor->GetWornArmor(RE::BIPED_MODEL::BipedObjectSlot::kHair); if (!a_event || !actor || !wig) return EventResult::kContinue; auto a_arma = wig->GetArmorAddonByMask(actor->GetRace(), RE::BIPED_MODEL::BipedObjectSlot::kHair); if (a_arma) { auto npc = actor->GetActorBase(); RE::NiColor color; if (npc && npc->headRelatedData) { const auto hairColor = npc->headRelatedData->hairColor; if (hairColor) { color.red = static_cast<float>(hairColor->color.red) / static_cast<float>(128.0); color.green = static_cast<float>(hairColor->color.green) / static_cast<float>(128.0); color.blue = static_cast<float>(hairColor->color.blue) / static_cast<float>(128.0); auto ref = actor->As<RE::TESObjectREFR>(); if (ref) { char addonString[MAX_PATH]{ '\0' }; a_arma->GetNodeName(addonString, ref, wig, -1); auto skeletonRoot = ref->Get3D(); if (skeletonRoot) { const auto obj = skeletonRoot->GetObjectByName(addonString); if (obj) { obj->UpdateHairColor(color); } } } } } } return EventResult::kContinue; }
  3. I am doing a mod to change hair color and encounter a challenge: how to set a color for a wig. I know that the bEnable TintHairSlot of Racemenu's skee64 can do it, but it has a bug with the wrong color. Skee64 source code does not have the version for 1.597, and its hook code is difficult to understand. I make a code: After equip wig,over actor to get model of wig to set color.(This will first display the default color for the wig, and then refresh to the color I set) I don't know how to set wig color before equip ,because There is no way to get model. I try <SKSE::NiNodeUpdateEvent> but it don't work . f*#@, I try many times can't post code.
  4. I am creating a skse dll to change the npc Template(LPLT) and Template Flags(Use Traits) and have encountered some problems seeking help. I have changed the Template and Flags of NPC, but it don't work in the game(npc1 -> npc2). May I ask where the problem ? void MessageHandler(SKSE::MessagingInterface::Message* a_message) { switch (a_message->type) { case SKSE::MessagingInterface::kDataLoaded: { if (INI::GetConfigs_NPCReplacer()) { logger::info("{:*^50}", "NPCReplacer"); NPCReplacer::force_NPCReplacer(); } } break; default: break; } } .......... void force_NPCReplacer() { for (auto& data : INI::configs_NPCReplacer) { for (auto npc1 : data.npcs1) { int i = std::rand() % (data.npcs2.size()); auto npc2 = data.npcs2[i]; npc1->baseTemplateForm = npc2; npc1->actorData.templateUseFlags.set(RE::ACTOR_BASE_DATA::TEMPLATE_USE_FLAG::kTraits); logger::info("{} -> {}", npc1->GetFormID(), npc2->GetFormID()); } } }
  5. Thank you for your reply. I redefine Level NPC and upload Bandits MOD again . (about creating and packaging an NPC (follower) mod, Myself can make a tutorials.)But the point I want to seek help from is not about the model issue.But how to remodel NPCs through templates with leveled npc. The key points are: [LVLN: 0001A32F] can remodel but [NPC_: 0001B0D8] not. I think this is bug about template for use LevelNPC twice.
  6. I created a Level NPC for several models: LMy_BanditsThen modify the template flags (use traits, use model/animation) of EncBandit00Template and add Template: LMy_Bandits. Summoning test: LCharBanditBossCommonerF [LVLN: 0001A32F]"Placeatme 1A32F" summon a bandits, remodel successfully. Summoning test: LvlBanditBossCommonerF [NPC_: 0001B0D8]"Placeatme 1B0D8" summoned a invisible bandit, remodel failed. May I ask everyone, where is the problem?Here is the MOD I created: https://drive.google.com/file/d/12ymGzMJBwMVPnOMNaoKHUUilKmCJh1Nt/view?usp=sharing
  7. Is this an unsolvable problem? Can you provide me with ideas or directions?
  8. I created a Level NPC for several models: LPxd_RBQThen modify the template flags (use traits, use model/animation) of EncBandit00Template and add Template: LPxd_RBQ. Summoning test: LCharBanditBossCommonerF [LVLN: 0001A32F]"Placeatme 1A32F" summon a bandits, remodel successfully. Summoning test: LvlBanditBossCommonerF [NPC_: 0001B0D8]"Placeatme 1B0D8" summoned a transparent bandit, remodel failed. May I ask everyone, where is the problem?Here is the MOD I created: https://drive.google.com/file/d/12ymGzMJBwMVPnOMNaoKHUUilKmCJh1Nt/view?usp=sharing
  9. thank you for your reply, my english is no good. I mean anims loading speed (when register too many anims, sexlab secen loading is very slowly). no anima play speed.
  10. Sexlab P+ only get front 128 anims when anims over 128. so I try to edit sslAnimationSlots.psc for random anims. The loading speed of the animation before modification is 30 seconds (1000 animations), and it takes 50 seconds after modification. May I ask how to optimize speed? before: sslBaseAnimation[] Function _GetAnimationsImpl(int[] aiKeys, String[] asTags) Log("Searching for Animation with Keys = " + aiKeys + " | Tags = " + asTags) sslBaseAnimation[] ret = new sslBaseAnimation[128] int i = 0 int ii = 0 While(i < Slotted) If(Objects[i]) sslBaseAnimation Slot = Objects[i] as sslBaseAnimation ; Log("Validating Animation Nr. " + i + " | Keys = " + Slot.DataKeys() + " | Tags = " + Slot.GetTags()) If(Slot.Enabled && Slot.MatchKeys(aiKeys) && Slot.MatchTags(asTags)) ret[ii] = Slot If(ii == 127) return ret EndIf ii += 1 EndIf EndIf i += 1 EndWhile sslBaseAnimation[] _ret = sslUtility.AnimationArray(ii) int j = 0 While(j < ii) _ret[j] = ret[j] j += 1 EndWhile return _ret EndFunction after: sslBaseAnimation[] Function _GetAnimationsImpl(int[] aiKeys, String[] asTags) Log("Searching for Animation with Keys = " + aiKeys + " | Tags = " + asTags) sslBaseAnimation[] ret = new sslBaseAnimation[128] Alias[] tempObjects = Objects int i = 0 int ii = 0 While(i < Slotted) int k = Utility.RandomInt(0, Slotted - i) If(tempObjects[k]) sslBaseAnimation Slot = tempObjects[k] as sslBaseAnimation ; Log("Validating Animation Nr. " + i + " | Keys = " + Slot.DataKeys() + " | Tags = " + Slot.GetTags()) If(Slot.Enabled && Slot.MatchKeys(aiKeys) && Slot.MatchTags(asTags)) ret[ii] = Slot If(ii == 127) return ret EndIf ii += 1 EndIf EndIf tempObjects = RemoveAlias(tempObjects, tempObjects[k]) i += 1 EndWhile sslBaseAnimation[] _ret = sslUtility.AnimationArray(ii) int j = 0 While(j < ii) _ret[j] = ret[j] j += 1 EndWhile return _ret EndFunction
  11. I find funcation : PapyrusUtil.RemoveAlias(...)
  12. (sorry,I try many times for post topic,but fail. I don't know why.) How to remove some alice frome alice[]? for example : Alias[] tempObjects = Objects remove alias tempObjects[5] I don't know what funcation can add or del element from arry.
  13. Thank you very much. I can always get a perfect response from you. Try your method later.
  14. Transfer the items via script from the container to the NPC. I don't quite understand how to do it. Is there a similar script?
  15. Thank you for your reply.I want to create a box specifically designed to hold armors (or other types, such as wigs), and then assign armors to NPCs.
  16. sorry ,title can't post. I try many times. "Can container be active and exchange with actor (no player)?" in game, container can be active and exchange with player, but can't exchange with other actor. can help me, thank you. function OnEquipped(actor akActor) ObjectReference CrossHairRef = Game.GetCurrentCrosshairRef() ObjectReference playerref = game.GetPlayer() as ObjectReference if akActor == game.GetPlayer() DRScBodyNPCOpenSD.Play(akActor as ObjectReference) akActor.EquipItem(aaaMRbohARM as form, true, true) game.DisablePlayerControls(false, false, false, false, false, true, true, false, 0) utility.Wait(0.0100000) If (CrossHairRef as actor) && (CrossHairRef != playerref) String ActorName = (CrossHairRef as actor).GetActorBase().GetName() aaaMRbohContREF.Activate(CrossHairRef, false) debug.notification("Exchange Target :" + ActorName) else aaaMRbohContREF.Activate(playerref, false) debug.notification("Exchange Target :player") endif utility.Wait(0.0100000) game.EnablePlayerControls(false, false, false, false, false, true, true, true, 0) akActor.UnequipItem(aaaMRbohARM as form, false, true) endIf endFunction
  17. Thank you for your advice on mod.I know the method of using equippable wig, but this method can cause many problems. For example, taking off clothes, etc.I found the key to falling my hair: Sculpt lost 2 bones.I removed these two bones from Jackdaw.xml and used my hair normally.
  18. I make a smp hair sculpt to follower mod,Hair falling to the ground. I don't know why? someone can help me? this is mod :https://drive.google.com/file/d/1cqC-mPpZQGXTwHutAotgr-ZQJHUvVOaG/view?usp=share_link this is sculpt:https://www.nexusmods.com/skyrimspecialedition/mods/77835?tab=files
  19. I try this code, but when animation starting, it only show debug, not get actors. help Event virginityBreak() Actor[] npcs = SexLab.GetPlayerController().Positions if !npcs Debug.Notification("Don't work?" ) return endif
×
×
  • Create New...