track a book placed in a generic container

Post » Thu Jan 21, 2010 8:23 pm

I'm stuck
I want to track a book I give to the player and replace it with another one at some point
cases :
A ) player drops it in interior or exterior (non oblivion) : solved
B ) player carries it : solved
C ) player puts it in a container (or a dead actor or in Oblivion plane or in a worldspace added from a mod which then he removes) :
container is a persistent ref, non respawning : solved
container is a persistent ref, respawning, or scripted with removeallitems (like Traven's chest), or a dynamic worldspace etc : not solved - http://www.gamesas.com/index.php?/topic/1084591-what-happens-to-a-persistent-reference-placed-in-a-respawning-chest/ no way to check if an item gets removed from the world. IsFormValid returns 1 (from the quest script - book is a persistent ref)
container is a non-persistent ref, non respawning : not solved - how do I access the container from a script when not loaded ? That is my main issue : any tricks ? add what ? a disabled low level processing actor in the cell which activates the container every frame ?
container is a non-persistent ref, respawning : see above

Help :brokencomputer: :banghead: :confused:
User avatar
amhain
 
Posts: 3506
Joined: Sun Jan 07, 2007 12:31 pm

Post » Fri Jan 22, 2010 12:38 am

Scan every container when the player activates it, to see if the book is in there and replace as necessary?

Make a note of every container a player activates while they have the book, check if the book is missing from the player afterwards and record the container reference. Re-add the book if it is missing the next time the player opens that container?
User avatar
Kortknee Bell
 
Posts: 3345
Joined: Tue Jan 30, 2007 5:05 pm

Post » Thu Jan 21, 2010 3:42 pm

snip* when the player activates it
How would I do check this (player is activating a container) from a quest script ? This could solve my main issue - provided the item is not gone for good - see below.

Make a note of every container a player activates while they have the book, check if the book is missing from the player afterwards and record the container reference. Re-add the book if it is missing the next time the player opens that container?
I have this ref from the script on the book (get container). But really I want the player to loose the book if he/she misplaces it - I use poor traven's chest all the time to destroy clutter, I would not see something reappear in it. Or if the player drops it in an obllivion world, a respawning chest etc How do I check if an item is removed ? There seems to be no easy answer.
Any ideas ?
User avatar
Ash
 
Posts: 3392
Joined: Tue Jun 13, 2006 8:59 am

Post » Fri Jan 22, 2010 12:21 am

You can use a quest script with a

Begin Menumode 1008

And then use GetActiveMenuRef to get the reference of the container that is associated with that menu. You store that reference and then back in gamemode check if the player still has the book, use a flag to activate the gamemode check as soon as the player leaves the container menu. If the player doesn't have the book anymore, then it went into that particular container.

Then you can control whether the book is in the container next time the player opens it by scanning then container for it and either adding or removing it at the time the player activates that particular container.
User avatar
megan gleeson
 
Posts: 3493
Joined: Wed Feb 07, 2007 2:01 pm

Post » Thu Jan 21, 2010 10:55 pm

Then you can control whether the book is in the container next time the player opens it by scanning then container for it and either adding or removing it at the time the player activates that particular container.
How do I check whether the player has activated the container the moment he/she opens it from quest script (which moreover does not run every frame)?

You can use a quest script with a

Begin Menumode 1008

And then use GetActiveMenuRef to get the reference of the container that is associated with that menu. You store that reference and then back in gamemode check if the player still has the book, use a flag to activate the gamemode check as soon as the player leaves the container menu. If the player doesn't have the book anymore, then it went into that particular container.
wouldn't be easier to use an object script on the ref which sets the variable "container" in my quest script ? that's how I do it now - any gotchas ?
thanks :)
User avatar
Killer McCracken
 
Posts: 3456
Joined: Wed Feb 14, 2007 9:57 pm


Return to IV - Oblivion