Author Topic: [help needed] how to change name to aliens  (Read 5002 times)

Mono

  • Guest
[help needed] how to change name to aliens
« on: March 10, 2015, 04:41:12 am »
I'm trying to use the items->name property but I'm stuck.
latest nightly used: openxcom_git_master_2015_03_08_1940.zip

What I want to achieve is blind capture:
translate STR_SECTOID_SOLDIER, STR_SECTOID_MEDIC, STR_SECTOID_LEADER... simply as "Sectoid Alien".
This way in the battlescape you cannot know if you have a leader or a simple soldier.
Back at base, you should be able to identify the prisoners and have the right ranks.

items->name seems to do just that
pedia say:
Quote
String ID of the displayed item name, for cases where it's different from the internal name. If omitted, type is used.
so I end up with something like
Code: [Select]
items:
  - type: STR_SECTOID_SOLDIER
    name: STR_CAPTURED_SECTOID_SOLDIER
but the name property seem to be just ignored. Only type get used.
Someone can help me plese  :'(

below a simple rule for testing
Spoiler:
extraStrings:
  - type: en-GB
    strings:
      STR_SECTOID_SOLDIER: "generic sectoid"
      STR_CAPTURED_SECTOID_SOLDIER: "ranked sectoid"   
items:
  - type: STR_SECTOID_SOLDIER
    name: STR_CAPTURED_SECTOID_SOLDIER
    size: 0.0
    recover: true
    liveAlien: true
    costSell: 0
  - type: STR_CAPTURED_SECTOID_SOLDIER
    size: 1
    costSell: 40000
    liveAlien: true 
    recover: true
  # only corpse uses "name"
  # - type: REAPER_CORPSE_1
    # name: STR_REAPER_CORPSE
    # floorSprite: 52
    # invWidth: 0
    # invHeight: 0
    # battleType: 11
    # recoveryPoints: 3
  # - type: STR_REAPER_CORPSE
    # size: 1
    # costSell: 20000
    # battleType: 11
  # start a new game with stun launcher   
  - type: STR_SMALL_LAUNCHER
    requires: []
  - type: STR_STUN_BOMB
    requires: [] 
startingBase:
  crafts:
    - type: STR_SKYRANGER
      id: 1
      items:
        STR_SMALL_LAUNCHER: 10
        STR_STUN_BOMB: 50
  items:
    STR_SECTOID_SOLDIER: 1
    STR_CAPTURED_SECTOID_SOLDIER: 1
  facilities:
    - type: STR_ALIEN_CONTAINMENT
      x: 1
      y: 2
    - type: STR_ACCESS_LIFT
      x: 2
      y: 2
    - type: STR_HANGAR
      x: 2
      y: 0
    - type: STR_HANGAR
      x: 0
      y: 4
    - type: STR_HANGAR
      x: 4
      y: 4
    - type: STR_LIVING_QUARTERS
      x: 3
      y: 2
    - type: STR_GENERAL_STORES
      x: 2
      y: 3
    - type: STR_LABORATORY
      x: 3
      y: 3
    - type: STR_WORKSHOP
      x: 4
      y: 3
    - type: STR_SMALL_RADAR_SYSTEM

Thanks in advance   :)
« Last Edit: March 10, 2015, 04:46:23 am by Mono »

Mono

  • Guest
Re: [help needed] how to change name to aliens
« Reply #1 on: March 10, 2015, 05:04:10 am »
Re-reading my own message. Cannot understand myself  :-[
Code: [Select]
units:
  - type: STR_SECTOID_SOLDIER
    race: STR_SECTOID
    rank: STR_LIVE_SOLDIER
    stats: ...
    value: 10
This is the alien unit to capture in battlefield. It give you a score and has not a costSell or size.
End of mission. Prisoner collected and transferred to base.
At the base the prisoner is now an item:
Code: [Select]
item:
  - type: STR_SECTOID_SOLDIER
    name: STR_SOME_ALTERNATIVE_STRING
    size: 0.0
    recover: true
    liveAlien: true
    costSell: 40000
and items have a "name" attribute.
Both basescape and battlescape use only the string in "type".
Some corpses use "name" to refer to another item (another corpse), but how it work?

Is possible to have STR_SECTOID_SOLDIER to display STR_SOME_ALTERNATIVE_STRING when in basescape?

re-thanking in advance  :P
« Last Edit: March 10, 2015, 05:34:19 am by Mono »

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: [help needed] how to change name to aliens
« Reply #2 on: March 10, 2015, 05:49:32 am »
Thankfully I am the self-proclaimed corpsemaster so I can help... at least partially - I don't know how to fix living aliens, but you can hide corpse's name until you have dragged it back to base:

You need to do it the other way around, I think. First, you need to define 2 corpses for an alien under the Armors, example:

Code: [Select]
armors:
  - type: SECTOID_ARMOR_P1
    corpseBattle:
      - STR_SECTOID_CORPSE_BATTLE
    corpseGeo: STR_SECTOID_CORPSE

Now, you need to add a second corpse for the sectoid. You need to do that in the Items section:

Code: [Select]
items:
  - type: STR_SECTOID_CORPSE
    recover: false
  - type: STR_SECTOID_CORPSE_BATTLE
    name: STR_ALIEN_CORPSE
    weight: 30
    bigSprite: 46
    floorSprite: 42
    invWidth: 2
    invHeight: 3
    battleType: 11
    recoveryPoints: 5

Now just define the language string for STR_ALIEN_CORPSE and you're home. At least, with the corpses.

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: [help needed] how to change name to aliens
« Reply #3 on: March 10, 2015, 06:08:08 am »
you can also manually assign names of ufopaedia entries and items (i think) using
name:  YOUR NAME HERE

instead of using STR_...

like

name: Dead Sectoid Noob Corpse

this is probably because before run time all STR_... get replaced by their string but if they have no strings they stay as themselves .
BUT but doing it this way leaves it hardcoded and cannot change language.
« Last Edit: March 10, 2015, 06:15:34 am by tollworkout »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: [help needed] how to change name to aliens
« Reply #4 on: March 10, 2015, 01:10:37 pm »
or just change the strings in the .lan files/make a ruleset to override them (replace "commander" with "alien" for example)

Mono

  • Guest
Re: [help needed] how to change name to aliens
« Reply #5 on: March 10, 2015, 09:58:20 pm »
sorry tollworkout and Warboy1982,
you both missed my point. My fault, messy description.

Code: [Select]
extraStrings:
  - type: en-GB
    strings:
      STR_ALT_RIFLE_NAME: "Killer Rifle"
items:
  - type: STR_RIFLE
    name: STR_ALT_RIFLE_NAME
If I add these simple 7 lines to the ruleset...
same item, the normal rifle, is listed as "Rifle" (translation from STR_RIFLE) in the buy/sell and store window on basescape, but
in battlescape, when I move the mouse over it on soldier inventory
it say: "Killer Rifle" (translation from STR_ALT_RIFLE_NAME).
Same item, two names. One for base and one for battle.
Work for items but not for corpse or live aliens.
I was wondering if I can use this trick on live stunned aliens too.

Dioxine "the corpsemaster" pointed me how this can be done on dead corpses (thank you Dioxine), but not on living fainted aliens.

Still exploring the possibilities of this "name" attribute, none found since now. :(
« Last Edit: March 10, 2015, 10:43:07 pm by Mono »

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: [help needed] how to change name to aliens
« Reply #6 on: March 10, 2015, 10:09:44 pm »
for every entry that is different type items: ufopaedia: research: .... can have their own names