Detecting the direction of an object?

Post » Thu May 19, 2011 6:22 am

I can't seem to figure out how to detect which direction an object is facing on the Y-Axis.

I've been working with a script that boils down to this:

scn scriptnameref YAngleBegin GameMode	set YAngle to GetAngle y	if (YAngle <= 135) && (YAngle >= 45)		set MinAlessiaDirection to 0	elseif (YAngle <= 45) && (YAngle >= -45)		set MinAlessiaDirection to 0	elseif (YAngle <= 135) && (YAngle >= -45)		set MinAlessiaDirection to 1	elseif (YAngle <= 135) && (YAngle >= -135)		set MinAlessiaDirection to 0	endifEnd

* "MinAlessiaDirection" is a global ref.

So I'm wanting a reference to be set to 1 when my activator object is facing at around -90, but it doesn't appear to be working. I have an object that I am rotating by 90 degrees with a switch, it's starting position is (0, 0, -180) so it's never facing 135, -135, 45, or -45 evenly. What am I doing wrong? Is there a different way completely to do this?


Also, on a separate note, I've been trying to get custom combat dialogue for an NPC that I can't seem to get working. This NPC is 100 priority and is using a custom race, which is set to playable, and the related quest is using GetIsPlayableRace as the condition. The conditions for each specific line of dialogue are "GetIsID NPCid == 1" and "GetIsID Player == 0"
These dialogue options are under "Attack" and "Hit"
I have the voice files in the correct folder with the correct name and in the correct format, but in combat, my NPC uses only the default dialogue and never my custom dialogue.

These are the only issues standing between me and releasing my mod, so here's hoping I can get answers here!
User avatar
Horror- Puppe
 
Posts: 3376
Joined: Fri Apr 13, 2007 11:09 am

Return to IV - Oblivion