Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

Arc of Death

| Inside3d Forums Forum Index -> QuakeC Programming

View previous topic :: View next topic
Author | Message
--- | ---
leileilol Joined: 15 Oct 2004 Posts: 1321 |

Posted: Wed Oct 15, 2008 7:30 pm Post subject: Arc of Death |

How would one code a recreation of this Hexen mage weapon in QuakeC? I'm a bit stumped The arc of death basically - zaps stuff - has lightning shooting to the ceiling and the floor - the 'projectile' can not hit ledges, it just goes up them
- it only stops at wall or monster
- it is NOT a projectile!!! There is no center point of the projectile

Back to top |

jim Joined: 05 Aug 2005 Posts: 400 Location: In The Sun |

Posted: Wed Oct 15, 2008 7:57 pm Post subject: |

Make two entities, one in the ceiling, one in the floor. Then make them move to the direction player or monster shot the lightning. Make it ignore all drops and ledges.. How you check the height of a room? Probably the drop and ledge ignore is someway similar to that. Maybe there should be a third entity that gets it vertical size from the ceiling and floor entities, then if this third entity hits a target, the lightning will stop and electrocute the target.
What about situations when the lightning can go in two ways? Like there's a bridge in the way? Should it randomly choose to go below / above or maybe it could split in two, later combine back as one when the bridge is no more in the way.
_________________
zbang!

Back to top |

Wazat Joined: 15 Oct 2004 Posts: 732 Location: Middle 'o the desert, USA |

Posted: Wed Oct 15, 2008 10:26 pm Post subject: |

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.

Back to top |

VorteX Joined: 14 Jan 2005 Posts: 12 |

Posted: Wed Nov 19, 2008 10:58 am Post subject: |

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:
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.

Back to top |

Display posts from previous:

| Inside3d Forums Forum Index -> QuakeC Programming | All times are GMT
Page 1 of 1

Jump to:

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2004 phpBB Group