Elias555 Posted November 21, 2018 Author Share Posted November 21, 2018 (edited) I do though. It needs to be activateable at any point in the descent. Even if I make a swap when it gets to the position, that will cause the orientation(I did add true at the end ofEndPoint) to change and the swap will be visible. Edit:Something strange is going on. I CAN activate the object but the activation is not where it was placed or ends up, it's in the initial MoveTo position. Edited November 21, 2018 by Elias555 Link to comment Share on other sites More sharing options...
NexusComa Posted November 21, 2018 Share Posted November 21, 2018 Did you SetPositon() on everything before and after ,,, Link to comment Share on other sites More sharing options...
Elias555 Posted November 21, 2018 Author Share Posted November 21, 2018 (edited) Not sure what you mean. This is my entire code. I still have to clean things up at the end. Activator Property MyActivator Auto Activator Property xMarkerActivator Auto Potion Property Stew Auto Event OnEffectStart(Actor akTarget, Actor akCaster) ObjectReference EndPoint = akCaster.Placeatme(xMarkerActivator) EndPoint.MoveTo(akCaster, 120.0 * Math.Sin(akCaster.GetAngleZ()), 120.0 * Math.Cos(akCaster.GetAngleZ()), akCaster.GetHeight() - 50.0, true) ObjectReference MyStew = akCaster.Placeatme(MyActivator) MyStew.MoveTo(akCaster, 120.0 * Math.Sin(akCaster.GetAngleZ()), 120.0 * Math.Cos(akCaster.GetAngleZ()), akCaster.GetHeight() + 335.0, true) Utility.Wait(0.5) MyStew.TranslateToRef(EndPoint, 45) EndEvent Can I use Event OnTranslationComplete() to make a MoveTo or something from another event? Edited November 21, 2018 by Elias555 Link to comment Share on other sites More sharing options...
NexusComa Posted November 21, 2018 Share Posted November 21, 2018 ObjectReference EndPoint = akCaster.Placeatme(xMarkerActivator) EndPoint.MoveTo(akCaster, 120.0 * Math.Sin(akCaster.GetAngleZ()), 120.0 * Math.Cos(akCaster.GetAngleZ()), akCaster.GetHeight() - 50.0, true) EndPoint.SetPosition(120.0 * Math.Sin(akCaster.GetAngleZ()), 120.0 * Math.Cos(akCaster.GetAngleZ()), akCaster.GetHeight() - 50.0) ObjectReference MyStew = akCaster.Placeatme(MyActivator) MyStew.MoveTo(akCaster, 120.0 * Math.Sin(akCaster.GetAngleZ()), 120.0 * Math.Cos(akCaster.GetAngleZ()), akCaster.GetHeight() + 335.0, true) MyStew.SetPosition(120.0 * Math.Sin(akCaster.GetAngleZ()), 120.0 * Math.Cos(akCaster.GetAngleZ()), akCaster.GetHeight() + 335.0) Utility.Wait(0.5) MyStew.TranslateToRef(EndPoint, 45) Not sure if that is 100% right as far as where they are with all that realtime math in the xyz ... I just know you need to use SetPosition() with TranslateToRef(). The SetPosition() is NOT moving anything it is for the TranslateToRef() so you don't get Something strange is going on Link to comment Share on other sites More sharing options...
Elias555 Posted November 21, 2018 Author Share Posted November 21, 2018 I did try something like that during my testing but using setposition didn't place anything as far as I could see. I tried using getposXYZ and that didn't work either. But here's what worked.Hopefully someone will find this useful one day. Scriptname _AceTestScript extends ActiveMagicEffect Activator Property MyActivator Auto Activator Property xMarkerActivator Auto Activator Property RealStew Auto Explosion Property MyExplosion Auto ObjectReference EndPoint ObjectReference MyStew ObjectReference NewStew Event OnEffectStart(Actor akTarget, Actor akCaster) EndPoint = akCaster.Placeatme(xMarkerActivator) EndPoint.MoveTo(akCaster, 120.0 * Math.Sin(akCaster.GetAngleZ()), 120.0 * Math.Cos(akCaster.GetAngleZ()), akCaster.GetHeight() - 50.0) EndPoint.SetAngle(0.0, 0.0, 0.0) MyStew = akCaster.Placeatme(MyActivator) MyStew.MoveTo(akCaster, 120.0 * Math.Sin(akCaster.GetAngleZ()), 120.0 * Math.Cos(akCaster.GetAngleZ()), akCaster.GetHeight() + 335.0) MyStew.SetAngle(0.0, 0.0, 0.0) Utility.Wait(0.5) MyStew.TranslateToRef(EndPoint, 165) RegisterForSingleUpdate(0.3) EndEvent Event OnUpdate() If MyStew.GetPositionZ() == EndPoint.GetPositionZ() NewStew = EndPoint.Placeatme(RealStew) Utility.Wait(0.5) MyStew.Disable() MyStew.Delete() EndPoint.Disable() EndPoint.Delete() ElseIf MyStew.GetPositionZ() != EndPoint.GetPositionZ() RegisterForSingleUpdate(0.3) EndIf EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) NewStew.PlaceAtMe(MyExplosion) Utility.Wait(0.2) NewStew.Disable() NewStew.Delete() MyStew.Disable() MyStew.Delete() EndPoint.Disable() EndPoint.Delete() EndEvent Sometimes MyStew doesn't get disabled and NewStew isn't created. Not sure why though. Everything else is fine. Link to comment Share on other sites More sharing options...
NexusComa Posted November 21, 2018 Share Posted November 21, 2018 ... I told you SetPosition() will not move anything it is an internal thing for TranslateRef() possibly doing an update. Link to comment Share on other sites More sharing options...
Elias555 Posted November 21, 2018 Author Share Posted November 21, 2018 (edited) So it communicates the position to TranslateRef? I see.I tried your code above and once again nothing was visible. Edit: Made a few changes and this placed it and moved correctly but once again the 'activator' was in the position of moveto and not with the nif. Event OnEffectStart(Actor akTarget, Actor akCaster) ObjectReference EndPoint = akCaster.Placeatme(xMarkerActivator) EndPoint.MoveTo(akCaster, 120.0 * Math.Sin(akCaster.GetAngleZ()), 120.0 * Math.Cos(akCaster.GetAngleZ()), akCaster.GetHeight() - 50.0, true) ObjectReference MyStew = akCaster.Placeatme(MyActivator) MyStew.SetPosition(120.0 * Math.Sin(akCaster.GetAngleZ()), 120.0 * Math.Cos(akCaster.GetAngleZ()), akCaster.GetHeight() + 335.0) MyStew.MoveTo(akCaster, 120.0 * Math.Sin(akCaster.GetAngleZ()), 120.0 * Math.Cos(akCaster.GetAngleZ()), akCaster.GetHeight() + 335.0, true) Utility.Wait(0.5) MyStew.TranslateToRef(EndPoint, 45) EndEvent Edited November 21, 2018 by Elias555 Link to comment Share on other sites More sharing options...
NexusComa Posted November 21, 2018 Share Posted November 21, 2018 Ya I didn't think that would work just showing you how you use it. The 1st example I posted works fine with one of my mods.But I did know my coordinates and wasn't using math to figure them out in realtime. It would go under the moveto call.Also I'm not testing code I post more just pointing at something that worked for me. Link to comment Share on other sites More sharing options...
ReDragon2013 Posted November 22, 2018 Share Posted November 22, 2018 (edited) No idea, what are you doing here exactly. Activator PROPERTY FakeStewForm auto ; your created ".nif" as floating stew Static PROPERTY xMarkerForm auto ; baseobject of xMarker Explosion PROPERTY theExplosion auto ; an explosion you like to see Potion PROPERTY Stew auto ; baseobject of stew objectReference endMarker objectReference myStew objectReference realStew EVENT OnEffectStart(Actor akTarget, Actor akCaster) Debug.Trace("OnEffectStart() - target = " +akTarget+ ", caster = " +akCaster+ " " +self) ; info only myF_PlaceObjects(akCaster) Utility.Wait(0.5) myStew.TranslateToRef(endMarker, 45.0, 0.0) ; 165.0 afSpeed=45.0, afMaxRotationSpeed=0.0 ENDEVENT ;---------------------------------------- FUNCTION myF_PlaceObjects(Actor akCaster) ; moveTo ;---------------------------------------- float fz = akCaster.GetHeight() ; store it float aZ = akCaster.GetAngleZ() ; store it float fx = Math.Sin(aZ) * 120.0 float fy = Math.Cos(aZ) * 120.0 endMarker = akCaster.PlaceAtMe(xMarkerForm, 1, False, TRUE) ; create new xmarker object (disabled) endMarker.MoveTo(akCaster, fx, fy, fz - 50.0) myStew = akCaster.PlaceAtMe(FakeStewForm) ; create new stew object myStew.MoveTo(akCaster, fx, fy, fz + 335.0) ENDFUNCTION ;---------------------------------------- FUNCTION myF_PlaceObjects2(Actor akCaster) ; setPos alternative code ;---------------------------------------- float fz = akCaster.GetHeight() ; store it float aZ = akCaster.GetAngleZ() ; store it float fx = Math.Sin(aZ) * 120.0 float fy = Math.Cos(aZ) * 120.0 fx+= akCaster.GetPositionX() fy+= akCaster.GetPositionY() fz+= akCaster.GetPositionZ() endMarker = akCaster.PlaceAtMe(xMarkerForm, 1, False, TRUE) ; create new xmarker object endMarker.SetPosition(fx, fy, fz - 50.0) endMarker.SetAngle(0, 0, aZ) myStew = akCaster.PlaceAtMe(FakeStewForm) ; create new stew object myStew.SetPosition(fx, fy, fz + 335.0) myStew.SetAngle(0, 0, aZ) ENDFUNCTIONlinks to wiki: https://www.creationkit.com/index.php?title=PlaceAtMe_-_ObjectReference , https://www.creationkit.com/index.php?title=TranslateToRef_-_ObjectReference and just for safety: myStew.Disable() myStew.Delete() myStew = Nonethere exist two events, you are should looking for EVENT OnTranslationFailed() ; received when translation is aborted (from a call to StopTranslateTo) myF_CleanUp() ENDEVENT EVENT OnTranslationComplete() ; received when translation is complete (from a call to TranslateTo) ; myStew received the endMarker myF_Update() ; update fakeStew by realStew myF_CleanUp() ; cleaning all Refs ENDEVENTThe problem is, you have to create surely a second script of type objectReference which is attached to object myStew because I think both events won't be triggered within your ActiveMagicEffect script. Edited November 22, 2018 by ReDragon2013 Link to comment Share on other sites More sharing options...
Elias555 Posted November 22, 2018 Author Share Posted November 22, 2018 That had the same problem as the updated script from page one but I appreciate the effort. The script above(comment 15) works well with 1 exception. When the player is standing in the way of the fake activator it doesn't get swapped with the real activator. Not sure how to fix that other than preventing the player from moving which I don't want to do. Link to comment Share on other sites More sharing options...
Recommended Posts