PJMail Posted September 4, 2023 Share Posted September 4, 2023 Is there no way to find out what a remote NPC has equipped (armor) without using F4SE or running a script on the actual NPC?When I run NPC.unequipall() from a remote script the NPC does not unequip anything (though the console command INV shows they have) and no remote onitemunequipped events occur from that NPC. If that 'NPC' happens to be the game.Getplayer(), it all works correctly. Also NPC.UnequipItemSlot(slot) flat out does nothing (running through slots 0 to 30). Ideas? This is for XBOX so don't suggest F4SE please. Link to comment Share on other sites More sharing options...
SKKmods Posted September 4, 2023 Share Posted September 4, 2023 Is the remote NPC: (a) in the loaded area (b) persistent (an object attached CONST script does not always make it persistent) Link to comment Share on other sites More sharing options...
LarannKiar Posted September 4, 2023 Share Posted September 4, 2023 By remote NPCs, do you mean 3D unloaded NPCs? If so, then yes, EquipData is partially tied to 3D loaded state. To reliably call UnequipItem() on them you would need to teleport them in the loaded area first. Then call UnequipItem() and move them back to their original position. Link to comment Share on other sites More sharing options...
PJMail Posted September 4, 2023 Author Share Posted September 4, 2023 The NPC's are 3D loaded and all next to the player. They are both unique and I assume persistent as they have linked refs attached to them. Also they are not created from a leveled actor list. Link to comment Share on other sites More sharing options...
PJMail Posted September 4, 2023 Author Share Posted September 4, 2023 It seems that one NPC cannot unequip (properly) another NPC... Link to comment Share on other sites More sharing options...
SKKmods Posted September 4, 2023 Share Posted September 4, 2023 LinkedRef does not make an object persistent e.g. many workshop built items with WorkshopItemKeyword LinkedRef are not persistent when unloaded. In this matter my definition of persistent is "when unloaded the object can be found (e.g. by a quest non specific conditonal alias fill) so is clearly still accessible". Link to comment Share on other sites More sharing options...
PJMail Posted September 4, 2023 Author Share Posted September 4, 2023 I thought an NPC could also be forced persistent if it is referenced via a property on a running script. Anyway, is persistence the issue here (given they are both 3D loaded)? I still don't understand what is going wrong - or have I hit a game issue (Direct NPC to NPC remote event delivery is broken)? Does anyone have an alternate idea how one NPC can determine what gear another NPC has equipped? Link to comment Share on other sites More sharing options...
SKKmods Posted September 4, 2023 Share Posted September 4, 2023 Yes persistent as a script property (until cleared).Yes persistent as a quest alias (until cleared).No persistent as a linkedref. Link to comment Share on other sites More sharing options...
LarannKiar Posted September 4, 2023 Share Posted September 4, 2023 Does anyone have an alternate idea how one NPC can determine what gear another NPC has equipped? As long as the script is running and is attached to a valid game object it shouldn't matter what ScriptObject that game object is. Does it work if the remote script is attached to a quest? As far as I know, UnequipItemSlot() accepts EquipSlots which are configured as an Item Slot. Are you sure the Armor that's equipped by the NPC lives in one of the item slots? Link to comment Share on other sites More sharing options...
PJMail Posted September 4, 2023 Author Share Posted September 4, 2023 I use unequipitemslot in my other mods and it works fine when run on a script attached to the NPC that it unequips. It does not work when one NPC uses it against another NPC It seems. If I instead use unequipall the 2nd NPC does NOT visibly unequip - yet their inventory shows nothing equipped. This suggests I have hit a game bug. It may very well work via a quest, but this mod does not use quests so I haven't tested it. Also I don't want to attach a script to the second NPC just for this one 'nicety'. I also expect it works if the player unequips the second NPC (in fact a remember there is some mod that does it via a gun). Adding a quest/script/perk to the player is also overkill for this feature. Link to comment Share on other sites More sharing options...
Recommended Posts