Jump to content

[WIP] Break Undies Framework


JosefGrey

Recommended Posts

dug around a bit on the interwebs . . .

 

It doesn't say it explicitly on the CK wiki, but i've read elsewhere that Actor extends ObjectReference. so anything that you can do to an objref you can do to an actor. Right?

 

that being said, what about this:

http://www.creationkit.com/DamageObject_-_ObjectReference

with the companion funcs

ClearDestruction - ObjectReference

GetCurrentDestructionStage - ObjectReference

OnDestructionStageChanged - ObjectReference

 

i've no luck in finding the depth to which this works, whether it affects unique or global reference. but from the things i've read where its' been suggested, it seems to be unique.

 

[edit] just thinking about the game, i'm not so sure there's anything in the world that actually uses this, unless it's a lower-order class than actors taking damage. there's nothign in the game that i can remember that is affected (destroyed, changes visible state) by just directly beating on it. the ck wiki definition uses an example from Fallout "is megaton damaged to state 2?" which i'm supposing is a reference to having been nuked.

 

[edit 2] it'd be kinda cool if this could be used from a higher order . . . giving the player the ability to smash open containers, break down doors, bust tables and chairs, destroy dishes, etc. it begs the question "if that's possible, why didn't beth just do it in the retail game?" it would certainly add some life to the place.

Link to comment

you can't add ench/smith via function? then how the hell does the game do it?

 

if you can take a normal item and make it enchanted or smithed' date=' then you can make a 'ModSmith' function that internally copies out the relevant info, destroys the original and creates a new one. a kludge to be sure, but it works.

[/quote']

 

I think the game creates a new base object when you enchant something. Looking at the arcane enchanter in the CK, it has some keywords for enchanting. I currently don't see a way to create a new base object via script. The new SKSE lets you set enchants, but again that sets it to the base object, not just a single reference of the object.

 

EDIT: with regard to your last post, all of that damage stuff is from Fallout 3 :(... it's a shame because it is EXACTLY what we are doing here, it's just disabled for Skyrim. That said, the fact that they left it in makes me wonder if they were thinking of adding it in with DLC.

Link to comment

http://forums.bethsoft.com/topic/1370183-wipz-skyrim-script-extender-skse/page__view__findpost__p__20714777

 

How far away are you from being able to set enchantments on the fly?

 

I think it depends on what you want. If you simply want SetEnchantment on things like Weapon or Armor, that would be easy to do. It would have the same caveats as all other Set funcions, which is that enchantments are part of the base form and any changes will affect all copies of that form.

 

)=

 

actually there are a couple more messages down the page in that discussion. you may be able to glean something from it.

Link to comment

http://forums.bethsoft.com/topic/1370183-wipz-skyrim-script-extender-skse/page__view__findpost__p__20714777

 

How far away are you from being able to set enchantments on the fly?

 

I think it depends on what you want. If you simply want SetEnchantment on things like Weapon or Armor' date=' that would be easy to do. It would have the same caveats as all other Set funcions, which is that enchantments are part of the base form and any changes will affect all copies of that form.[/quote']

 

)=

 

actually there are a couple more messages down the page in that discussion. you may be able to glean something from it.

 

Ahh, yep, that confirms it. Honestly it's not a huge deal--- the system I've got running now is pretty sick. I do think eventually we'll figure out a way so that each set gets its own durability though (especially as more scripting options become available).

 

On the upside, I've 100% completely eliminated the pause between transitions from ever happening. Also I've made it possible to put a sound/shader/visual effect in when armor transitions. It's pretty freaking boss. I've made a few custom shaders that you can choose from when making a BU armor (or none at all). Also, each armor can have a different sound as it breaks.

 

I attached an example screen of one of the visual effects... this happens over the period of about half a second.

 

Naturally, I'll either release a version that doesn't have visual effects or have a method of switching it on/off, since I see how it could be distracting.

post-10250-13597879562422_thumb.jpg

Link to comment

yes that would be distracting as is . . . but i can see a dust effect, like that which sometimes falls from the ceiling in caves, fitting right in the game. BanG and little pieces fall off the armor, masking the pop to the new texture.

 

Is this new version available yet?

 

 

also... i'm not so sure that's settled... here's some posts that i've come across. might be inspirational?

 

So I've been plowing through the Armor and ArmorAddon classes, I've implemented:

http://forums.bethsoft.com/topic/1391126-wipz-skyrim-script-extender-skse/page__st__60__p__21201827#entry21201827

 

 

This is a conversation very close to what you're doing here.

http://forums.bethsoft.com/topic/1408581-req-skse-transmogrify-armor/page__view__findpost__p__21490910

 

 

While I believe it may be possible to add an existing enchant, it will not yet be possible to create new enchants, or combine enchants until we can create new Forms

http://forums.bethsoft.com/topic/1382093-wipz-skyrim-script-extender-skse/page__st__120__p__21061434__hl__enchant%20function__fromsearch__1#entry21061434

 

 

SetItemHealthPercent exists in code, but there's very little info on it:

	void SetItemHealthPercent(TESObjectREFR* object, float value)
{
	// Object must be a weapon, or armor
	if(object) {
		if(DYNAMIC_CAST(object->baseForm, TESForm, TESObjectWEAP) || DYNAMIC_CAST(object->baseForm, TESForm, TESObjectARMO)) {
			ExtraHealth* xHealth = static_cast(object->extraData.GetByType(kExtraData_Health));
			if(xHealth) {
				xHealth->health = value;
			} else  {
				ExtraHealth* newHealth = ExtraHealth::Create();
				newHealth->health = value;
				object->extraData.Add(kExtraData_Health, newHealth);
			}
		}
	}
}

Link to comment

here's yet another post today...

 

so i can do an armor retex. what if i do a body retex set to go in /actors/character/female? will it swap that out?

 

ideally, it'd monitor both separately. it'd be cool to have your body get all stained and cut up etc, but healing pots don't fix it... healing magic, sleep or absorb health will, tho.

 

ok ok that's kinda high minded, but you get the pic.

 

also, i hope my thursday posts were helpful.

Link to comment

Ohhhh if SetItemHealthPercent exists then that could be used. It's an Object Reference function (which is what we need). Going to try it out now...

 

About the body being dynamic, I actually made a separate mod for that but want to get the kinks of this one worked out so as to make that one better. It's basically another instance of the dynamic armor framework that equips the an item with the body model in an unnamed slot (and therefore can be swapped out on different conditions). You'd have to edit all armor sets you plan on using though so that there's no body model, or it'll conflict.

 

EDIT: Lol, this scripting language blows. After researching it, you apparently cannot get a reference for something in an inventory. I did a test and displayed "self" in a debug message (should have returned a reference ID for the armor), and it returned the message in the following image. The reference ID there is the ID of the player (because the object is in the player's inventory). So what this means is when I try to get/set the item health of the armor, it simply doesn't work.

 

EDIT2: So, here's an idea... thinking out loud here. The durability only really needs to be "pasted" to the armor reference when it gets unequipped. So, I have an OnUnequipped event that gets # of durability tokens in the actor's inventory, gets the reference of the actor whose inventory it is in, then it drops itself, gets its new and shiny reference ID (stupid), then applies the item health based on durability tokens in the actors inventory, then adds itself back to the inventory. No idea what problems I'll run into when trying this, but it's worth a shot.

 

Interestingly it appears that issues like this caused a lot of the instability in Oblivion. A lot of crashes were based on the game trying to do stuff with reference IDs that didn't exist.

 

EDIT3: Well, naturally there's a glaring issue here too. The only function I see that drops items accepts form IDs (can't drop a reference, since items in inventories don't have references). So, I don't know of a way to get the item that was just unequipped into the world so it can be edited.

post-10250-13597879568048_thumb.jpg

Link to comment

Break Undies for Skyrim!? Heheh, hehehehahahahahahaaaa!! Those pics look great BTW. Cant wait to get this mod, once I get my game working again LOL! Man... Fighting in Skyrim is gonna become just TOO arousing to maintain composure, whether YOUR the girl, or THEY are! *shudders and bites bottom lip*

 

Edit: Can I ask what face model your using on the OP pics? Or did you make it yourself? Whatever the case, its really good.

Link to comment

Break Undies for Skyrim!? Heheh' date=' hehehehahahahahahaaaa!! Those pics look great BTW. Cant wait to get this mod, once I get my game working again LOL! Man... Fighting in Skyrim is gonna become just TOO arousing to maintain composure, whether YOUR the girl, or THEY are! *shudders and bites bottom lip*

 

Edit: Can I ask what face model your using on the OP pics? Or did you make it yourself? Whatever the case, its really good.

[/quote']

 

It's a Lunari character that I made with a few modifications to one of the presets (I believe I made the jaw as thin as possible, changed out the nose and switched the eyebrows to another set within the Lunari mod). I don't think I'm using the Lunari eye textures though.

 

 

So yeah, I found someone to help with the Bodyslide stuff, so tonight I went back and made some edits so he could make the first set bodyslide compatible (yay). I'll probably make a release of the script later this weekend. One of the problems with scripts that run on objects (like the DAF script) is that when you install a new version it doesn't overwrite the script that exists on pre-existing instances of objects in the gameworld. I'm not sure when (or if) it ever updates, so to avoid a mess of confusion I want to limit the number of releases. If someone knows the details regarding that I'd like to know so that I can make a disclaimer of some sort, as it can get pretty confusing.

Link to comment

Okay well ill post here then.

 

the problem with your current method . . . when you're fighting someone that's wearing the same kind of armor, everytime you guys hit each other, both your armors will degrade.

 

 

lol this is funny, i've unintentionally put a lot of cycles on this. so lets break ti down a bit. . . I'm going to say a lot of obvious things here but it's for clarity, a foundation of understanding. If something is wrong or even slightly inaccurate, let me know.

 

 

when you posess an outfit, it can be considered unique as only you have it. apparently the game thinks that as well, considering everything in your inv from the most base perspective. The greatest opportunities for it to no longer be unique occur after leaving your inventory.

 

 

what you want to do: change the value of a parameter of a record.

 

what you can't do:  manipulate records in inv.

 

what you can do: account for all kinds of shit regarding (but not directly referencing) that record in your inv.

 

 

In other words, you can do everything you want, just not to the thing you want to do it to at the times when you need to do it.

 

 

The solution it seems is to make sure that the outfit is absolutely prepared before putting it in inv.

 

 

So here's an ideas for a work around to change the value of the parameter...

 

copy out the accounting to a newly created instance of the record, add it to inv, swap the equip state of the 2, remove the old one from the world. this could suck. you'll be spawning/destroying all kinds of refids. unless the game is efficient with this kind of thing, it could wind up eating ram rather quickly if you fight a lot. Every time you take a hit BAM new refid.

 

 

but . . . if you have a complete list of fully pre-generated versions with the predetermined values, then you'd pre-allocate not only ram, but refids. at that point you could just grab the appropriate instance of the record into the inv and just remove the exsiting one. i guess it's cleaner programatically. Further, i suppose such a list wouldn't ahve to be manually created, it could be done when added to inv and cleaned up when removed. this would simplify the outfit creation process. an external modder now wouldn't have to do a bunch of extra shit.

 

 

it would seem that this would also work for other actor-containers (npcs with equipped armor). A bandit would reference the same 'list' of outfits.

Link to comment

Okay well ill post here then.

 

the problem with your current method . . . when you're fighting someone that's wearing the same kind of armor' date=' everytime you guys hit each other, both your armors will degrade.

 

 

lol this is funny, i've unintentionally put a lot of cycles on this. so lets break ti down a bit. . . I'm going to say a lot of obvious things here but it's for clarity, a foundation of understanding. If something is wrong or even slightly inaccurate, let me know.

 

 

when you posess an outfit, it can be considered unique as only you have it. apparently the game thinks that as well, considering everything in your inv from the most base perspective. The greatest opportunities for it to no longer be unique occur after leaving your inventory.

 

 

what you want to do: change the value of a parameter of a record.

 

what you can't do:  manipulate records in inv.

 

what you can do: account for all kinds of shit regarding (but not directly referencing) that record in your inv.

 

 

In other words, you can do everything you want, just not to the thing you want to do it to at the times when you need to do it.

 

 

The solution it seems is to make sure that the outfit is absolutely prepared before putting it in inv.

 

 

So here's an ideas for a work around to change the value of the parameter...

 

copy out the accounting to a newly created instance of the record, add it to inv, swap the equip state of the 2, remove the old one from the world. this could suck. you'll be spawning/destroying all kinds of refids. unless the game is efficient with this kind of thing, it could wind up eating ram rather quickly if you fight a lot. Every time you take a hit BAM new refid.

 

 

but . . . if you have a complete list of fully pre-generated versions with the predetermined values, then you'd pre-allocate not only ram, but refids. at that point you could just grab the appropriate instance of the record into the inv and just remove the exsiting one. i guess it's cleaner programatically. Further, i suppose such a list wouldn't ahve to be manually created, it could be done when added to inv and cleaned up when removed. this would simplify the outfit creation process. an external modder now wouldn't have to do a bunch of extra shit.

 

 

it would seem that this would also work for other actor-containers (npcs with equipped armor). A bandit would reference the same 'list' of outfits.

[/quote']

 

Nah, the first line is incorrect. Each actor has completely independent durability levels and therefore armor degrades independently per actor. The script equips different stages based on the number of durability tokens in the actor's inventory. There are 9 different base objects for the Imperial Light Armor. All the script does is swap out which one is required (meaning there's no manipulation of base objects). I see what you were thinking though.

 

The only downside to the current method is that if Actor A takes off a set of Armor A, then puts on a different set of Armor A, it will still be degraded to the extent that the original set was.

 

Also, you pretty much just described how the DAF works, lol. The difference being that the "base armor" (the one with no model and all the stats of the armor) always stays on. This is the object that the script runs on and gives the orders to equip and unequip the other models. This method is necessary so that the armor can still be enchanted and smithed (if the base armor object never leaves the world, it never loses its enchantments/smithing).

 

EDIT: A good point to reinforce the idea that armor won't break for everyone when it breaks for someone is that the script running on the armor is an Object Reference script. I think at one point I mistakenly called it an "Armor" script, which would be a problem. Since it's an Object Reference script, different instances of the script can run on different references of the armor (or, different actors wearing the armor since these armor sets no longer have references... which is soooo duuuumb).

Link to comment

The only downside to the current method is that if Actor A takes off a set of Armor A' date=' then puts on a different set of Armor A, it will still be degraded to the extent that the original set was.

[/quote']

 

 

that's not a downside, that's a feature. keeps ppl from cheating (=

 

what happens if they drop the outfit, then pick up a different one?

 

and then this: http://forums.bethsoft.com/topic/1409318-wipz-skyrim-script-extender-skse/page__view__findpost__p__21618725

 

tldr

There is currently no method to modifying items in your inventory, ObjectReferences are base forms placed in the world. Inventory items are base forms with some extra data attached. While we can get at this data internally, we have no suitable method for exposing this data safely to Papyrus.

 

do you know what that extra data is? can you mod it? I'll bet there's some underused field where modification would have no effect on the game except in some corner case.

 

so OnPickup (or whatever the funcion is when adding to inv) you change that "extra data" to make the outfit identifiably different from other outfits in your inv.

 

While this may work for your mod, it will probably break inv stacking for apparel.

Link to comment

The only downside to the current method is that if Actor A takes off a set of Armor A' date=' then puts on a different set of Armor A, it will still be degraded to the extent that the original set was.

[/quote']

 

 

that's not a downside, that's a feature. keeps ppl from cheating (=

 

what happens if they drop the outfit, then pick up a different one?

 

and then this: http://forums.bethsoft.com/topic/1409318-wipz-skyrim-script-extender-skse/page__view__findpost__p__21618725

 

tldr

There is currently no method to modifying items in your inventory, ObjectReferences are base forms placed in the world. Inventory items are base forms with some extra data attached. While we can get at this data internally, we have no suitable method for exposing this data safely to Papyrus.

 

do you know what that extra data is? can you mod it? I'll bet there's some underused field where modification would have no effect on the game except in some corner case.

 

so OnPickup (or whatever the funcion is when adding to inv) you change that "extra data" to make the outfit identifiably different from other outfits in your inv.

 

While this may work for your mod, it will probably break inv stacking for apparel.

 

If they drop it and pick up a different one the same thing happens. While I could modify it so that's not the case, there would be no way to determine if they were picking up the one that was dropped or a completely different one.

 

Being able to edit the extra data would be a larger scope than what I'm looking to do. If it is doable though I'm sure SKSE will utilize it at some point. There seems to be a lot of people looking to do similar things as to what I'm trying to do with this.

 

is there a comand so i dont heal up so quicly?? or that my broken armor remains broken after healing???

 

There's a mod on the Nexus that stops health regeneration. Once I release the newest script (sooner rather than later) it won't be necessary though~~.

Link to comment

something else: it seems that equipped items have an objref. how about that' date=' huh? what could you do with that?

[/quote']

 

Did you see someplace how you can access it? The stuff I tried just returned the actor's reference ID, not the equipped item.

Link to comment

something else: it seems that equipped items have an objref. how about that' date=' huh? what could you do with that?

[/quote']

 

Did you see someplace how you can access it? The stuff I tried just returned the actor's reference ID, not the equipped item.

 

can you wheel thru the equipped items and see what it returns?

Link to comment

Amazing project. It will require a lot of work to get this through, and I don't expect it to be finished anytime soon, or this year for that matter, but no rush.

 

You think in the future you can extend the time in which the armor stays damaged before it starts to "reset" back to normal ? as it's a bit too quick right now.

Keep up the good work.

Link to comment

something else: it seems that equipped items have an objref. how about that' date=' huh? what could you do with that?

[/quote']

 

Did you see someplace how you can access it? The stuff I tried just returned the actor's reference ID, not the equipped item.

 

can you wheel thru the equipped items and see what it returns?

 

Nah it has to have a script with the debug code attached to the object. There may be a problem in that I'm not accessing the proper value though. Where'd you see that equipped objects have a reference ID?

 

Amazing project. It will require a lot of work to get this through, and I don't expect it to be finished anytime soon, or this year for that matter, but no rush.

 

You think in the future you can extend the time in which the armor stays damaged before it starts to "reset" back to normal ? as it's a bit too quick right now.

Keep up the good work.

 

Thanks! Yeah there's a lot of work to be done. The whole system for changing armor models will change in the next script update -- there's some info a few pages back if you want to look into it.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use