is there a way to determine...

Post » Thu May 05, 2011 4:19 am

a way to see if an Item is placed, or random loot.

for scripting purposes.
User avatar
Susan
 
Posts: 3536
Joined: Sun Jun 25, 2006 2:46 am

Post » Thu May 05, 2011 10:39 am

Items "in the world" or in a cell are placed, unless an enemy drops the item.
User avatar
Siobhan Wallis-McRobert
 
Posts: 3449
Joined: Fri Dec 08, 2006 4:09 pm

Post » Thu May 05, 2011 3:31 pm

Items "in the world" or in a cell are placed, unless an enemy drops the item.


I meant to scan the item with a script to see if it is placed or dropped, a flag or property or some sort.
User avatar
Lucy
 
Posts: 3362
Joined: Sun Sep 10, 2006 4:55 am

Post » Thu May 05, 2011 3:51 am

No. Once the item is in an inventory, you can't tell whether it was originally placed/dropped.
User avatar
Emmanuel Morales
 
Posts: 3433
Joined: Sat Oct 06, 2007 2:03 pm

Post » Thu May 05, 2011 6:49 pm

No. Once the item is in an inventory, you can't tell whether it was originally placed/dropped.


forgive me, I am not phrasing my questions properly.

a way to determine whether an item was placed, or dropped, when initially picking it up.
User avatar
sarah
 
Posts: 3430
Joined: Wed Jul 05, 2006 1:53 pm

Post » Thu May 05, 2011 12:00 pm

That is what my post first post is about...If you are wondering if their is an OBSE mod that can tell you if the item on the ground is persistent or not, I do not know of one.
User avatar
Budgie
 
Posts: 3518
Joined: Sat Oct 14, 2006 2:26 pm

Post » Thu May 05, 2011 9:59 am

As far as I know, there isn't currently a way to tell if an item was placed by an esp/esm or if it was dropped by an npc or placed via script.

It should theoretically be possible, but it'd require someone to write a new OBSE plugin or a change in OBSE itself.
User avatar
victoria johnstone
 
Posts: 3424
Joined: Sat Oct 14, 2006 9:56 am

Post » Thu May 05, 2011 2:19 pm

Will not a placed item have a formId starting with the owning mod's load #, while a dropped item will start with "FF"? If so, you can check for that.


Btw, this thread belongs in, and should be moved to the CS subforum.
User avatar
Kay O'Hara
 
Posts: 3366
Joined: Sun Jan 14, 2007 8:04 pm

Post » Thu May 05, 2011 6:13 pm

That is what my post first post is about...If you are wondering if their is an OBSE mod that can tell you if the item on the ground is persistent or not, I do not know of one.


redoing my OOO-No_Guild_Ownership mod. to make it fit its original intent by oscuro and tandem
..., will have to approach the problem from a different path then, think I have it tho.

on pick up
is the item flagged as owned
if no, end

if yes
ownership = player
yes,
end
no
remove ownership
remove faction
flag stolen




is this possible scripting wise
there has to be a way to at least remove the faction ownership, oblivion does this on its own unless changed by a mod.
User avatar
Trevi
 
Posts: 3404
Joined: Fri Apr 06, 2007 8:26 pm

Post » Thu May 05, 2011 6:36 am

Possible? Yes. Practical? No.

One approach would be to place the script on the base object. If you do, the script will appear an every single placed reference of that object, of which the vast majority would not be in a guild. This is just begging for problems.
Another approach would be to make a new base object for the items in the guild, and place the script on that. This would limit the script to items in the guild, but then they would be entirely new items. They wouldn't stack with other items, would possibly interfere with other quests, etc. This is better than the first approach, but not by much.

The best approach is also the most complicated. Have a script run whenever the player is in a guild that tracks what the player is looking at. Disable the activate key, and see when the player presses it. If he activates it, then see if what he's activating and if you need to remove ownership from it. Then have the script activate the item for the player. This would have the least amount of potential bugs, but it would also be the hardest to script. If you don't do things just right, you can leave the player with a disabled activate button and break their game.
User avatar
Jennie Skeletons
 
Posts: 3452
Joined: Wed Jun 21, 2006 8:21 am

Post » Thu May 05, 2011 6:00 am

Possible? Yes. Practical? No.

One approach would be to place the script on the base object. If you do, the script will appear an every single placed reference of that object, of which the vast majority would not be in a guild. This is just begging for problems.
Another approach would be to make a new base object for the items in the guild, and place the script on that. This would limit the script to items in the guild, but then they would be entirely new items. They wouldn't stack with other items, would possibly interfere with other quests, etc. This is better than the first approach, but not by much.

The best approach is also the most complicated. Have a script run whenever the player is in a guild that tracks what the player is looking at. Disable the activate key, and see when the player presses it. If he activates it, then see if what he's activating and if you need to remove ownership from it. Then have the script activate the item for the player. This would have the least amount of potential bugs, but it would also be the hardest to script. If you don't do things just right, you can leave the player with a disabled activate button and break their game.


thanks, this is what I needed to know.

trigger the script to run whenever he clicks on a door to the guild hall, and exit the script on clicking the door to leave.
User avatar
Chris Cross Cabaret Man
 
Posts: 3301
Joined: Tue Jun 19, 2007 11:33 pm

Post » Thu May 05, 2011 6:02 pm

The best approach is also the most complicated. Have a script run whenever the player is in a guild that tracks what the player is looking at. Disable the activate key, and see when the player presses it. If he activates it, then see if what he's activating and if you need to remove ownership from it. Then have the script activate the item for the player. This would have the least amount of potential bugs, but it would also be the hardest to script. If you don't do things just right, you can leave the player with a disabled activate button and break their game.
This approach can be simplified quite a bit: Just have a script that runs in Gamemode every single frame (set fQuestDelayTime to 0.001). In every frame, check if the player presses the activation key. If so, check what he's looking at and do what you need on that item. This works because the game continues to run in Gamemode for a couple of frames after the activation key has been detected, so you have the opportunity window to do things you need then.

This is the trick Enhanced Economy uses in order to remove items from a container before the container is opened. I haven't tested it on items that can be picked up, but I think it would work, and should be tried before you start disabling the activation key.
User avatar
Epul Kedah
 
Posts: 3545
Joined: Tue Oct 09, 2007 3:35 am

Post » Thu May 05, 2011 7:11 pm

That is VERY useful to know.
User avatar
Queen Bitch
 
Posts: 3312
Joined: Fri Dec 15, 2006 2:43 pm

Post » Thu May 05, 2011 11:07 am

This approach can be simplified quite a bit: Just have a script that runs in Gamemode every single frame (set fQuestDelayTime to 0.001). In every frame, check if the player presses the activation key. If so, check what he's looking at and do what you need on that item. This works because the game continues to run in Gamemode for a couple of frames after the activation key has been detected, so you have the opportunity window to do things you need then.

This is the trick Enhanced Economy uses in order to remove items from a container before the container is opened. I haven't tested it on items that can be picked up, but I think it would work, and should be tried before you start disabling the activation key.



You do realize this means I am gonna have to cannibalize your script right?

nom nom nom
User avatar
MARLON JOHNSON
 
Posts: 3377
Joined: Sun May 20, 2007 7:12 pm


Return to IV - Oblivion