Inheritances: Object Properties (Question)

Post » Tue Jun 19, 2012 3:26 pm

Hi there,

Is there any way of having an object inherit another (base) object's properties?

This is my problem: I have a mod where you can fill empty bottles using a barrel, but I had to duplicate all available beverages to use this bottles. Let me explain it another way:

There are 4 types of empty wine bottles:
- Empty wine bottle model 01
- .. model 02
- .. model 03
- .. model 04

And then we have the same models for full wine bottles.

If the player uses a black-briar barrel and is carrying "empty model 03", then I create in its inventory a bottle of black-briar mead, but using my own item type, with the base model of the "wine bottle 03".

My problem is that there are other mods around that attach properties (drugged, drunk, stumble, thirsty, etc.) to the base reference of the beverages, and if someone is using both mods, they wont see any effect when drinking from my bottles.

So my question here is: Do I have any way to inherit the properties of lets say, Nord Mead, into my "nord mead bottle" item type?

What I want is to allow the player to have installed any mod, so I just inherit the base beverage properties, whichever they are, into my object.

Thanks for any help.
Regards.
User avatar
Elea Rossi
 
Posts: 3554
Joined: Tue Mar 27, 2007 1:39 am

Post » Tue Jun 19, 2012 6:59 pm

It sounds to me like you just need to use duplicate versions of everything you edit and have you're own drink names, a whole new selection of creatable drink or whatever.
User avatar
Kayla Oatney
 
Posts: 3472
Joined: Sat Jan 20, 2007 9:02 pm

Post » Wed Jun 20, 2012 12:58 am

It sounds to me like you just need to use duplicate versions of everything you edit and have you're own drink names, a whole new selection of creatable drink or whatever.

Maybe I didn't explain myself. Here goes a bit more of information:

I allow 4 empty wine bottles to be used (MiscObject reference). Skyrim has also 4 versions of these same bottles, but full (Potion reference).

I duplicated all those 4 versions, renaming them to "nord mead", "honningbrew mead", etc... So I have 4 duplicated wine bottles for nord mead, another 4 duplicates for black-briar mead, etc... each one with its own bottle type, using the wine bottle models.

All those are my items. I set them the name, price and properties.

Now the problem is that I need to inherit the properties of black-briar mead, and apply them to my black-briar mead bottle. This way if the player has a mod that makes the character die after drinking 10 black-briar bottles, it would also work with my mod.

I don't even know if this is possible.
User avatar
Josh Dagreat
 
Posts: 3438
Joined: Fri Oct 19, 2007 3:07 am

Post » Tue Jun 19, 2012 10:36 pm

I did some tests and read some CK pages without success, so I'm still lost here.

Anyway, I've been thinking, and two ideas come to my mind to try doing what I want:

When the player consumes my Potion reference, ...
1- ... Silently add the real object in the inventory and automatically consume it.

.. or ..

2- ... Get the properties / effects of the base object and apply them to the player.

Basically, right now I do a check for the item type consumed. Lets say the player drinks Honningbrew mead stored in the WineBotle02 model (this item type is created by me duplicating the FoodWine item and editing its properties and name). I then create the empty bottle on the inventory for that exact model consumed. If I could somehow add a honningbrew bottle and drink it automatically (silently), or either get the honningbrew properties / effects and apply them to the player, I think my problem would be solved.

My problem is that I don't even know if any of those is doable with the CK.

Thanks again.
User avatar
Tiff Clark
 
Posts: 3297
Joined: Wed Aug 09, 2006 2:23 am

Post » Tue Jun 19, 2012 9:28 pm

I do not see any way of getting the properties or effects of one object and apply them to another.

The problem with consuming the default potion/wine after consuming yours is that it sounds like you will get the effects duplicated, but if you wanna try that, I think adding to the potions a script extending ObjectReference and an OnEquipped (or maybe OnSpellCast) Event (never tried it myself) should work.

I guess your idea is using the different bottles, otherwise I would tell you the easiest way would be to give the player the default potion no matter which empty bottle they use.
User avatar
daniel royle
 
Posts: 3439
Joined: Thu May 17, 2007 8:44 am

Post » Tue Jun 19, 2012 10:33 pm

I guess your idea is using the different bottles, otherwise I would tell you the easiest way would be to give the player the default potion no matter which empty bottle they use.

I though on that, but as the last option. The thing is that I wanted an immersive mod, one that feels realistic. Pouring mead from a keg and make it automatically spawn a Nord Mead bottle on the inventory is not something I wanted. That's why I came up with the idea of allowing empty bottles, and creating a "full bottle" version of Nord Mead using the Wine Bottle model.

Another option could be to force the player to have empty bottles of every type, so if they want to use a Nord Mead barrel, they would need an empty Nord Mead bottle. This on the other hand would need me to duplicate the full-bottle model, remove any properties, and disable it from using (consuming), something I also don't know if it's doable. Hmmm... Or maybe just allow to consume but auto-create again in the inventory if this happens?... The only problem is how to detect consume, and remove item, becase as far as I know both rely on "OnItemRemoved".

I don't know... any suggestions or comments on both ideas are welcome.
User avatar
Motionsharp
 
Posts: 3437
Joined: Sun Aug 06, 2006 1:33 am

Post » Tue Jun 19, 2012 4:59 pm

Update:

OK, I've been doing some tests and I think I finally came up with a decision.

When a beverage is consumed, I create a new object: "empty [beverage] bottle", being just a duplicate of the original bottle, but without effects.

Also, on the OnItemRemoved event, I check if this new empty bottle is the one trying to be consumed, and in this case I automatically create it again.

Now the next step is to detect if this item type (empty bottle) is available when trying to use a barrel, and if it's the case I will remove it and replace with the original game bottle, meaning any mod should be compatible with it. So if the player wants to fill a bottle of Black-briar mead, an empty bottle of BB-Mead will be needed.

The only "but" I see to all this is that the empty bottle is "Food" type, so is listed there, instead on Misc.... I guess that's something for the future, when I learn to replace models.

Thanks! :)
User avatar
djimi
 
Posts: 3519
Joined: Mon Oct 23, 2006 6:44 am


Return to V - Skyrim