[VScript] How do i use functions that use QAngles?

vtf

L1: Registered
Sep 26, 2021
16
0
Hi, looking through the list of TF2 script functions in the VDC, i see that "GetAngles" is deprecated and telling you to use "GetAbsAngles" instead. However, GetAbsAngles uses QAngles, which i have no idea how to use. I did find some documentation about QAngles, under "Data Types", still no idea. I think i am too stupid to understand the concept of it.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,258
999

vtf

L1: Registered
Sep 26, 2021
16
0
I specified in my post that i looked at the documentation of QAngles under "Data Types", i tried "activator.SetAbsAngles(0, -180, 0)" as in the documentation it says "QAngle(QAngle(float pitch, float yaw, float roll)" The function:
Code:
function modifyAngle()
{
  activator.SetAbsAngles(0, -180, 0)
}

Spits out the error:
Code:
AN ERROR HAS OCCURED [wrong number of parameters]

CALLSTACK
*FUNCTION [modifyAngle()] ok.nut line [99]
*FUNCTION [main()] InputRunScript line [1]

LOCALS
[this] TABLE
[vargv] ARRAY
[this] TABLE
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,258
999
I'm sorry, I thought you meant the dedicated page on QAngle on the SDK wiki.

This function can't take values directly; you have to put them in a QAngle variable and supply that as the argument in the function.

I haven't done much work with Squirrel yet but I imagine it would be along these lines:
JavaScript:
QAngle angles = QAngle(0.0, -180.0, 0.0)

entity.SetAbsAngles(angles)
 

vtf

L1: Registered
Sep 26, 2021
16
0
I've tried it, but returns "end of statement expected (; or lf). I tried puttin the QAngle outside of a function, the same. Typing " QAngle (name)" itself gives the same error. I guess the documentation for squirrel is shitty