Page 1 of 1

NW3 Megaton Countdown Issue

Posted: Thu Dec 13, 2018 1:19 pm
by Aldebaran
You can set the CountdownTime for the Nali Weapons 3 Megaton in the NWeaponsCfg.ini:

[NWMegatonVIII.Megaton]
CountdownTime="030"
MinCountdownTime="030"
MaxCountdownTime="060"

It works well with human players but if a bot activates a Megaton it uses a CoundownTime of 180 whatever I set in the ini.
Any ideas if I can change that CountdownTime for bots too? For me 3 minutes of Countdown is little bit too long.

Re: NW3 Megaton Countdown Issue

Posted: Thu Dec 13, 2018 2:25 pm
by Feralidragon
This countdown is not exactly my most brilliant code, and I kinda regret doing it the way I did it, but essentially the middle digit cannot be higher than 5.

Therefore, if you set the MaxCountdownTime to "059" instead, it should work better (the idea is that the first digit is the minute, while the others are the seconds, and seconds go from "00" to "59").
Although from what I checked in the code (very briefly) bots should be respecting the time, and the higher their skill the less time they set, and this time is clamped between the min and max values anyway in the end, so I am not sure how a bot could set it to something higher.

Re: NW3 Megaton Countdown Issue

Posted: Thu Dec 13, 2018 4:35 pm
by Aldebaran
Ok then I interpreted the digits wrong.

In my example in previous post the timer went down from about "3:00:00" as far as I remember.

If I set now these values:
CountdownTime="020"
MinCountdownTime="020"
MaxCountdownTime="059"

the timer went down from 2:10:00.

If I set these values:
CountdownTime="020"
MinCountdownTime="020"
MaxCountdownTime="025"

the timer went down from 2:00:00.

If I set these values:
CountdownTime="020"
MinCountdownTime="005"
MaxCountdownTime="010"

the timer went down from 5:00:00 (that means 5 minutes!).

So it seems I don't get it much lesser than 2 minutes.
I tried these values on dedicated server, but a test with standard ini in a local play shows similar effect here.

Re: NW3 Megaton Countdown Issue

Posted: Fri Dec 14, 2018 12:53 am
by Feralidragon
I just tested at home, and I was able to reproduce something similar, and I figured out what's happening.

It boils down to the fact that I am casting strings to ints and vice-versa in a very stupid way, and in a way that I didn't consider that when I convert something like "030" to an integer, it will look "30", and once I convert it back to a string, it still remains "30" and in the code I am expecting the string to have 3 digits at all times, but when it doesn't, this bug happens.

The only turnaround for now is to set the MinCountdownTime to "100" or higher, and MaxCountdownTime to any value higher than that (it doesn't matter which).
As long as the first digit configured is not a zero, it will run fine.

The only way to properly fix this would be to compile a new package, which I would do so if it wasn't for the fact that you need to change a couple of stuff in another ini so it loads the fixed package instead of the broken one (as you cannot properly update a package without changing its name... I wished that Epic had looked a bit ahead and had at least assigned version codes to the packages to avoid mismatches, like Android does... but I digress).

Re: NW3 Megaton Countdown Issue

Posted: Fri Dec 14, 2018 10:44 am
by Aldebaran
I tried now:

MinCountdownTime="100"
MaxCountdownTime="104"

and yeah it's much better now, the timer for bots startet at about 1:00:00.
This will affect perhaps all scripted pawns like monsters in Monster Hunt too.
Thank you for your help :tu: