AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   *Rotating* Player models. (https://forums.alliedmods.net/showthread.php?t=10943)

TotalNoobScripter 03-05-2005 16:33

*Rotating* Player models.
 
I have this ts map called ts_realitivity, which is based on that one painting where rooms are dis-oriented, such asyou can be walking normaly in one room, go thru a oddly-positioned door, and then your walking on the celing of a room. There are also chairs mounted to sides of walls, and if you spin your mouse around really quick, you have no idea which wall you are standing on :D :D :D

Anyways, how would you rotate a players model, so that instead of walking like this...
Code:

--------------------
|                |
|        XXX    |
|        \X/    |
|        /X\    |
--------------------

^^ My ghetto screen, where the X's are the player orientation
*Dont blame me for my ghetto ASCII art, thats a guy with a head, body, arms and leg.)

to this
Code:

--------------------
|                  |
|\  / X          |
|X X  X            |
|/  \ X          |
--------------------

^^ more ghetto screen action. This time it is as if the player is walking on the left wall...

I'd imagine you could do this by setting some vectors, or stuff of the like, but I would think i would have to create entites where walls are that you can run like that or somethin, becuz i dont want people running 'on walls' without a wall being present.

I know that this post is confusing, but I can try to elaborate more if you dont know what I mean.

Twilight Suzuka 03-05-2005 18:56

avelocity.

TotalNoobScripter 03-06-2005 12:48

im like noob to vectors and such, could you explain?

also note that ive just finished geometry, and im pretty sure vectors are taught in trig.

Freecode 03-06-2005 20:15

change entity's avelocity
and dont tell me how. its all in the inc files

TotalNoobScripter 03-07-2005 12:51

ok i saw avelocity in the engine .inc, but whats a vector?:shock:

TotalNoobScripter 03-07-2005 14:34

from somewhere i dont know where but from somewherei recall this vague info...
is a vector basically a direction in degrees, 0-360, where 0 is right and 180 is left?

Ok after more searching....

new fVector[3]
fVector[0] = 0
fVector[1] = 0
fVector[2] = 90

Would cause the player to rotate 90 degrees along the Z axis? (Im hoping the Z axis, when rotated, gives like a roll effect, like the effect of running against a vertical wall.

TotalNoobScripter 03-07-2005 20:38

*bump*

XxAvalanchexX 03-07-2005 22:28

Try it, man. You can experiment, no need to ask every single question until you get the OK from us.

TotalNoobScripter 03-07-2005 22:42

i did expieriment, it crashses server.

Twilight Suzuka 03-08-2005 01:31

A vector is an array of [3], which takes float values. Each float value denotes a specific magnitude.

new Float:g_vector[3]
[0] = x
[1] = y
[2] = z

Since X Y and Z are map dependent, you cant really predict exactly what will happen in all cases. But generally, x is side to side, y forward and back, z up and down. Simple.


All times are GMT -4. The time now is 13:57.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.