I′ll give you a complete script - you can make it more advanced if you want then. You′ll put this as a new quest script, so that it runs all the time (it′s not "quest", it′s just that quest script are global scripts that run all the time).
I′ll edit this post in a minute, with the script.
EDIT: Here′s a script that sets the ownership of the item you activate to player, if player is undetected. The script works by setting the ownership BEFORE the game moves the item into your inventory.
I set some basic checks for a valid target, but I don′t know what happens if you target a wall and press activate key. Probably nothing, and the ownership call is inside testExpr obse function that suppresses script errors, so the script shouldn′t crash even with unvalid targets.
But I take no responsibility - if you want you can install specific checks for valid targed, by using Obse′s getObjectType and check the target′s item type - you′ll just have type many alternative valid type codes.
Spoiler scn skycaptainsStealScript
fquestdelaytime
ref itemRef
ref ownerRef
short init
begin GameMode
if(init == 1)
if(oncontroldown 5 == 0)
return ;optimizing
else
;activate button pressed
set itemRef to getCrosshairRef
if(itemRef != 0)
if(itemRer.isActor == 0 && itemRef.IsActivatable == 0) ;rule out actors and activators like doors
if(player.isActorDetected == 0)
TestExpr(itemRef.SetOwnership)
;try to set the ownership of the ref in the crosshair to player
;(testexpr should save the script from crashing if the target is still not valid somehow)
endif
endif
endif
endif
else
set fquestdelaytime to 0.001
set init to 1
endif
end
EDIT: Click the reply button - when it quotes my post, the script indentation shows correctly and it′s easier to read.
EDIT2: It requires Obse, BTW.