aliens

Author Topic: String reuse confusion (craft beam weapons)  (Read 5552 times)

Offline daggerstab

  • Squaddie
  • *
  • Posts: 7
    • View Profile
    • My blog
String reuse confusion (craft beam weapons)
« on: October 01, 2013, 12:58:08 am »
Trying to understand some puzzling behaviour of my translation, I've found out that a string is being re-used as both a craft weapon name and an infantry weapon damage type, which is a bit problematic. In detail:

At the moment, laser and plasma both use a set of three strings each, but in a different way:

  • STR_LASER_BEAM   (default value: "LASER BEAM") - used as damage type in the UFOpedia, and only there - ArticleStateItem::setDamageTypeText()
  • STR_LASER_CANNON ("Laser Cannon") - used both as a technology name and item name
  • STR_LASER_CANNON_UC ("LASER CANNON") - used as a weapon name in the UFOpedia and the craft equipment screen

  • STR_PLASMA_BEAM ("Plasma Beam") - item name only
  • STR_PLASMA_CANNON ("Plasma Cannon") - technology name only
  • STR_PLASMA_BEAM_UC ("PLASMA BEAM") - used both as a weapon name and a damage type in the UFOpedia

The last point is the one that caused my problem - if for some reason a translation needs to use separate strings for the craft weapon and the damage type, that would be impossible. As far as I can remember, the inconsistency in naming (plasma beam/cannon) dates back to the original UFO, though it may be a false memory. :)

There are several possible ways of dealing with that (including doing nothing and leaving it to the translators to figure it out). What do you think?

Offline Hythlodaeus

  • Colonel
  • ****
  • Posts: 276
    • View Profile
Re: String reuse confusion (craft beam weapons)
« Reply #1 on: October 01, 2013, 01:08:04 am »
Yeah, I noticed that one before. It's essentially a developer SNAFU. It's actually in the original game too, hence why OXC also has it.

But indeed, this should be fixed.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: String reuse confusion (craft beam weapons)
« Reply #2 on: October 05, 2013, 04:02:45 pm »
a possible quick-fix for this seems to be, define a new string say

STR_PLASMA_BEAM_H

for the ufoPedia column-headers, and insert that into setDamageTypeText()

- works for me, since i use "PB" for the header

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: String reuse confusion (craft beam weapons)
« Reply #3 on: October 12, 2013, 08:37:44 am »
Fixed.