Would Appreciate Some Help (with using GetAngleHeading)

Post » Thu Jul 07, 2016 7:26 am

Hi.



I'm stuck on a problem trying to get one of the example scripts on the creation kit wiki to actually work.



The example script is the one used on the page for GetHeadingAngle, namely the one here:



The example script says:



; Have the statue face the player

float zOffset = Statue.GetHeadingAngle(Game.GetPlayer())

Statue.SetAngle(Statue.GetAngleX(), Statue.GetAngleY(), Statue.GetAngleZ() + zOffset)

I made an object reference script that's attached to a dwemer lever activator, and in place of the property "statue" I made my own property called "ALLSEEINGHEAD"



Scriptname AAAHEADANGLESCRIPT extends ObjectReference


ObjectReference Property ALLSEEINGHEAD Auto


Event OnActivate(ObjectReference akActionRef)

float zOffset = ALLSEEINGHEAD.GetHeadingAngle(Game.GetPlayer())

ALLSEEINGHEAD.SetAngle(ALLSEEINGHEAD.GetAngleX(), ALLSEEINGHEAD.GetAngleY(), ALLSEEINGHEAD.GetAngleZ() + zOffset)

EndEvent

This script compiled, and I made sure to fill in the properties list. There is a dwemer centurion bust in the room where I have multiple levers which all have this script attached to them; it is called "000THEALLSEEINGHEAD", and I made sure that each lever had its script's "ALLSEEINGHEAD" property filled to that reference.



But even though I did this, and the script compiled correctly, the head would not rotate whenever any of the levers were thrown.



I then rewrote the script in a broken-down format to try to figure out what was going on.



Scriptname AAAHEADANGLESCRIPT extends ObjectReference


ObjectReference Property ALLSEEINGHEAD Auto

Event OnActivate(ObjectReference akActionRef)

float zOffset = ALLSEEINGHEAD.GetHeadingAngle(Game.GetPlayer())
float headX = ALLSEEINGHEAD.GetAngleX()
float headY = ALLSEEINGHEAD.GetAngleY()
float headZ = ALLSEEINGHEAD.GetAngleZ()
float headZfinal = (headZ + zOffset)

ALLSEEINGHEAD.SetAngle(headX, headY, headZfinal)

EndEvent

Once again, the script compiled, I filled out the property, but again, when in game, the head did not move when the levers were thrown.



Can someone please assist me with this? I'd rather like to figure out how to get this script to work.

User avatar
Elea Rossi
 
Posts: 3554
Joined: Tue Mar 27, 2007 1:39 am

Post » Thu Jul 07, 2016 1:03 pm

assuming that your script is correct (sorry did not anolyze it as I am on a quick break at work) you should do this to test:




Scriptname AAAHEADANGLESCRIPT extends ObjectReference



ObjectReference Property ALLSEEINGHEAD Auto


Event OnActivate(ObjectReference akActionRef)


ALLSEEINGHEAD.SetAngle(ALLSEEINGHEAD.GetAngleX() + 20 , ALLSEEINGHEAD.GetAngleY() + 20, ALLSEEINGHEAD.GetAngleZ() + 20)


EndEvent




...just to see if the ALLSEEINGHEAD moves at all!



If it doesn't move then you know something is wrong with your properties or reference.

User avatar
Georgine Lee
 
Posts: 3353
Joined: Wed Oct 04, 2006 11:50 am


Return to V - Skyrim