[Code] A_CustomBulletAttack, Drive-By Shooter Behavior

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
RV-007
Posts: 1501
Joined: Fri Sep 02, 2011 9:00 pm
Location: Dying w/ civilization or living after it
Contact:

[Code] A_CustomBulletAttack, Drive-By Shooter Behavior

Post by RV-007 »

If any of you remembered the media showing drive-by shootouts, you would know that there should be an degree limitation in how far the shooter can turn w/i the vehicle. I tried my best to make those messy bullet spray, and I did it. However, I was wondering if I can control that bullet spray to a certain degree.

If I was to spray bullets, I can see 90 degrees in angle and pitch. If I was ever to face beyond the 90 degrees from the target, I would still be able to spray bullets (but I don't know where to aim [I guess I can stretch the bullet spread to a 90 degree angle {waving gun wildly from left, right, top, and down}]). I should be able to aim @ the target if it ever comes back w/i my 90 degrees visual field. All the above is happening during my spraying spree. I guess this idea would require plenty of A_JumpIfTargetInLOS Decorate functions + Goto flow controls. It will require a plenty of thought.

I might eventually get it, but I want to make a topic beforehand so I can make note of 'behind-the-scenes'. If I don't get the code right, I can just default on the A_CustomBulletAttack. However, I don't think a drive-by shooter can shoot from behind and around and around and around and around.

EDIT (07/11/2013):
Okay, I think I got it. I know that drive-by cars will not likely to A_FaceTarget its target, so that means I will not be using A_FaceTarget. I decided to just make 2 copies of the 'missile' code block, but one w/o A_CustomBulletAttack's CBAF_AIMFACING DECORATE function flag. The block w/ CBAF_AIMFACING have a much wider spread to emulate the wild inaccurate shooting @ nothing, but trying to find its target that exists somewhere in the map. A_JumpIfTargetInLOS will determine if the target is w/i sights of the driver-by car. Over all, the code seems easy enough to understand. Goto flow control will determine blind spot conditions of the driver-by car (blind shooting). In conclusion, I am able to create continuous drive-by shooting w/ || w/o the target in the drive-by car's visual field.

This link has the determinant for this code.

Here is my first code example:
Spoiler:
Locked

Return to “Editing (Archive)”