Could someone give me an example on how to use this? The wiki entry is empty. Is it instant or does it need to be updated?
http://www.creationkit.com/TextureSet_Script
Edit: It needs to be updated. http://www.nexusmods.com/skyrim/mods/71810/?
Could someone give me an example on how to use this? The wiki entry is empty. Is it instant or does it need to be updated?
http://www.creationkit.com/TextureSet_Script
Edit: It needs to be updated. http://www.nexusmods.com/skyrim/mods/71810/?
I don't know how much you know, so I'll start with the basics.
Let's say you have a set of forms that will use the same 3D model, but will use different textures. The models can specify pieces that can be reskinned, and the forms can specify a TextureSet (Object Window/Miscellaneous/TextureSet) for each piece. Bethesda uses this a lot; to name a few examples, cloth banners, dirt cliffs, and roads all use TextureSets to reskin the same handful of 3D models.
Taking a brief look at a TextureSet in the Creation Kit, I see that they can specify multiple texture files -- diffuse, normal, and glow maps, for example. So I'm guessing that the SKSE TextureSet functions allow you to change, at run-time, what textures a TextureSet uses.
I think I follow. What do you mean by run-time? I'm playing around with it but this is the only way I could get it to compile and it doesn't make sense to me.
TextureSet Property MyTexturePath Auto
;stuff
MyTexturePath.SetNthTexturePath(1, MyTexturePath)
I want to point to the item itself, I tried a few things but no luck.
Edit: Could the int be pointing to a BSLightingShaderProperty number on the model itself? 1st string, 2nd string etc
Changing something "at run-time" means changing it in memory while the game is running, in contrast to changing it in the game's files. The term is often used when discussing something that can't normally be changed at run-time (like TextureSets, which can't be changed without SKSE).
TextureSets don't have any connection to 3D models: the models forms use them; they don't use the models. The integer has to be an index for textures in the TextureSet, but I'm not sure if the indices have a consistent meaning across all TextureSets. For example, if you open up the CowPainted TextureSet in the Creation Kit, you'll see that it has three textures; so if you wanted to work with that TextureSet, you should be able to change the diffuse map (colors), normal map (bumps), and subsurface map (flesh?) independently of each other.
Would you mind telling us what you're trying to do? Knowing that might make it easier to get you where you're going.
Thanks for clearing that up.
I'm trying to change the texture set based on light level.
Scriptname AceLightLevelScript extends ObjectReference
Actor Property PlayerRef Auto
Weapon Property LightGem Auto ;Item itself
TextureSet Property MyTexturePath Auto ;Random texture for testing purposes
Event OnEquipped(Actor akActor)
If PlayerRef.IsEquipped(LightGem)
PlayerRef.UnEquipItem(LightGem)
EndIf
While PlayerRef.GetEquippedWeapon(true) == LightGem
If PlayerRef.GetLightLevel() <=1
Debug.Notification("One with the shadows")
ElseIf PlayerRef.GetLightLevel() >1 && PlayerRef.GetLightLevel() <=3
Debug.Notification("Very Dark")
ElseIf PlayerRef.GetLightLevel() >3 && PlayerRef.GetLightLevel() <=5
Debug.Notification("Quite Dark")
ElseIf PlayerRef.GetLightLevel() >5 && PlayerRef.GetLightLevel() <=15
Debug.Notification("Somewhat Dark")
MyTexturePath.SetNthTexturePath(1, MyTexturePath) ;Initial test to see if it changes
ElseIf PlayerRef.GetLightLevel() >15
Debug.Notification("Not in the dark")
Endif
EndWhile
EndEvent
Ah, I see. Interesting.
Have you tried passing zero instead of one? These sorts of things tend to be zero-indexed, so you might be changing the 1st texture when what you really want is the 0th.
And for that matter (and I'm sorry if this is a dumb question), is that texture-set actually being used by a nearby form so you can see it? When you set a form's 3D model, you have http://www.creationkit.com/Model_Data if the model supports them.
I tried 0 as well but I don't think it'll make a difference if I'm not pointing to an object.
I thought it would be more like:
Self.SetNthTexturePath(0, MyTexturePath)
MyTexturePath.SetNthTexturePath(0, Self)
LightGem.SetNthTexturePath(0, MyTexturePath)
I don't quite understand the last question. I'm just testing right now so I selected any random staff and any random texture set(I think a set of clothing). Don't texture sets just wrap around the mesh regardless of being meant for it or not?
Ah. I had a look through art and sound and there doesn't seem to be a textureset option. Whoops!
I see there's an effect though, so I might be able to use that as feedback.
Edit: The weapon has to be re-equipped for SetEnchantment to take visual effect. Damn.
Here's the current code snippet:
ElseIf PlayerRef.GetLightLevel() >5 && PlayerRef.GetLightLevel() <=15
Debug.Notification("Somewhat Dark")
if LightGem.GetEnchantment() != Ench1
LightGem.SetEnchantment(Ench1)
PlayerRef.UnEquipItem(LightGem)
PlayerRef.EquipItem(LightGem)
EndIf
ElseIf PlayerRef.GetLightLevel() >15
Debug.Notification("Not in the dark")
if LightGem.GetEnchantment() != Ench2
LightGem.SetEnchantment(Ench2)
PlayerRef.UnEquipItem(LightGem)
PlayerRef.EquipItem(LightGem)
EndIf
Further testing shows it's the visuals are no where to be found. I think enchantments added this way lose there visuals, because that's what's happening with me.
You should give your weapon charge before you test enchantments.. Anyway, still needs to be updated. Looking for a subtler approach than unequip/equip.
I would never have thought to try something without scripts. Great idea!
Is this what you mean?
http://s31.postimg.org/84zqrnu9n/Like_This.jpg
The other effect is checking for lightlevel >12
It doesn't change at all it seems, even when equipping while in the condition is correct.
Edit: Found this, do you think it could be used for this?
http://www.creationkit.com/Play_-_EffectShader
Cheers for clearing that up. I think I'll be using a different method for the light measuring tool. I'll circle back to it if this new method doesn't work out.
If you're still interested in helping me, this thread has the info and this post is what I'm up to. You can get away with just reading the EDIT part of the post, the rest was discussion and failed ideas of mine.
http://www.gamesas.com/topic/1601098-widget-and-basic-ui-creation/?p=25137742