[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 - Trouble with Chainlightning gun.

Trouble with Chainlightning gun.

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Trouble with Chainlightning gun.

Postby Orion » Sat Oct 31, 2015 7:22 pm

User avatar
Orion
 
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

Re: Trouble with Chainlightning gun.

Postby ceriux » Sat Oct 31, 2015 8:47 pm

Aren't enemies that are already dead, marked as dead? Try using that.if (enemy.state == dead_dead)

Skip stuff?
User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Trouble with Chainlightning gun.

Postby frag.machine » Sat Oct 31, 2015 9:14 pm

quick and dirty solution: reuse some float field (my favorites are aflag and cnt since monster code never refers them) as a "already hit" flag.

Also, you could have a counter limiting the number of lightnings fired at once.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2120
Joined: Sat Nov 25, 2006 1:49 pm

Re: Trouble with Chainlightning gun.

Postby Orion » Sun Nov 01, 2015 1:13 am

Silly me, works like a charm. I also made the damage reduce by 40% as the lightning jumps further, until it reaches 1 and then no longer continues. :razz:
User avatar
Orion
 
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

Re: Trouble with Chainlightning gun.

Postby frag.machine » Sun Nov 01, 2015 1:52 am

An interesting tweak would be to check the entity waterlevel and change the attenuation based on it.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2120
Joined: Sat Nov 25, 2006 1:49 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest