OpenXcom Forum
OpenXcom Forks => OpenXcom Extended (OXCE) => OXCE Support => Topic started by: Searmay on December 21, 2017, 05:42:24 pm
-
TFTD style UFOpaedia articles (type_id 14) do not correctly report the number of auto shots made. UFO articles (type_id 4) do, so I presume it wasn't updated when this was made configurable.
The offending code is src/Ufopaedia/ArticleStateTFTDItem.cpp line 78, which should be:
tr("STR_SHOT_TYPE_AUTO").arg(item->getConfigAuto()->shots).c_str(),
And while we're there, the UFO version changed the code for snap and aimed shots too, so lines 93 and 108 should change similarly:
tr("STR_SHOT_TYPE_SNAP").arg(item->getConfigSnap()->shots).c_str(),
tr("STR_SHOT_TYPE_AIMED").arg(item->getConfigAimed()->shots).c_str(),
Related to this: the number of snap and aimed shots aren't actually configurable, though they almost are. It looks like it doesn't bother to read aimedshots and snapShots, but it would use them if it could. Can be fixed in src/Mod/RueItem.cpp by adding around the similar code for autoShots on line 588:
_confAimed.shots = node["aimedShots"].as<int>(_confAimed.shots);
_confSnap.shots = node["snapShots"].as<int>(_confSnap.shots);
Apologies if this isn't sufficiently clear, I'm not really used to bug reporting.
-
Number of shoot is configurable: https://github.com/Yankes/OpenXcom/blob/master/src/Mod/RuleItem.cpp#L227
-
It doesn't actually work without the extra lines indicated though. I don't pretend to understand the code, but I've recompiled it and I get multiple snap shots with that line, but not without it.
-
For what ruleset? What you add to `load` function is not correct place to do this. Do you see that line I reference is outside `load` and in `loadConfAction`?
I have one line that look like lines you added:
https://github.com/Yankes/OpenXcom/blob/master/src/Mod/RuleItem.cpp#L579
but reason that is exists is completely different, not to load number of shoot but for backward compatibility.
correct way to load this is in this line:
https://github.com/Yankes/OpenXcom/blob/master/src/Mod/RuleItem.cpp#L501
that call this line:
https://github.com/Yankes/OpenXcom/blob/master/src/Mod/RuleItem.cpp#L227
For ufopeadia change, indeed, TFTD article do not show number of hits. Meridian could use you change.
-
I tested it with a simple mod and got nothing.
items:
- type: STR_RIFLE
snapShots: 2
When I load up a test battle with a rifle and fire a snap shot with just that mod enabled, I get one shot.
-
I tested it with a simple mod and got nothing.
items:
- type: STR_RIFLE
snapShots: 2
When I load up a test battle with a rifle and fire a snap shot with just that mod enabled, I get one shot.
yup, because this ruleset is incorrect. This is way work for you and not work in OXCE. Correct is:
items:
- type: STR_RIFLE
confSnap:
shots: 4
confAuto:
shots: 8
You can see this examples https://openxcom.org/forum/index.php?action=dlattach;topic=2915.0;attach=35504
-
Oh I see, thanks. Does that format let you define everything about the shot (tu, accuracy, etc) to keep it all together?
-
Yes, in future I plan add more properties to configure and with that I will need change only one line not 4 or more to add something to all attack types.