View Single Post
Old 06-23-2006, 02:44 PM   #8
Vruki Salet
Junior Member
Vruki Salet's Avatar
Join Date: Aug 2005
Location: Somewhere else entirely
Posts: 443
If I get you right then the answer to the first question is that I make a console command and bind it to the key I want and it makes a command define in g_cmds.c go.

For the second question, I made it so that the next swing could only be commanded during certain times (experimented with various: e.g. once the original swing was 40% done), so the command wouldn't count outside of those times, but when I hit this current problem I opened it up to make the server allow the command at any time.

UPDATE: I have a variable (vsnInt1, essentially userInt1) that when greater than 0 tells the server to "press" BUTTON_ATTACK for me. It used to be "pressed" in bg_pmove.c but I moved it to pm_weaponlightsaber. (Both places behave the same.) I need it to be reset to 0 after a swing so it doesn't just swing forever once it's been made greater than 0 by the command in g_cmds.c, so I put "pm->ps->vsnInt1 = 0;" before returns in my equivalent of PM_SaberAttackForMovement at first, and then changed it to the end of pm_weaponlightsaber. (Both places behave the same.) This is giving a clue to the problem. Without the "pm->ps->vsnInt1 = 0" I swing perpetually once the first command is given. With it, I can make exactly 1 full swing at a time always returning to ready stance before I can swing again.

Last edited by Vruki Salet; 06-23-2006 at 03:25 PM.
Vruki Salet is offline   you may: quote & reply,