Jump to content

pxd2050

Members
  • Posts

    181
  • Joined

  • Last visited

Posts posted by pxd2050

  1. 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;

    }

  2. 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.


  3. 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());
    }
    }
    }

  4. I took a brief look at your mod, and I am sorry, but it is a major mess. Missing textures, missing head parts, wrong texture paths.... It references non-vanilla resources from all over the place that your mod does not include. What the heck is skin_8? Head meshes are in test_RBQ.esp but point to tint masks under Ugly_Zodd? Requiring High Poly Head as master? Why two separate .esps? Anyone trying to install your mod as it is, a pretty much guaranteed game crash.

     

    My suggestion: read up/watch tutorials on properly creating and packaging an NPC (follower) mod. Then you can start playing with Levelled characters and Actor templates...

    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.

  5. I created a Level NPC for several models: LMy_Bandits
    Then 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

  6. I created a Level NPC for several models: LPxd_RBQ
    Then 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:
  7. I'm sorry, I'm not sure what you're trying to do. Nor am I familiar with the code you're presenting.

     

    Animation speed to me indicates how fast the animation plays. A given animation sequence has only a small handful of stages. If you want to control animation speed in those individual stages, there is a far easier way to accomplish it, using the SL Triggers mod and applying the speed-control script (that it provides in its sample scripts) to it on start of said animations, which allows you to then advance, retard, save, or reset the speed for a given stage, which is then stored for future use when that animation is replayed at a later date, using preassigned hotkeys (unfortunately not easily reassignable, since they use keycodes for assignment within the script)

    numpad

    + increase speed

    - decrease speed

    * store current speed for stage

    / reset current speed to default.

     

    Afaik, the "native" animation speed control elements in SL are inapplicable to the SE (and afaik AE) environment due to the original DLL being incompatible and not being able to be rewritten (not sure why but whatever), so instead the above speed control script uses STGM. Upon exit oif the sequence, it also returns the timer to its original state.

    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.

  8. 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
    
  9. (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.

  10. Get the target NPC

    Have the player put items for the target NPC into the container

    Transfer the items via script from the container to the NPC.

    RemoveItem is your friend here.

     

    If desired, have the target NPC walk to the container and play an idle that looks as if they are digging through the container.

    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?

  11. NPC 无法与容器交互。

     

    不知道你想做什么。根据您要实现的目标,可能会有解决方法。

    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.
  12. 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
    
  13. scorrp10, 在 19 三月 2023 - 11:47 上午, 说:

    在这种情况下,假发网不是单独的物品,而是NPC“裸露”皮肤的一部分,因此即使完全剥离,她也会保留头发。(但佩戴另一个插槽 31 物品时不行,例如兜帽)但很高兴你想通了。是的,我确实注意到 xml 声明了头发实际上没有的几块骨头,但并没有真正将其与问题联系起来。

    :laugh: :huh: :laugh:

  14. For me, your mod actually causes a CTD as soon as I try to summon the NPC, looks like on trying to handle VirtualHairCollision_2 part. The sculpts/presets involving SMP hair as head parts are generally used for player, not NPCs.

     

    Here is a rework.

     

    Changed the actual head mesh to have pretty much no hair. (hair head part is duplicate of 'Redguard04')

    Assembled 'Jackdaw' KSSMP Hair into an equippable wig mesh, and made it part of the NPC's default skin.

    Removed dependencies on High Poly Head and KS Hairdos, and cleaned unwanted masters.

    Consolidated and corrected all texture paths and such. Needed textures are now part of the mod.

    Changes to the NPC:

    Corrected factions/relationship to actually make her available as follower.

    Changed voice type from Astrid to FemaleSultry. Generally, assigning a custom NPC voice type to a generic follower is a bad idea.

    Also flagged the esp as light.

     

     

    ZgFrOCv.jpg

     

     

    Uo7oxmW.jpg

     

    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.
×
×
  • Create New...