Jump to content

Add decals (TextureSet) via script


Recommended Posts

Hello.

Has anyone successfully added a decal (base object TextureSet) in the game world via script?

I made a script that adds a decal in the same position and same rotation of the player. Also tried a version where the placement is 64 units in front of the player.

The ObjectReference of the TextureSet is successfully created but does not have any effect ingame. The placed TextureSet is THERE because I used Debug.Trace to get the refid and I'm able to use Player.MoveTo() command that it moves the player to the spawned TextureSet.

Tried the ways with PlaceAtMe -> MoveTo and also tried with PlaceAtMe -> SetPosition -> SetAngle.

No lucky

Link to comment
Share on other sites

SKSE provides SetNthTexturePath via the TextureSet script.  However, there is no documentation on its usage.  Thus, it will take some trial and error to utilize it.

I suspect that if you have an object with an existing TextureSet applied to it, you can then use SetNthTexturePath to make changes to that TextureSet during runtime. However, I do not think you can apply a texture set itself to an object at run time with Papyrus.

TextureSets are meant to be applied towards an object's model.  It is not an object that can be utilized on its own.

Link to comment
Share on other sites

I would add that for objectReferences there is GetWorldModelNthTextureSet and SetWorldModelNthTextureSet, for armorAddon there is GetModelNthTextureSet and SetModelNthTextureSet. Note that to use these there must already be a textureSet applied to the model in the creation kit. The set functions can't apply a textureSet to models that don't already have one.

Link to comment
Share on other sites

Hello. I know what do you mean about TextureSet usage. However, as I said in post, I'm talking about decals. I mean the blue arrow shaped marker you see in CK. For example, these are used for blood splashes.

Link to comment
Share on other sites

What is the impact nif, I think you should placing it, not the texture set, asking?

Edit if that means nothing, then you may want to explain further, we do not get it, but I meant placing whatever Object is implementing the texture sets you made, just so we are clear

Link to comment
Share on other sites

image.png.0daf3d41df8ca91e02b04486a241ef33.png 

This is an example of what I'm talking about. In this case is a TextureSet (ShadowMarkLootWood01) is placed in the world and is a decal. Is facing the building wall and project the shadowmark texture (the circle with lines).

As I said in post, I would like to do this via script.

Link to comment
Share on other sites

Hmm, looks like this doesn't work the same via script, there must be something else going on in the creation kit to make it display, so you'll have to find a workaround. You could cast a spell that has an explosion that has a placed object set maybe, or play an art object on an objectReference.

Link to comment
Share on other sites

I did some testing or tried too, I did not even get passed the render window in CK and test placing a decal, to assess it's behaviour,  I just switched CK off with what I found out.  If this was a this was a feasibility study, which for me it was, the recommendation is not to move forward with it. 

 

 

 

Link to comment
Share on other sites

Yeah, decals are kinda weird! I suspect what is going on in CK is that it doesn't actually place a texture as such - it places an odd 'spray can' like object, which then projects the textures. If, for example, you have a blood spray decal, you'll find it looks different every time the 'spray can' is loaded. However these can be moved, so what you may be able to do is create a utility cell with some of these 'spray cans' in, and use 'moveTo' to place them on say an xmarker you've positioned with 'placeatme'. Of course, you'll have to do some clean up, and possibly limit the number of your decals at any given time.

I haven't looked at it much, but you may also find something like the mechanism that creates Runes works for you, if you turn off the explosion of course! Also it seems there's a 'BloodDecalPlaceExplosion' in the resources, though as it doesn't seem to have been used, perhaps it was an experiment that hit a dead end.

Edited by dafydd99
Link to comment
Share on other sites

  • Recently Browsing   0 members

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