antstubell Posted May 1, 2021 Share Posted May 1, 2021 I am attempting to raise a plane of lava DweSpecialForgeLava01. The object is a static. When I use TranslateTo for my other moving objects I alter the collision of the object in Nifskope to make it moveable. This static has no collision and I haven't found a way to add collision without getting errors in Niksskope, so I decided the onlt other way to move it is with MoveTo and While.The script compiles fine until I add the line LavaPlane.MoveTo(Xpos, Ypos, Zpos)Error: (19,10): type mismatch on parameter 1 (did you forget a cast?)Any other advice on scripting this also welcome. GlobalVariable Property ZLevel AutoFloat Property ZLevelToMoveTo AutoGlobalVariable Property SMTgv_LavaLevel AutoObjectReference Property LavaPlane AutoEvent OnActivate(ObjectReference akActionRef)Float Zpos = LavaPlane.GetPositionZ(); get object Z positionFloat Ypos = LavaPlane.GetPositionY(); get object Y positionFloat Xpos = LavaPlane.GetPositionX(); get object X positionWhile Zpos < ZLevelToMoveToDebug.Notification("Moving Up "); MathZpos = Zpos + 1Debug.Notification("Lava Level is " + LavaPlane.GetPositionZ())LavaPlane.MoveTo(Xpos, Ypos, Zpos)Utility.Wait(5)EndWhileDebug.Notification("Done")EndEvent Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 1, 2021 Share Posted May 1, 2021 You are missing the first parameter of the MoveTo function. You need to enter the target object in which to move the LavaPlane. The X,Y,Z coordinates are relative to that object reference. So if you have a neighboring object that you do move with TranslateTo, move this stubborn object with MoveTo to that neighboring object and set up the X,Y,Z coordinates so that it will end up in the correct position. Link to comment Share on other sites More sharing options...
antstubell Posted May 2, 2021 Author Share Posted May 2, 2021 I don't get it. In other scripts where I use MoveTo, I use a xmarker for the x, y, z co-ordinates, Such as MyObject.MoveTo(MyMarker). This is fine for moving objects while player isn't looking - I use it to move an object back to its starting position after a TranslateTo has moved it. The first parameter is ObjectReference akTarget. That would be the xmarker when using a xmarker so what is it when I using co-ordinates that change as in the script I posted? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 2, 2021 Share Posted May 2, 2021 This is the line you have: LavaPlane.MoveTo(Xpos, Ypos, Zpos) It is missing the first parameter which should be an object reference. The Papyrus Compiler cannot use a float value as an object reference. This is why it is complaining and not compiling. Link to comment Share on other sites More sharing options...
antstubell Posted May 3, 2021 Author Share Posted May 3, 2021 The script increments the Zpos by 1 say 100 times, so you're saying I need 100 objects as references? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 3, 2021 Share Posted May 3, 2021 Possibly. Or a separate object (possibly invisible) that the TranslateTo works on. Move that with the TranslateTo and then use MoveTo to move this object to that object. Link to comment Share on other sites More sharing options...
antstubell Posted May 4, 2021 Author Share Posted May 4, 2021 (edited) Possibly. Or a separate object (possibly invisible) that the TranslateTo works on. Move that with the TranslateTo and then use MoveTo to move this object to that object.No offence dude but you cold have said that at the beginning.Thanks. EDIT:All said and done can't get the lava object to move. Might need to give up on this. Final script attempt... Float Property PosX1 AutoFloat Property PosY1 AutoFloat Property PosZ1 AutoFloat Property RotX1 AutoFloat Property RotY1 AutoFloat Property RotZ1 Auto Float Property RotationVal AutoFloat Property SpeedVal AutoFloat Property Time AutoFloat Property Delay AutoObjectReference Property ObjToTranslate Auto; translatable objectObjectReference Property SndMarker AutoObjectReference Property BlockActivator AutoObjectReference Property PostMovEn AutoObjectReference Property PreMovDis AutoObjectReference Property ObjToMove Auto; object to move to translated object positionSound Property SFX AutoString Property BUSYMSG AutoString Property DoneMsg Auto Bool Property SelDel Auto Event OnActivate(ObjectReference akActionRef) Int SoundInstance = SFX.Play(SndMarker)BlockActivator.Enable()Utility.Wait(Delay); some sfx have a start up soundPreMovDis.Disable()ObjToTranslate.TranslateTo(PosX1, PosY1, PosZ1, RotX1, RotY1, RotZ1, SpeedVal, RotationVal) ; Move the non-translatable object with MoveToFloat ZposOfTransObj = ObjToTranslate.GetPositionZ(); get translating object Z positionWhile ZposOfTransObj < PosZ1ZposOfTransObj = ZposOfTransObj + 1ObjToMove.MoveTo(ObjToTranslate)Debug.Notification("Lava Level is " + ObjToMove.GetPositionZ())EndWhile If SelDel == TrueSelf.Delete()EndIfUtility.Wait(Time)PostMovEn.Enable()debug.notification(DoneMsg) EndEvent Edited May 4, 2021 by antstubell Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 4, 2021 Share Posted May 4, 2021 Re-read my first reply. I did state you might need to move one object with TranslateTo and then this object to that object with MoveTo. But whatever... Is the object you are trying to move persistent in some way? Persistence tends to prevent movement of objects. If you can or have not, test on a game that has not seen the mod at all. Just to rule out save game oddities. Can you create a different type of object that you can use TranslateTo with and give it the appearance of this rather stubborn object? As a last resort... Link to comment Share on other sites More sharing options...
AnishaDawn Posted May 23, 2021 Share Posted May 23, 2021 When in doubt, turn the object into an activator. All movement functions work on those, though the collision updating is a different matter.. but still useful if collision isn't a concern. Link to comment Share on other sites More sharing options...
Recommended Posts