Difference between revisions of "Questions"
Jump to navigation
Jump to search
no edit summary
imported>DragoonWraith (→Using Scripts To Add Object and Raising it: or MoveTo) |
imported>Treleth |
||
Line 1,102: | Line 1,102: | ||
MoveTo (object ID or ref var) 0 0 10 | MoveTo (object ID or ref var) 0 0 10 | ||
::The Wiki recommends [[MoveTo]] over [[SetPos]]. Not entirely sure why, but in this case, the code is shorter with [[MoveTo]]. | ::The Wiki recommends [[MoveTo]] over [[SetPos]]. Not entirely sure why, but in this case, the code is shorter with [[MoveTo]]. | ||
I forgot to mention before that I was indeed using setpos z, zposition. I tried both methods and they both didn't work, my tent was still halfway in the ground, see anything wrong with this code? or you can just remove the + 10 and add tent.moveto tent 0 0 10 | |||
<pre> | |||
scn PTTentUnpack | |||
float xangle | |||
float yangle | |||
float zangle | |||
float xposition | |||
float yposition | |||
short zposition | |||
ref tent | |||
begin OnActivate | |||
if GetInWorldspace Tamriel == 1 | |||
if player.IsSneaking == 0 | |||
set xangle to GetAngle X | |||
set yangle to GetAngle Y | |||
set zangle to GetAngle Z | |||
set xposition to GetPos X | |||
set yposition to GetPos Y | |||
set zposition to GetPos Z + 10 | |||
set tent to placeatme PTTentExterior, 1, 10, 1 | |||
tent.SetAngle x, xangle | |||
tent.SetAngle y, yangle | |||
tent.SetAngle z, zangle | |||
tent.SetPos x, xposition | |||
tent.SetPos y, yposition | |||
tent.SetPos z, zposition | |||
disable | |||
else | |||
player.AddItem "PTTentMaterials" 1 | |||
Disable | |||
Return | |||
endif | |||
endif | |||
endif | |||
end | |||
</pre> | |||
[[User:Treleth|Treleth]] 13:13, 7 July 2006 (EDT) |