PDA

View Full Version : How can remove the need to hold an attack button the whole swing?


Vruki Salet
01-07-2006, 04:25 PM
When I remove the code that looks like it makes the need to keep attack held down in order to not abort a swing the result is that I keep swinging R2L over and over whenever I'm idle.

How can I remove the holding thing without side effects?

razorace
01-07-2006, 10:55 PM
Which section did you try to remove?

Vruki Salet
01-07-2006, 11:48 PM
Various parts of from this if {} section:

//quit holding down attack.
else if ( !(pm->cmd.buttons & (BUTTON_ATTACK)) )
//else if ( !(pm->cmd.buttons & (BUTTON_ATTACK|BUTTON_ALT_ATTACK)) )
//[/SaberSys]
{
...stuff...
}

In the current file it goes from line 4441 to 4487. I've removed bits and pieces and the whole thing. Most recently I commented out that last "PM_SetSaberMove( LS_READY );" and then the "return;" below it. Same problem except now the animation has changed to what looks like just the windup before a LS_A_R2L. If I'm idle it repeats over & over.

razorace
01-08-2006, 04:46 AM
line 4461: Replace with original commented out code, which is on the next line.
line 4470: Replace with original commented out code, which is on the next line.

I beleive that's all that's invocced to make that part of the faking system work.

Vruki Salet
01-08-2006, 12:00 PM
Thanks. I probably wouldn't have worked that out any time soon. Now that I can actually duel with your saber system I have to admit it looks pretty good. Those TABbots are nice too btw. They're good enough to test with.

Only problem I'm having now is quite a bot of lag (not net lag of course, I mean framerate) when sabers clash. It might be my own fault because of stuff I've changed. I'm going to see if I can pinpoint the source. Is there anything in the CVS checkout of 2 or 3 days ago that might cause that?

Also, what are the best cvar saber settings for duelling with OJP? (saberfaces, ghoul2 collisions, etc. etc.)

razorace
01-08-2006, 01:54 PM
mmm, I'll think about it but I don't think there should be anything that would do that.

The new system does do a lot more Ghoul2 traces so it's possible that a really old, slower computer might have issues. However, I've never seen any slowdowns like that.

As for settings, the OJP defaults are best for everything except the sv_fps, which can be turned up to DRAMATICALLY improve the hit detection...but this does increase the CPU load and might cause other problems. However, in local mode, increasing sv_fps is normally pretty stable.

Vruki Salet
01-08-2006, 02:47 PM
Doesn't sv_fps have to be 50 or 100 for OJP to work right?

razorace
01-08-2006, 04:51 PM
No, it works at the default 20. However, hit detection always works better if more the server processes more fps. If your game is slowing down, you definitely want to have it at 20.

JRHockney*
01-11-2006, 01:44 AM
Oh great guardian of noob questions, I have a noob question. What file is this code (shown above) located in. I've been looking through all the files in the OJP enhanced folder and I can't find anything like it. I figure if I'm going to start learning this coding stuff, I need a visual example of the kind of stuff I want to work on. Do I need a specific program to view it aside from notepad, winrar, or microsoft visual (8.0 in my case)?

razorace
01-11-2006, 02:12 AM
You need to get the source code for OJP, which you can learn how to get by reading the sticky thread named as such. :)

Vruki Salet
01-11-2006, 04:16 AM
Do I need a specific program...?

I use MS visual blah blah but one program I really couldn't get along without is Agent Ransack (http://mythicsoft.fileburst.com/agentran.exe). It's a free file search utility. I always use it when I'm coding.

JRHockney*
01-11-2006, 04:44 AM
Cool, I didn't even realize that accessing the source thread meant source code! :doh: Much to learn I still have. :syoda:

razorace
01-11-2006, 05:05 AM
I use MS visual blah blah but one program I really couldn't get along without is Agent Ransack (http://mythicsoft.fileburst.com/agentran.exe). It's a free file search utility. I always use it when I'm coding.

So, what does it do?

Vruki Salet
01-11-2006, 12:21 PM
It's like having grep with a nice interface for widows.

razorace
01-11-2006, 03:19 PM
Doesn't VS already do something similar to that? I know that the Find in Files command can do Regular Expressions.

Vruki Salet
01-11-2006, 04:38 PM
DOH! Well whadya know, it does. I happen to like AR's interface better but you are absolutely right. I'd just been using the regular find function.

razorace
01-11-2006, 06:09 PM
*shrug* I'm not too fancy myself. I've only really used simple keywords. That regular expression stuff just isn't useful for me.