slasham Posted October 21, 2015 Share Posted October 21, 2015 Hi, Just wondering if anybody could help me with my script. I'm trying to make a boat rotate when its steering wheel is activated. I've had a few errors and managed to get rid of most of them but can't seem to get rid of this last pesky error.The error is (...)+ loop did not match anything at input 'native' If you could explain what the error means then this would also be greatly appreciated for next time.My current code is as follows: Scriptname BoatRight extends ObjectReference Event OnActivate(ObjectReference akActionRef) Debug.MessageBox("Turn Right") ThisObject.TranslateTo(ThisObject.GetPositionX, ThisObject.GetPositionY,ThisObject.GetPositionZ,ThisObject.GetAngleX + 10, ThisObject.GetAngleY, ThisObject.GetAngleZ, 100.0, 0.0) native endEvent Thanks in advance,Slasham. Link to comment Share on other sites More sharing options...
slasham Posted October 21, 2015 Author Share Posted October 21, 2015 Fixed it now. Turned out I didn't put "()" at the end of the functions I called *Facepalm* Link to comment Share on other sites More sharing options...
sLoPpYdOtBiGhOlE Posted October 21, 2015 Share Posted October 21, 2015 Few probs I see there. GetPosition needs parenthesis. eg: GetPositionX(), GetPositionY(), GetPositionZ() Also there is no ThisObject declared in your script. If your wanting to check the object the script is attached to then use Self. eg:Scriptname BoatRight extends ObjectReference Event OnActivate(ObjectReference akActionRef) Debug.MessageBox("Turn Right") Self.TranslateTo(Self.GetPositionX(), Self.GetPositionY(), Self.GetPositionZ(), Self.GetAngleX() + 10, Self.GetAngleY(), Self.GetAngleZ(), 100.0, 0.0) endEvent Or You can even omit self altogether and just use the function and it will treat it as self. eg:Scriptname BoatRight extends ObjectReference Event OnActivate(ObjectReference akActionRef) Debug.MessageBox("Turn Right") TranslateTo(GetPositionX(), GetPositionY(),GetPositionZ(),GetAngleX() + 10, GetAngleY(), GetAngleZ(), 100.0, 0.0) endEvent Link to comment Share on other sites More sharing options...
Recommended Posts