blank_v Posted June 13, 2025 Posted June 13, 2025 Heil-o~! Sooo~!!!!... Wanna has mod, wanna mod add extra loot~!... Ya see, when ya wanter around, if ya like pickpocket people... then so sad it is when they has nothing T-T... UNFAIR~! So... thas the Mod Idea~! A Mod thas add Gold & Gems ( also food ) at random... And well... everything wroks fine~! Everything... except one thing... It triggers itself over and over again... I wanted to use MagicEffect with long duration ( 30 minutes ) To control if player can add loot again to the NPC... but for some reason it does not work... im not sure which part... Because Im not too good at doing Spells in Skyrim xD I always avoid doing it... So... Here is how I setup Magic Effect and Spell: Spoiler Here is SourceCode with Syntax Highlighting + Pointed lines where MagicEffect is used: Spoiler Here whole is SourceCode: Spoiler Scriptname _QLG_Master_LootThemAll extends ReferenceAlias { Are You going to loot them all? Savage! This script is the main one attached to the player via Quest _QLG_LootThemAll_Data } ;===- Base Info. -===; ;Update: 2025-06-13 ;Author: Chaos ;===============================================; ;===- Var. setup -===========================================; Actor Property qPlayer Auto ; Reference to the player (0x7) MagicEffect Property qEffect Auto ; Effect to give to the NPC so we dont add new loot over and over again! Spell Property qSpell Auto ; Spell that we cast on the Reference we gave gold to track them! MiscObject Property qGold Auto ; Reference to the Gold Int Property qGold_Min Auto ; Min amount of Gold that can be added to the NPC, Def: 10 Int Property qGold_Max Auto ; Max amount of Gold that can be added to the NPC, Def: 60 Int Property qGold_Wild Auto ; Extra RNG property, GoldGiven = RNG( Min, Max ) + RNG( 0, Wild ), Def: 12 FormList Property qLoot Auto ; List of items that can be given to the NPC for pickpocketing Int Property qLoot_Min Auto ; Min amount of items to be given, Def: 0 Int Property qLoot_Max Auto ; Max amount of items to be givenm Def: 3 Int qLoot_Count ; Amount of possible items in the loot ( default: Gems + Food = [81] ) Bool Property qActive Auto ; Determinates if Mod is Active Bool Property qShow Auto ; To control if to show debug notifications, Def: True Bool Property qDead Auto ; Are dead actors allowed?, Def: False ;=-- Private -==; Int qLoop ; Loop iterator ;===============================================; ;===- Main Script -=============================; ;***********************************************; Event OnInit() qSafeCheck() qLoot_Count = qLoot.GetSize() RegisterForMenu("ContainerMenu") qActive = True EndEvent ;***********************************************; Event OnMenuOpen( String _Menu ) Debug.Notification("[Loot]") If( ( _Menu != "ContainerMenu" )||( qActive == False ) ) Return ; Not our menu or player disabled the mod! EndIf Debug.Notification("Test1") Actor _Actor = Game.GetCurrentCrosshairRef() as Actor If( ( qPlayer.IsSneaking() )&&( _Actor ) ) Debug.Notification("Test2") If( _Actor.HasMagicEffect( qEffect ) ) If( qShow ) Debug.Notification("[LootAll]::You already looted that actor!...") EndIf Return ; Has effect, Quit, we already added loot to that NPC EndIf If( ( _Actor.IsDead() )&&( qDead == False ) ) If( qShow ) Debug.Notification("[LootAll]::He is dead~!...") EndIf Return ; Is dead, player not allowing dead EndIf Debug.Notification("Test3") qSpell.Cast( _Actor ) _Actor.AddItem( qGold , ( Utility.RandomInt( qGold_Min , qGold_Max ) + Utility.RandomInt( 0 , qGold_Wild ) ) ) qLoop = Utility.RandomInt( qLoot_Min , qLoot_Max ) While( qLoop > 0 ) _Actor.AddItem( ( qLoot.GetAt( Utility.RandomInt( 0 , qLoot_Count ) ) as MiscObject ) , 1 ) qLoop -= 1 EndWhile EndIf EndEvent ;***********************************************; Bool Function qSafeCheck() If( ( qGold_Min <= 0 ) || ( qGold_Max >= 9999 ) || ( qGold_Min > qGold_Max ) ) qGold_Min = 10 qGold_Max = 60 EndIf If( ( qGold_Wild < 0 ) || ( qGold_Wild > 999 ) ) qGold_Wild = 12 EndIf If( ( qLoot_Min <= 0 ) || ( qLoot_Max >= 9999 ) || ( qLoot_Min > qLoot_Max ) ) qLoot_Min = 0 qLoot_Max = 3 EndIf EndFunction ;TheEnd So... help me~! Yes, yes, You do that, You help me, Ill add You in credits of the mod~! Such fame, such value, such greatness~! Now, come, and help me! hyhyhy xD But srsl... help me :(...
wareware Posted June 13, 2025 Posted June 13, 2025 qSpell.Cast( _Actor ) needs a target too Also flag your magic effect to have no hit effect and no hit event
blank_v Posted June 13, 2025 Author Posted June 13, 2025 (edited) 12 minutes ago, wareware said: qSpell.Cast( _Actor ) needs a target too Also flag your magic effect to have no hit effect and no hit event Ohhh~!!! If not You I would never see that xD ( stolen from Spell.psc ) ; Cast this spell from an ObjectReference, optionally toward another. Function Cast(ObjectReference akSource, ObjectReference akTarget=NONE) native Testingg 😮 ~!! Yee it works~!! Tho there is other issue... that im not sure if we are even able to fix... It basically requre You to open menu and then close it and then re-open... For some reason it does not work when the menu is open... :/... Some ideas? For my use its completly fine, but im rly planning to upload that mod so I would like to make it better for others too ( tho before uploading I want to give options in MCM - currently they are always getting around 30-40 gold, for me its cool, for others it may seems too much... or too little but then pickpocketing is getting harder xD ) //Edit: Funny thing that I discovered while testing... Apparently Dead Actor != Actor... I mean... its still Actor but with dead flag... but game does not recognize the Actor with dead flag as Actor at all xD Edited June 13, 2025 by ̖̪.
wareware Posted June 13, 2025 Posted June 13, 2025 Sexlab Survival has a feature exactly like this if you want to see how a mod does it.
blank_v Posted June 13, 2025 Author Posted June 13, 2025 27 minutes ago, wareware said: Sexlab Survival has a feature exactly like this if you want to see how a mod does it. Well... I did downloaded the mod and looked into: _SLS_PickpocketFailDetect... It don't seems like mod is doing that thing ( adding items to the actor while pockpocketing ) Spoiler The only unknown is what SL Survival is trying to evaluate: FgAlias.ForceRefTo(PickPocketee) PickPocketee.EvaluatePackage() But I dont think it have anything to do with adding loot into the NPC inventory... I added also EvaluatePackage() to my script... and additionally Activate so maybe the Actor could refresh his inventory... _Actor.EvaluatePackage() _Actor.Activate(_Actor) But it seems like game simply refuses to update inventory of pickpocket dynamically... well... SHIPPING WITH A BUG ~!! Well... not a bug... minor issue...
wareware Posted June 14, 2025 Posted June 14, 2025 Thats a different function. You want to look at the pickpocket perk added in that mod. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now