Jump to content

[LE] TranslateToRef() & mesh's Texture big issue !


maxarturo

Recommended Posts

The issue is that i have some "Movable Statics" that they are "TranslateToRef()", before the translation begins everything is normal, but when translation starts and to the point that stops & after the mesh + mesh's textures STOPS receiving light from light sources (omidirectional lights), they only receive light from the "Lighting Template" directional and ambient lighting.


I've been trying to solve this the last 3 days directly throught editing the mesh itself (changing any possible options in NifSkope) but nothing seems to work, unless i'm missing something !!!.


The cell is very dark, so the visual of seeing the platforms raising and lowering is the whole point here.

* I've a few workarounds, like disable/enable the mesh when the translation is done, or replacing the translated to a static pre disable, but i lose the realistic approach, especially if the player is staring at the platforms, the swap is a little noticeable...

But if there isn't any other solution to this, then i'll have to stick with this workaround.


If anyone knows how to fix this issue i would be more than grateful !!!..


Thank you very much for reading this and Merry Christmas!.

Edited by maxarturo
Link to comment
Share on other sites

  • 2 weeks later...

I only just noticed this post.

By 'movable statics', i guess you're meaning static objects that are translated/rotated by a script?

Talking about platforms raising and lowering brought to mind a script I happilly adopted for a lift in a personal mod. The lift was a static ( A dwemer platform, if I recall, rightly). It was raised and lowered by a lever, the player got onto it and it played fragments of music from 'In the hall of the mountain king' whilst it went up and down. The script was by Darkfox127, who kindly let anyone use it.

I did not get any lighting issues whatsoever, though I confess that the lighting template was a standard dwarven one. I can't think of the link at the moment, but could supply it if you like. I could also dig back into the mod I used it in... a long time back, I've forgotten details.


Scriptname PM_Script_TranslateObject extends ObjectReference
{Move a static object to specified coordinates in a cell or to the location of another reference.}


;PLEASE KEEP THIS CREDIT LNE IN YOUR SCRIPT IF USED
;Original universal script created by Darkfox127
;Any potential problems which may arise from this script being changed from the original are the sole responsibility of the mod author making the changes.


Bool Property MoveToRef = True Auto
{Sets the type of translation. True will translate the object to a reference, wheereas false will translate to specific coordiantes.

Default = True}

Float Property PosX1 Auto
{One of the position variables for the translation}
Float Property PosY1 Auto
{One of the position variables for the translation}
Float Property PosZ1 Auto
{One of the position variables for the translation}
Float Property RotX1 Auto
{One of the rotation variables for the translation}
Float Property RotY1 Auto
{One of the rotation variables for the translation}
Float Property RotZ1 Auto
{One of the rotation variables for the translation}

Float Property PosX2 Auto
{One of the position variables for the translation}
Float Property PosY2 Auto
{One of the position variables for the translation}
Float Property PosZ2 Auto
{One of the position variables for the translation}
Float Property RotX2 Auto
{One of the rotation variables for the translation}
Float Property RotY2 Auto
{One of the rotation variables for the translation}
Float Property RotZ2 Auto
{One of the rotation variables for the translation}

Float Property RotationVal Auto
{The amount you want to rotate the object by.}

Float Property SpeedVal Auto
{The speed you want the object to be moved.}

Float Property Time Auto
{The amount of seconds until the object reaches its target.

This must be accurate as not to affect the state check for if the object is currently moving.}

GlobalVariable Property StateGlobal Auto
{The global for the current state that the object is in.

Useful for creating things like lifts with multiple activator buttons.}

ObjectReference Property TranslateRef Auto
{The object to move.

Must have the correct NIF settings and be a moveable static.}

ObjectReference Property LocationRef Auto
{The reference to move your object to.

This can be a copy of the object you have or an xmarker sitting in the relevant coordinates.}

Sound Property SFX Auto
{The sound effect to play while the object is moving.

This should be a looping sound that the script will stop after the speicifed time has elapsed.}

Sound Property SFX_End Auto
{The sound effect to play at the end of the object's translation.}

String Property BUSYMSG Auto
{The notification to show ifthe object is currently moving.}



Event OnInit()

GoToState("Stationary")

EndEvent



State Stationary ; The object is currently not moving and translation can be started.

Event OnActivate(ObjectReference akActionRef)

If MoveToRef == True

;debug.notification("Movement Started - 1")
If StateGlobal.GetValue() == 0
;debug.notification("Position One")
GoToState("Moving")
StateGlobal.SetValue(1)
Int SoundInstance = SFX.Play(Self)
TranslateRef.TranslateToRef(LocationRef, SpeedVal, RotationVal)
Utility.Wait(Time)
Sound.StopInstance(SoundInstance)
Utility.Wait(0.2)
SFX_End.Play(Self)
GoToState("Stationary")
Else
;debug.notification("Position Two")
GoToState("Moving")
StateGlobal.SetValue(0)
Int SoundInstance = SFX.Play(Self)
TranslateRef.TranslateTo(PosX1, PosY1, posZ1, RotX1, RotY1, RotZ1, SpeedVal, RotationVal)
Utility.Wait(Time)
Sound.StopInstance(SoundInstance)
Utility.Wait(0.2)
SFX_End.Play(Self)
GoToState("Stationary")
EndIf

Else

;debug.notification("Movement Started - 2")
If StateGlobal.GetValue() == 0
;debug.notification("Position One")
GoToState("Moving")
StateGlobal.SetValue(1)
Int SoundInstance = SFX.Play(Self)
TranslateRef.TranslateTo(PosX2, PosY2, posZ2, RotX2, RotY2, RotZ2, SpeedVal, RotationVal)
Utility.Wait(Time)
Sound.StopInstance(SoundInstance)
Utility.Wait(0.2)
SFX_End.Play(Self)
GoToState("Stationary")
Else
;debug.notification("Position Two")
GoToState("Moving")
StateGlobal.SetValue(0)
Int SoundInstance = SFX.Play(Self)
TranslateRef.TranslateTo(PosX1, PosY1, posZ1, RotX1, RotY1, RotZ1, SpeedVal, RotationVal)
Utility.Wait(Time)
Sound.StopInstance(SoundInstance)
Utility.Wait(0.2)
SFX_End.Play(Self)
GoToState("Stationary")
EndIf

EndIf

EndEvent

EndState



State Moving ; The object is currently moving and translation cannot yet be started.

Event OnActivate(ObjectReference akActionRef)

debug.notification(BUSYMSG)
Return

EndEvent

EndState

 

 

He did a video on it, explaining the idea and script. Maybe there are some clues in there. Any use?

Link to comment
Share on other sites

Thanks for trying to help.


But, the issue is not scripting, i don't really need help in this department + my script is way more sophisticated and complex than of the YouTuber.


And i do mean "Movable Static", "static meshes" can be translated but their collision can not, so you need to use "Movable Static" in order to be able to move its collision.


After a lot of testing and experimentation i concluded that:

This issue of meshes that they are been "TranslateToRef()" stop receiving light from light sources, is a game engine and bad coding from Bethesda part (one more in the list of the countless i have found).


I don't watch tutorials, they have absolutely nothing to offer me, those youtube tutorials are targeted at newbies and beginners.

Although, i did watch that particular video you are referring to four days ago (was pointed out to me by another modder here in Nexus), just in case i did missed something or that particular youtuber had some info on this, but NO !.


If you watch carefully that video even though it has a very bright "Lighting Template" on the cell, there is a light source casting on the Animated mesh and the mesh DOES NOT receives light from it or it does shows any light fluctuation whatsoever.


Nevertheless, i did manage to find a solution to this, but requires three different components to work together to end up with a realistic result, it is actually so good that even thought i know where the issue lies i can not distinguish it or see it at all anymore.


Thanks for showing interest in this !.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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