Difference between revisions of "Talk:SetPos"

1,439 bytes added ,  23:06, 25 February 2007
no edit summary
imported>JOG
imported>The Munchkin Lord
Line 17: Line 17:


:::Well, it's implicit that only those things work that are specified as working, when we find out something that wasn't mentioned before we add it, but there is no point in adding info to random functions that things from other programming languages don't work here. There are no arrays, no sub-procedures, no default values on variable definition, no control structures besides if, and so on...--[[User:JOG|JOG]] 15:33, 13 June 2006 (EDT)
:::Well, it's implicit that only those things work that are specified as working, when we find out something that wasn't mentioned before we add it, but there is no point in adding info to random functions that things from other programming languages don't work here. There are no arrays, no sub-procedures, no default values on variable definition, no control structures besides if, and so on...--[[User:JOG|JOG]] 15:33, 13 June 2006 (EDT)
If you're having a problem getting light to shed properly after updating its position using SetPos, here is a solution using a combination of MoveTo, SetPos, a persistent Light Form, and a Dummy Cell:
<pre>Begin GameMode
  PersistentLightReference.PositionCell 0 0 0 0 DummyCell
  ; Using PositionCell because SetAtStart did not work,
  ; though using a Marker in conjunction with MoveTo might- didn't test
  PersistentLightReference.Disable
  PersistentLightReference.MoveTo Player
  Set PlayerPosX to Player.GetPos X
  Set PlayerPosY to Player.GetPos Y
  Set PlayerPosZ to Player.GetPos Z
  PersistentLightReference.SetPos X PlayerPosX
  PersistentLightReference.SetPos Y PlayerPosY
  PersistentLightReference.SetPos Z PlayerPosZ
  PersistentLightReference.Enable
End</pre>
You could conceivably use another MoveTo in conjunction with a Marker instead of PositionCell, but method is simpler.
This is just the core of the solution, of course. You'll have to declare the Floats PlayerPosX/Y/Z, place a persistent Light, make a Dummy Cell to move to and from, and replace any references or set up any conditionals in the GameMode block that you need for your particular application. For those of you who are still confused, the exact implementation is included in my [http://www.elderscrolls.com/forums/index.php?showtopic=642521 Wieldable Torches] mod.--[[User:The Munchkin Lord|The Munchkin Lord]] 23:06, 25 February 2007 (EST)