Squeekems
TH.net Regular
- Reaction score
- 11
I am trying to make an insanity manager system for a boss fight in my map.
I want it so that if the user's hero is facing the boss, their lumber (insanity) will rise. If they are looking away, however, I want it to decrease.
I tried matching the facing angle to the angle between two points, but they do not match up all the time. I'm having trouble figuring out how I could manipulate the values, to test if the hero is facing the boss, correctly. Any suggestions?
Here is some code to exemplify what I have figured out so far.
There are 8 players, so the for-loop loops through the 8 players.
Hero is a Unit variable.
Boss 0009 <gen> is the boss unit.
TempPoint and TempPoint2 are Point variables.
TempReal is a Real variable.
I want it so that if the user's hero is facing the boss, their lumber (insanity) will rise. If they are looking away, however, I want it to decrease.
I tried matching the facing angle to the angle between two points, but they do not match up all the time. I'm having trouble figuring out how I could manipulate the values, to test if the hero is facing the boss, correctly. Any suggestions?
Here is some code to exemplify what I have figured out so far.
There are 8 players, so the for-loop loops through the 8 players.
Hero is a Unit variable.
Boss 0009 <gen> is the boss unit.
TempPoint and TempPoint2 are Point variables.
TempReal is a Real variable.
Trigger:
- Manage Insanity
- Events
- Time - Every 1.00 seconds of game time
- Conditions
- Actions
- For each (Integer A) from 1 to 8, do (Actions)
- Loop - Actions
- Set TempPoint = (Position of Boss 0009 <gen>)
- Set TempPoint2 = (Position of Hero[(Integer A)])
- Set TempReal = (Angle from TempPoint to TempPoint2)
- Custom script: call RemoveLocation(udg_TempPoint)
- Custom script: call RemoveLocation(udg_TempPoint2)
- Game - Display to (Player group((Player((Integer A))))) the text: ((String((Facing of Hero[(Integer A)]))) + ( and + (String(TempReal))))
- Loop - Actions
- For each (Integer A) from 1 to 8, do (Actions)
- Events