[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 - Arc of Death

Arc of Death

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Arc of Death

Postby leileilol » Wed Oct 15, 2008 7:30 pm

leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby jim » Wed Oct 15, 2008 7:57 pm

zbang!
User avatar
jim
 
Posts: 599
Joined: Fri Aug 05, 2005 2:35 pm
Location: In The Sun

Postby Wazat » Wed Oct 15, 2008 10:26 pm

If I'm understanding the requirements properly, it seems that if the lightning encounters a barrier, it goes around it on both sides, then merges automatically if possible on the other side.


First method:

I'd say fire something like 3 entities. They should stay vertically aligned at all times. If one of them hits a wall and the other 2 keep flying, it should either disappear or try to align itself with the others and keep flying.

Or you could fire a spray of entities that stay vertical like this, and when this hit a surface at a certain angle that kills the entity, but the others continue on without it. If they hit at an angle that won't kill them, instead of slowing down it reapplies its velocity and/or sets its origin to that of the sister entity that is farthest away from the original starting position. The entities that can see each other push each other away or otherwise try to space themselves out appropriately.

In any case, the entities that can't see any other sisters will fire their lightning independently; those that can see each other will pick one to do the lightning. The lightning is done by tracelining to the ceiling, tracelining from the ceiling to the floor, and finally using that traceline to draw the lightning. Entities that realize they're inside a wall do not apply lightning, and set their movetype to noclip until they get out of the wall.

This method is riddled with problems though when you shoot at stairs or other non-smooth geometry.

---

Second method:

Another method is to fire a noclip entity out that acts like the black hole mod I saw once. Their black hold gun would traceline to the wall, then incrementally step forward through it and check if the contents was solid. When/if it found a location that was not solid, it knew it had breached to the other side and tracelined back toward the origin to find where that edge was. Then it creates a portal on both sides of the wall, and if you step into one you teleport to the portal on the other side.

Thus this noclip entity just flies merrily along, alone. When not in a wall, it tracelines to the ceiling, then tracelines from the ceiling to the floor for the lightning. When it's in a solid, it does the black hole gun trick for both up and down directions. If it finds empty space above it, it does its ceiling to floor lightning there, and the same for if it finds empty space below it.

After it hits its timeout (say, 10 seconds), it dies.

---

Method 3:

Sort of a hybrid method. When this noclip entity enters a wall, it does its black hole gun traceline trick once for up and once for down. For each direction it finds empty space, it spawns a new entity like itself and then deletes itself (or moves itself if it only finds one direction). This way, it continues to split into new children for each time the geometry segments.

Each segment probably inherits its base timer from its parent, so that only 10 seconds of zappiness max happens no matter how often it has to split.

For safety, you could even set a limit on how many generations it can produce.

Some extra tracelines when you spawn a child or move the parent out of the wall may be desirable, in case a slope or stairs are going to make it keep entering the wall. Firing a spread of tracelines from its origin to its destination a couple seconds away with varying Z offsets could help it choose a height/direction that will maximize how long it flies before entering a wall again.

---

Method 4:

Get the Hexen code, and see how they did it.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Postby VorteX » Wed Nov 19, 2008 10:58 am

I have making such a weapon in my mod long time ago, that mod was never released and it seems i completely lost it when my hard drive was crashed.

Main problem of Arc-Of-Death Quake implementation is that it will be a bit more complicated, because of pure 3D quake has, in other words, while moving the spark could get such situation:
Image
that case never happens in Hexen

Similar to Hexen way (it's a bit hard to understand it looking at the source) i have launching an invisible missile, which thinks each frame (i was using StartFrame() hooks, not .think). On each think i was tracing from this missile up and down and correct floor and ceil sparks positions. Then i need to make 2 tracings from this positions to each other to detect possible monsters between sparks (and if monster is found, the spark is attached to it). In the .touch code i have maked checker which fixes invisible missile position when it hit wall. Additionally i have maked sparks jittering effect and animated cetral spark that goes cycling run up<->down, it was a weird code.

I hope this helps.
VorteX
 
Posts: 12
Joined: Fri Jan 14, 2005 8:37 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 2 guests