[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Quake remembers my Movements...

Quake remembers my Movements...

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Quake remembers my Movements...

Postby Mexicouger » Sun Sep 05, 2010 2:24 pm

Well, I was working with some ball code, and .attack_finished, and It's really annoying me. When I turn into the Morphball, and I press it again while the attack_finished is still ticking, It will turn me back to human. It like remembers me button During the Attack_finished code.

Same with Jumping. I made it so you can't transform While In jump, And when I jump and Press the Morphball Transform button, once I hit the ground, I transform -_-. Do any of you have a fix for this? Make Quake stop remembering my Movements? I am not going to post the code, Because I think you guys can get an idea of what I mean.
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Postby Ghost_Fang » Sun Sep 05, 2010 4:49 pm

I have that same issue with reloading and switching weapons, you cant switch while reloading, but as soon as your done it switches. From my observations I guess you can basicaly say that the impulse waits til (time > self.attack_finished) then does your impulse.
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby Jukki » Sun Sep 05, 2010 5:31 pm

i have similiar isue with my mystery box code. well i hope someone tells us how to fix XD
Jukki
 
Posts: 214
Joined: Wed Apr 07, 2010 4:59 am

Postby Karatorian » Sun Sep 05, 2010 7:44 pm

These behaviors are all caused by something pretty basic, failing to clear self.impulse after declining to act on it's value, which causes the value to be there the next time the impulse handler is called.

In the case of the default attack_finished, the reason is that W_WeaponFrame (called from PlayerPostThink) returns before calling ImpulseCommands if attack_finished is greater than the current time. This works well in the stock QuakeC because it prevents someone from switching guns while still firing, but allows the switch to happen as soon as they're done.

As for the morph stuff, it's hard to say exactly what's going wrong without seeing the source, but somehow the impulse isn't being cleared after deciding not to allow the morph.

In the case of the mystery box, you didn't give any details, but if it uses impulses, it's probably the same issue.

When changing any of this, carefully consider that the standard behavior is generally correct. If you clear the impulse, make sure that you do so only in cases where you feel you must.

For example, in standard Quake, trying to switch weapons while still firing the current one doesn't work, but it doesn't clear the impulse. If it did, switching weapons would require that the player make sure to do so only while not still in an attack. However, realistically, that isn't going to happen. Instead, players will complain that weapon switching seems to randomly not work.

In general, when making a mod, you should consider refactoring the impulse handling system. The standard code delays all impulses until attacks are finished and then executes them as soon as possible. This makes sense, because the only thing the stock game uses impulses for is weapon switching. (And the cheat code, but pfft.) As you add more impulses, the default handling (including being called from W_WeaponFrame) starts to not make sense. For instance, why should adding a bot need to wait until the current attack is finished. (Not that the delay is very long, or even noticeable, but it's silly.)

As such, I recommend that you consider impulse handling a little more deeply than just adding more if statements to ImpulseCommand. Decide which impulses should be handled (at this time) and which shouldn't. And for those that aren't handled, decide which should be cleared, and which should just be delayed. Try to keep things clean and modular.
Karatorian
 
Posts: 31
Joined: Tue Aug 17, 2010 4:26 am
Location: Rindge, NH, USA

Postby Mexicouger » Tue Sep 07, 2010 1:34 am

User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Postby Ghost_Fang » Tue Sep 07, 2010 1:42 am

Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest