Where would you set up a disorient-type function?


(jaybird) #1

I’d like to set up shrub-like disorient functionality, but I’m not too sure where or what I’d need to modify. I’d guess it would be somewhere in bg_pmove, but any help would be appreciated.


(jaybird) #2

Let me be a bit more specific. I’m not wanting code to set up a shrub bot. I need to know where I can adjust the view angles so that the view is reversed and upside down and controls are backwards. Setting the roll to the view seems reasonable, but I don’t know where I would adjust that.


(dvldrmmr) #3

The CG_DrawActive function in cg_draw.c looks like the right area to me, but I havent tried anything yet. You could add an EV_DISORIENT event maybe, and have it call a function that rotates view 180 deg around the view axis, but I have no clue how to do that right now.

dvl


(jaybird) #4

Only problem is that this has to be server-side, so it has to be in the bg_* files.


(SCDS_reyalP) #5

bg_* goes into both games (thats what bg_ stands for), so unless you are very careful, changes to bg_* require a new client. I would suggest you look at how the shaking from airstrikes etc is done.


(jaybird) #6

After digging through all this code for a while now, I’ve realized that there’s a lot you can get away with. I’ve done some modifications to the BG code and successfully done it serverside only, and disorient has successfully been done serverside only before.

I still cannot figure this out, however. I’ve tried setting ps->viewangles[ROLL] = 180.0f, which KINDA works. It turns the characters head animation completely upside down (shrub does the same), and the strafe left and right are reversed. However, the view it still correct, and mouse movements are still correct, so I guess this is halfway working. When you are in limbo on an initial spawn (just joined a team), the view is completely upside down (what I want), but as soon as you spawn the view is correct, with strafing still reversed, but mouse controls still correct. Any ideas?


(dvldrmmr) #7

SetClientViewAngle function in g_client.c?? Its called by ClientSpawn every time a player respawns.

dvl


(jaybird) #8

LoL man, I was looking waaaaay too hard for this one. Thanks, that was exactly the function I needed to modify!