OpenXcom Forum

Modding => OpenXcom Extended => OXCE Suggestions DONE => Topic started by: Scamps on August 08, 2022, 06:30:35 pm

Title: [DONE] Weapon range in paedia
Post by: Scamps on August 08, 2022, 06:30:35 pm
Can weapon ranges (auto/snap/aimed) be extracted into pedia article?

Also could you please direct me to documentation on paedia templates in general? Or which files in mods contain examples?

Sorry if answered before, I have poor google skills.
Title: Re: Weapon range in paedia
Post by: Meridian on August 08, 2022, 08:05:10 pm
There is no more space to display anything in the pedia articles.
But you can see the weapon ranges under the INFO button (if you're using OXCE).

Documentation here: https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#UFOpaedia_Article
Title: Re: Weapon range in paedia
Post by: Scamps on August 08, 2022, 11:46:04 pm
Thank you for the answer. After some more research I think I answered my question myself.

The mod which led me to the question is 40k. Weapon articles in this mod have unusual composition, by the time of writing I did not recognize TFTD style. So there are only two paedia temlates - UFO and TFTD.
Problem is there are like 20 bolters in mod, wich share very similar characteristics (and half of them share the same picture, which TFTD allows). Comparing these without a spreadsheet is a pain. I was thinking of making a submod for my own use. Ranges could be displayed for example like that:
Auto (x3)/5   35%   50%
Snap/11        50%   40%
Hence the question.
Looking in localization files there are strings like STR_SHOT_TYPE_SNAP: "Snap (x{0})". Was wondering if it is possible to change into something like "Snap (x{0})/{1}", where {1} is optional. Looking into the code, they are hardcoded. Another option would be adding to STATS FOR NERDS, but it seems more confusing than helping. And the string is also hardcoded.
So the question turns into suggestion with tiny chances to implement. Ranges do not boter me that bad to make a fork of OXCE ))
Title: Re: Weapon range in paedia
Post by: The Reaver of Darkness on August 10, 2022, 05:17:38 am
Mods often have their own ranges, but the default range in the original game is infinite, and the default range with UFO Extender accuracy is 7 for auto shot, 15 for snap shot, 200 for aimed shot, and a dropoff of 2.
Title: Re: Weapon range in paedia
Post by: Meridian on August 11, 2022, 08:52:28 pm
Was wondering if it is possible to change into something like "Snap (x{0})/{1}", where {1} is optional.

Done.
Title: Re: [DONE] Weapon range in paedia
Post by: Scamps on August 13, 2022, 06:43:10 pm
Thank you, kind sir! You made the life of gun collector a bit easier.

It works wonderfully. It can be configured per language. If strings are too long, they do not hide accuracy. They even show default ranges, that are not displayed in INFO. Only tiny issue is that default aimed range of 200 unexpectedly turned to be three-digit. I thought it was 20. But that is not a problem.
Title: Re: Weapon range in paedia
Post by: howareyou32ny on August 16, 2022, 03:37:04 am
Done.
Thanks Mer- How can we use that new feature now?
Title: Re: [DONE] Weapon range in paedia
Post by: Scamps on August 18, 2022, 11:15:40 am
Here is an example mod https://openxcom.org/forum/index.php/topic,10723.0.html
Range replaces {1} in corresponding strings.
Title: Re: [DONE] Weapon range in paedia
Post by: R1dO on August 28, 2022, 02:56:41 am
While fiddling with this functionality (yup ... curiosity again) i noticed something unexpected.

If a mod only uses the ``maxRange`` variable in order to limit weapon range (and thus does not bother with ``aimRange``,  ``snapRange`` and/or  ``autoRange``) the default values for each shot type are shown
even if ``maxRange`` is lower.

Is this intended?
Title: Re: [DONE] Weapon range in paedia
Post by: howareyou32ny on August 28, 2022, 06:09:58 am
Here is an example mod https://openxcom.org/forum/index.php/topic,10723.0.html
Range replaces {1} in corresponding strings.
Using it now. AmaZing. TY.
Title: Re: [DONE] Weapon range in paedia
Post by: Meridian on August 28, 2022, 03:27:23 pm
While fiddling with this functionality (yup ... curiosity again) i noticed something unexpected.

If a mod only uses the ``maxRange`` variable in order to limit weapon range (and thus does not bother with ``aimRange``,  ``snapRange`` and/or  ``autoRange``) the default values for each shot type are shown
even if ``maxRange`` is lower.

Is this intended?

can't answer yes or no, it was not specified
Title: Re: [DONE] Weapon range in paedia
Post by: Scamps on August 28, 2022, 08:01:52 pm
Totally missed that case. I am not that familiar with OpenXcom modding )
Would be good to account for max range, though, please.
I guess, the lowest of two should be displayed?
Title: Re: [DONE] Weapon range in paedia
Post by: Bonakva on September 04, 2022, 10:24:58 am
Totally missed that case. I am not that familiar with OpenXcom modding )
Would be good to account for max range, though, please.
I guess, the lowest of two should be displayed?

Great mod!
Perhaps this is the thing that should go by default in OXCE.
And definitely need to limit the maximum range
Title: Re: [DONE] Weapon range in paedia
Post by: Meridian on September 08, 2022, 07:42:57 pm
Totally missed that case. I am not that familiar with OpenXcom modding )
Would be good to account for max range, though, please.
I guess, the lowest of two should be displayed?

done
Title: Re: [DONE] Weapon range in paedia
Post by: Bonakva on February 22, 2023, 04:51:33 pm
done
How do I enable this feature in OXCE v7.8?
Title: Re: [DONE] Weapon range in paedia
Post by: Scamps on February 23, 2023, 10:16:50 am
Same as before, you need a mod. See the link above for example.
That one was made for personal use, I am too lazy to support it. But it is simple enough.
Title: Re: Weapon range in paedia
Post by: HonkerBonker on February 27, 2023, 05:05:47 pm
Done.

 Thank you ! This is so useful. Had same issue , tons of similar guns , hassle to go to INFO to check max range for each to compare them.
 Only needed to change Scamps mod ; this parts in metadata.yml :
"master: x-com-files" - from w40k ;
"#requiredExtendedVersion: "7.6.5" - and just commented out required version. Maybe it would've worked anyway.
 And it not only shows ranges , but even 3 digit range too(switching to smaller font) ! Some thinking ahead here. +10

 And thanks to @Scamps for example mod. Apparently no need to go through each weapon article in pedia. Just modifying 3 strings in en-us.yml file in language dir is enough.