Immersive Thievery Request

Post » Wed Sep 01, 2010 10:58 pm

Greetings! If anyone out there is at all familiar with scripting then perhaps you could create a mod that simply removes the "stolen" tag from any item you steal that no one notices?

For instance, if you go to steal an apple or a helmet, and do so undetected, that item should have its ownership cleared. But only if no one saw the act!

:drool:

Your help would be greatly appreciated :P
User avatar
Jason Wolf
 
Posts: 3390
Joined: Sun Jun 17, 2007 7:30 am

Post » Wed Sep 01, 2010 8:48 pm

Well, so far all I've managed to locate at http://cs.elderscrolls.com/constwiki/ was the beginning of the script:

Begin OnAdd

If anyone else can help, please do. I'm new to scripting and don't think I can figure it out alone.
User avatar
Tyrone Haywood
 
Posts: 3472
Joined: Sun Apr 29, 2007 7:10 am

Post » Wed Sep 01, 2010 11:56 pm

Well, I can give you some tentative advice, though I don't know exactly how to do what you want.

I believe OnAdd is for a script attached to a particular object. In order to have a script trigger when any object is added to the players inventory, i think OnActivate is what you want, but I've never used that so I'm not sure.

Some tips: see GetOwner (requires OBSE), SetOwnership, and IsActorDetected.
User avatar
Alessandra Botham
 
Posts: 3440
Joined: Mon Nov 13, 2006 6:27 pm

Post » Wed Sep 01, 2010 8:56 am

Thank you, SetOwnership was the command I was going nuts trying to remember.

I tried making my own little script that simply changes ownership of any item you acquire, but SetOwnership/Player.SetOwnership didn't seem to do it. :brokencomputer:

I don't think I'm cut out for scripting. :banghead:
User avatar
CArla HOlbert
 
Posts: 3342
Joined: Wed Feb 21, 2007 11:35 pm

Post » Wed Sep 01, 2010 10:42 am

http://planetelderscrolls.gamespy.com/View.php?view=OblivionMods.Detail&id=1847

Contains a barrel that removes the stolen tag from any items, I'd just reverse engineer this
User avatar
Ron
 
Posts: 3408
Joined: Tue Jan 16, 2007 4:34 am

Post » Wed Sep 01, 2010 10:27 pm

For instance, if you go to steal an apple or a helmet, and do so undetected, that item should have its ownership cleared. But only if no one saw the act!

I'm curious as to how you plan on fencing items for the Thieves Guild if nothing is tagged stolen?
User avatar
Amber Ably
 
Posts: 3372
Joined: Wed Aug 29, 2007 4:39 pm

Post » Wed Sep 01, 2010 12:26 pm

I know how to edit scripts, I can bypass that easily. I don't enjoy the Thieves' Guild anyway. I know this game inside and out, so I'm not missing out on anything even if I don't make this Thieves' Guild-friendly.
User avatar
Alex Blacke
 
Posts: 3460
Joined: Sun Feb 18, 2007 10:46 pm

Post » Wed Sep 01, 2010 11:52 pm

I tried making my own little script that simply changes ownership of any item you acquire, but SetOwnership/Player.SetOwnership didn't seem to do it. :brokencomputer:

Not sure from what you've written here whether you've done this already, but you need to call SetOwnership on the reference of the object you want to change. ie.
myStolenItemRef.SetOwnership player
User avatar
Jose ordaz
 
Posts: 3552
Joined: Mon Aug 27, 2007 10:14 pm

Post » Wed Sep 01, 2010 8:19 am

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.
User avatar
Amy Gibson
 
Posts: 3540
Joined: Wed Oct 04, 2006 2:11 pm

Post » Wed Sep 01, 2010 9:00 am

Sounds good, thank you Skycaptain. I'll give this a shot.
User avatar
Nicholas
 
Posts: 3454
Joined: Wed Jul 04, 2007 12:05 am

Post » Wed Sep 01, 2010 10:50 am

Whenever I try to save the script I get an error: Script command "fquestdelaytime" not found.
User avatar
mishionary
 
Posts: 3414
Joined: Tue Feb 20, 2007 6:19 am

Post » Wed Sep 01, 2010 11:42 pm

change
fQuestDelayTime
to
float fQuestDelayTime
User avatar
Mrs. Patton
 
Posts: 3418
Joined: Fri Jan 26, 2007 8:00 am

Post » Wed Sep 01, 2010 3:49 pm

Thank you crysallus, that allowed me to save. Now, I attached it to a quest through the "Script" option with all default settings to the quest, but it isn't working ingame. Is there some specific alteration I need to the quest? I've tried setting the Quest Priority to 0, 5 & 90 but it didn't help.
User avatar
Eduardo Rosas
 
Posts: 3381
Joined: Thu Oct 18, 2007 3:15 pm

Post » Wed Sep 01, 2010 1:47 pm

Did you set the quest to "start game enabled"?
User avatar
ezra
 
Posts: 3510
Joined: Sun Aug 12, 2007 6:40 pm

Post » Wed Sep 01, 2010 7:07 pm

Yes, that is enabled by default.
User avatar
sarah taylor
 
Posts: 3490
Joined: Thu Nov 16, 2006 3:36 pm

Post » Wed Sep 01, 2010 8:25 am

"itemRef" is typoed as "itemRer" in one of the if statements. This may have compiled, treating it as a literal string. That would cause the script to fail silently, because it never passes that if.
User avatar
OnlyDumazzapplyhere
 
Posts: 3445
Joined: Wed Jan 24, 2007 12:43 am

Post » Wed Sep 01, 2010 4:34 pm

Yes, I changed that too. :banghead:

It wouldn't let me save when it was ItemRer
User avatar
Jaki Birch
 
Posts: 3379
Joined: Fri Jan 26, 2007 3:16 am

Post » Wed Sep 01, 2010 8:07 pm

hit the tilde key in game and type into the console

sqv questname

and replace questname with the name of the quest you attached the script to.

This should show you whether the quest script is even running or not to start with.

Note however that quest scripts take a few seconds to start after loading your game, so give it at least 5 seconds or so.
User avatar
Carys
 
Posts: 3369
Joined: Wed Aug 23, 2006 11:15 pm

Post » Wed Sep 01, 2010 8:39 pm

It says that the quest is running, with priority 0. Could the problem be within the script?
User avatar
Lori Joe
 
Posts: 3539
Joined: Tue Jun 20, 2006 6:10 am

Post » Wed Sep 01, 2010 11:22 am

I'm not sure what IsActorDetected returns if you're not even attempting to sneak. Make sure you're in sneak mode when you try this, even though you're alone in the cell.
User avatar
Philip Lyon
 
Posts: 3297
Joined: Tue Aug 14, 2007 6:08 am

Post » Wed Sep 01, 2010 10:32 am

I stole items while sneaking or standing, with or without other NPCs in the cell, detected or not, and the item is still flagged as stolen in my inventory. :facepalm:
User avatar
Robert DeLarosa
 
Posts: 3415
Joined: Tue Sep 04, 2007 3:43 pm

Post » Wed Sep 01, 2010 11:21 am

I stole items while sneaking or standing, with or without other NPCs in the cell, detected or not, and the item is still flagged as stolen in my inventory. :facepalm:


Insert some debug statements in the script, to see it excecutes properly.

For example, insert

printc "before setOwner"

printc "after setOwner"


before and after the ownership setting lines. You probably got the idea - insert as many prints, in different parts, as you like. You can see them print to the console then - then you know if some if-statement didn′t pass etc.


It′s POSSIBLE that the whole idea doesn′t work - even though I know the item gets added to your inventory only the next frame after the OnControlDown fires, it′s possible that the game reads the ownership during that frame already (and thus the script is inherently too late) - and then adds a COPY of that item, with THAT ownership, to your inventory.

We′ll know that once we know if the script actually does what it′s supposed to do (-> insert print commands). If it does, and it still fails, then it simply cannot be done like this. Then it requires finding the copy of the item you activated in your inventory, by inventory looping, and setting the flag there. I didn′t do this, even though I know how to, cause it′s simply much longer script to write and seemed unnecessary here. ;)
User avatar
Heather beauchamp
 
Posts: 3456
Joined: Mon Aug 13, 2007 6:05 pm

Post » Wed Sep 01, 2010 3:24 pm

Could you give me an example of where to insert "printc"? Before & after "TestExpr(itemRef.SetOwnership)"?
User avatar
Stephanie Nieves
 
Posts: 3407
Joined: Mon Apr 02, 2007 10:52 pm

Post » Wed Sep 01, 2010 3:53 pm

Could you give me an example of where to insert "printc"? Before & after "TestExpr(itemRef.SetOwnership)"?


yeah, like:

printc "I′m before SetOwnership"
"TestExpr(itemRef.SetOwnership)"
printc "I′m after SetOwnership"


This way the script "talks to you" via console, you can make it tell you what it′s doing. If some message DOESN′T print, when it should, you′ll know the if condition before it didn′t pass.

Like:

printc "before if itemref"
if(itemRef != 0)
printc "after if itemref"
User avatar
Elizabeth Lysons
 
Posts: 3474
Joined: Fri Feb 02, 2007 7:16 am

Post » Wed Sep 01, 2010 2:24 pm

I keep getting an error: "Missing parameter format string."
User avatar
Bellismydesi
 
Posts: 3360
Joined: Sun Jun 18, 2006 7:25 am

Next

Return to IV - Oblivion