downloadstuff
Active member
- Joined
- Apr 4, 2015
- Messages
- 82
- Reaction score
- 0
Hello. I have created this thread because it is something a bit different and i should keep posting on the other topic.
Okay basically i want to print a message whenever someone i am targetting is looking at me.
Opcode.exe gave me this code but its not working, whenever i aim to a target, doesnt matter if i aim at him from behind or not.. i want that when i aim at a target that is looking in my direction (his camera position angle) to print a message, that simple.
code not working
this is the code as is, i have edited it but didnt work so i posted the code that opcode originally gave me.
this code when i aim at someone, always prints that he is looking at me.. even if he isnt
Okay basically i want to print a message whenever someone i am targetting is looking at me.
Opcode.exe gave me this code but its not working, whenever i aim to a target, doesnt matter if i aim at him from behind or not.. i want that when i aim at a target that is looking in my direction (his camera position angle) to print a message, that simple.
code not working
Code:
{$CLEO .cs}
{$INCLUDE SF}
0000: NOP
:randomshit
wait 0
IF
0AD2: 0@ = player $PLAYER_CHAR targeted_actor //IF and SET
THEN
Actor.StorePos($PLAYER_CHAR, 1@, 2@, 3@)
Actor.StorePos(0@, 4@, 5@, 6@)
0AB1: @getZAngleBetweenPoints 4 from_XY 4@ 5@ and_XY 1@ 2@ store_to 7@
// 7@ *= -1.0
8@ = Actor.Angle(0@)
0063: 8@ -= 7@ // (float)
IF or
8@ < 40.0
8@ > -40.0
then
end
END
jump @randomshit
:getYAngleBetweenPoints
{
Parameters:
Passed:
0@ - origin X
1@ - origin Y
2@ - origin Z
3@ - destination X
4@ - destination Y
5@ - destination Z
Result:
7@ - absolute Y angle
Example:
0AB1: call_scm_func @getYAngleBetweenPoints 6 from_XYZ 0.0 0.0 0.0 and_XYZ 1.0 0.0 0.0 store_to 1@
}
0509: 6@ = distance_between_XY 0@ 1@ and_XY 3@ 4@
0063: 2@ -= 5@
0604: get_Z_angle_for_point 6@ 2@ store_to 7@
0AB2: ret 1 7@
:getZAngleBetweenPoints
{
Parameters:
Passed:
0@ - origin X
1@ - origin Y
2@ - destination X
3@ - destination Y
Result:
4@ - absolute Z angle
Example:
0AB1: call_scm_func @getZAngleBetweenPoints 4 from_XY 0.0 0.0 and_XY 1.0 0.0 store_to 1@
}
0063: 0@ -= 2@
0063: 1@ -= 3@
0604: get_Z_angle_for_point 0@ 1@ store_to 4@
0AB2: ret 1 4@
this is the code as is, i have edited it but didnt work so i posted the code that opcode originally gave me.
this code when i aim at someone, always prints that he is looking at me.. even if he isnt