Author Topic: Newbie Questions  (Read 6680 times)

Offline johnny

  • Squaddie
  • *
  • Posts: 7
    • View Profile
Newbie Questions
« on: January 15, 2014, 03:07:42 pm »
hey guys,

first, i would like to thank you for that wonderful project, its the wet dream of every xcom enthusiast. you kept the feel really like the original, but added cool new stuff! :-)

i would like to ask you three questions:

1) i would like to add the stun/flame grenades to the game. unfortunately, i dont get the translations working (i am german).

did i understand it right that custom translations will be made only in the rule file so i dont need to add things to the language files?
in the grenades mod, the author put all the translations together (see screenshot).

is there any guideline, how to correctly translate strings in openxcom?

2) is there any possibility to add the combat knife as standalone weapon? i only found it inside the war package, which adds alot stuff, which is all not translated in german language.

3) i downloaded the war package and saw in the readme, that the openxcom version is around 0.4.5. is there any chance to play the war-mod with the 0.9 build?


thanks in advance,
j.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11731
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Newbie Questions
« Reply #1 on: January 15, 2014, 08:04:49 pm »
Hello Johnny,

Congratulations on your first post and welcome to the community! This comes from someone who first posted here, uh, two days ago. :P

1) That's right, all you need to do in order to add a translation is to include a relevant section in the ruleset file. Simply copy the entire fragment in English (or any other language), past it just below (also in the ExtraStrings section), change the type to German (not sure what the code is; for American English it's "en-US", while for British English it's "en", and insert the German text.

2) You can find a fully functional knife, made by Warboy1982, here. I'm using it myself.

3) This is something I could like to know myself :) I guess you can always revert to 0.4.5 if all else fails.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Newbie Questions
« Reply #2 on: January 15, 2014, 08:41:17 pm »
1) i would like to add the stun/flame grenades to the game. unfortunately, i dont get the translations working (i am german).

did i understand it right that custom translations will be made only in the rule file so i dont need to add things to the language files?
in the grenades mod, the author put all the translations together (see screenshot).

is there any guideline, how to correctly translate strings in openxcom?
Your procedure is correct, but it looks like Notepad has mangled the format, so I would recommend using an editor like Notepad++ to edit the rulesets without breaking them (see here).

2) is there any possibility to add the combat knife as standalone weapon? i only found it inside the war package, which adds alot stuff, which is all not translated in german language.
You can find standalone mods here (require nightly builds): https://openxcom.org/forum/index.php/board,16.0.html

3) i downloaded the war package and saw in the readme, that the openxcom version is around 0.4.5. is there any chance to play the war-mod with the 0.9 build?
The OpenXcom War mod was made by directly changing the 0.4.5 source code, which is mostly obsolete now, so it's not upgradable (0.4.5 didn't even have support for mods). Most stuff you can find as standalone mods in the forum mentioned above, but for the rest you'll have to wait for whenever Warboy has time to rewrite it for the newest version.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Newbie Questions
« Reply #3 on: January 17, 2014, 12:35:38 am »
3) waiting until 1.0

Offline xracer

  • Commander
  • *****
  • Posts: 565
  • X-COM lover, we've gone at it everywhere
    • View Profile
Re: Newbie Questions
« Reply #4 on: January 17, 2014, 01:27:57 am »

2) is there any possibility to add the combat knife as standalone weapon? i only found it inside the war package, which adds alot stuff, which is all not translated in german language.


Adding that weapon alone is not that difficult a little troublesome but it can be done,
You need:
Sprites: bigobs, handobs and floorobs
They all have to be introduced into the game via the ruleset.

Then you need to again modify the ruleset to allow introduce this weapon, you need to define the weapon, give it an ufopedia which links to the language file. Then in the language file you need to create an article.

This is the way i did it,

In the items section of the ruleset add
Quote
  - type: STR_COMBAT_KNIFE
    size: 0.1
    costBuy: 100
    costSell: 50
    weight: 4
    bigSprite: 57 https://this is your bigobs sprite the number can change if you add other sprites
    floorSprite: 73
    handSprite: 128
    hitSound: 39
    hitAnimation: 0
    power: 60
    damageType: 7
    accuracyMelee: 80
    tuMelee: 12
    battleType: 3
    twoHanded: false
    invWidth: 1
    invHeight: 2
    armor: 12

Since this weapon is not part of research tree you can skip the research and manufacture sections

Then create a link in the ufopedia section:
Quote

 - id: STR_COMBAT_KNIFE
    type_id: 4
    section: STR_WEAPONS_AND_EQUIPMENT https://this section tells where the weapon is classified in your ufopedia
    text: STR_COMBAT_KNIFE_UFOPEDIA https://this one is the article and creates a link to your language file.
Finally go to your language file create an entry follow the proper format
STR_COMBAT_KNIFE_UFOPEDIA: My awesome knife

I hope that helps a little.
 PS> I am just learning also :)


EDIT: Almost forgot you need to add the sprites :)

Quote
  - type: BIGOBS.PCK
    singleImage: true https://this is because you are adding a single image if not you will have to enter width and height of the sprite sheet
    subX: 32 https:// your sprite X
    subY: 49 https:// your sprite Y
    files:
      57: Resources/.../Combatknife.png https://Assuming your file is called combatknife.png and the location of your file.
  - type: FLOOROB.PCK
    files:
      73: Resources/.../CombatKnife.gif
  - type: HANDOB.PCK
    width: 256 https:// This are my values your may differ
    height: 40
    subX: 32
    subY: 40
    files:
      128: Resources/.../CombatKnife.png
« Last Edit: January 17, 2014, 01:33:22 am by xracer »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Newbie Questions
« Reply #5 on: January 17, 2014, 01:54:27 pm »
i'd suggest NOT editing the language files that ship with the game, and instead make use of the ExtraStrings section of the ruleset.

Offline xracer

  • Commander
  • *****
  • Posts: 565
  • X-COM lover, we've gone at it everywhere
    • View Profile
Re: Newbie Questions
« Reply #6 on: January 17, 2014, 03:36:21 pm »
there is an ExtraString section!!!!  :-X

well you learn something new everyday

Offline johnny

  • Squaddie
  • *
  • Posts: 7
    • View Profile
Re: Newbie Questions
« Reply #7 on: January 17, 2014, 08:12:06 pm »
hey guys,

thank you very much for your help, editing it with notepad ++ made it work :).
i will post my translations in the relevant topics too, if some other german guys want to use them.

unfortunately i got another problem, maybe some of you can help me here?
https://openxcom.org/forum/index.php/topic,1816.0.html

cheers,
johannes