OpenXcom Forum

OpenXcom => Troubleshooting => Topic started by: Amiga on March 17, 2018, 12:06:51 am

Title: Strange behaviour when craft weapon has 1 ammo...
Post by: Amiga on March 17, 2018, 12:06:51 am
So I've created Nuclear Missile Craft Weapon. Ammo Max 1...the problem is when I set during fight Caution or Standard Attack weapon is launched and my plane is retreat on save distance straight away and weapon is unable to hit the target. Only aggresive attack works...
Is is a bug that first shoot never hit when weapon has max 1 ammo?
The only solution I've found is to set ammo max 2 insted of 1....
Title: Re: Strange behaviour when craft weapon has 1 ammo...
Post by: Meridian on March 17, 2018, 12:42:46 am
Setting ammo to 2 will not help... the same will happen to the 2nd missile.
Basically when last missile is fired, the craft automatically retreats to safe distance... unless you're in aggressive mode.

It's not technically a bug... it's the same behavior as the original game had.

But it's not convenient... I admit.
Title: Re: Strange behaviour when craft weapon has 1 ammo...
Post by: Amiga on March 17, 2018, 12:44:24 am
No. With ammox2  is fine..both missiles hitting target so it's solution.
Title: Re: Strange behaviour when craft weapon has 1 ammo...
Post by: Meridian on March 17, 2018, 01:25:48 am
It has happened to me countless times over the last 20 years.
I have read the source code and I see it works that way.
I have just tried it on the original game too, extra for you.

But sure, don't believe me... I have only been developing this game for the last couple of years... what do I know...
Title: Re: Strange behaviour when craft weapon has 1 ammo...
Post by: Amiga on March 17, 2018, 01:43:07 am
I know it's exist in original game:) I thought it can be fixed in some way...
I've just checked again with my weapon maxAmmo: 2 and both salves hit target..no retreat
here's YT video :)
ammo: 1
https://www.youtube.com/watch?v=CDQM86dTpE0&feature=youtu.be

ammo: 2
https://www.youtube.com/watch?v=KNo0sc9d0iM&feature=youtu.be
Title: Re: Strange behaviour when craft weapon has 1 ammo...
Post by: Meridian on March 17, 2018, 01:54:11 am
Here's a video with an interceptor with 2 missiles.
First shot, hit.
Second shot, disengage and miss. Each time.

Title: Re: Strange behaviour when craft weapon has 1 ammo...
Post by: Amiga on March 17, 2018, 02:16:51 am

Two variants:

..I think I know how to solve it. If missile is still flying then second missile will hit but if missile hit the target before reload then craft retreat from battle after second shoot. It happens on low range weapons


the key is to set proper range and reload time....



Title: Re: Strange behaviour when craft weapon has 1 ammo...
Post by: Meridian on March 17, 2018, 02:35:41 am
Yes, if the previous missile is still flying while the last missile is fired, this will not happen.

But in vanilla (and in most mods) reload times and weapon ranges are set so that only one missile is flying at a time... you can change it, but it has also disadvantages... for example, if the first missile destroys the target, the second (already fired) missile is wasted.
Title: Re: Strange behaviour when craft weapon has 1 ammo...
Post by: Amiga on March 17, 2018, 10:43:47 am
Yes, if the previous missile is still flying while the last missile is fired, this will not happen.

But in vanilla (and in most mods) reload times and weapon
ranges are set so that only one missile is flying at a time... you can change it, but it has also disadvantages... for example, if the first missile destroys the target, the second (already fired) missile is wasted.

In both case there is a chance that missile is wasted..
Title: Re: Strange behaviour when craft weapon has 1 ammo...
Post by: Meridian on March 17, 2018, 10:49:26 am
But in one of the cases you can prevent wasting by shortly switching to aggressive.
In the other case, it is always wasted.

Pretty big difference for me.
Title: Re: Strange behaviour when craft weapon has 1 ammo...
Post by: Amiga on March 17, 2018, 11:26:39 am
But in one of the cases you can prevent wasting by shortly switching to aggressive.
In the other case, it is always wasted.
Pretty big difference for me.

Yes I was going to write about it ;)
Title: Re: Strange behaviour when craft weapon has 1 ammo...
Post by: Warboy1982 on March 18, 2018, 11:05:31 am
This long standing bug has been resolved.
Title: Re: Strange behaviour when craft weapon has 1 ammo...
Post by: Amiga on March 18, 2018, 06:26:29 pm
This long standing bug has been resolved.

what do you mean Warboy? l;atest nightly has fix already?? Awesome!

Quote
warboy1982, Sun Mar 18 01:12:29 2018
fix dogfight "last bullet" bug

- checked - working flawless..after 24 yrs
 ;D ;D ;D ;D
Title: Re: Strange behaviour when craft weapon has 1 ammo...
Post by: The Reaver of Darkness on March 19, 2018, 08:37:08 pm
This long standing bug has been resolved.
This is amazing! I thought it was never going to be fixed!