aliens

Author Topic: [Resolved] Find mistake in ruleset ?  (Read 6802 times)

Offline Human Ktulu

  • Colonel
  • ****
  • Posts: 129
  • Cuistre !
    • View Profile
[Resolved] Find mistake in ruleset ?
« on: April 19, 2014, 04:02:52 pm »
Hi all,

I try to make a modpack with some craft. I have succefully modify the Raven, Alloy Skyranger, Thunder and Raven, but I have a problem with "Sentinel" mod. I want modify ruleset for include research and manufacture. But the game (last git) would'nt activate it. And no error message. :(
Of course, I use Notepad++
Can you help me ? (my base idea is make a complete and well balenced modpack with French translated strings)

Thanks !

Code: [Select]
crafts:
- type: STR_SENTINEL
requires:
 - STR_SENTINEL_INTERCEPTOR
listOrder: 101
sprite: 21
fuelMax: 400
damageMax: 600
speedMax: 2200
accel: 2
weapons: 2
costSell: 450000
refuelRate: 25
transferTime: 96
score: 250
research:
- name: STR_SENTINEL_INTERCEPTOR
cost: 400
points: 25
dependencies:
 - STR_ALIEN_ALLOYS
 - STR_UFO_NAVIGATION
manufacture:
- name: STR_SENTINEL
category: STR_CRAFT
requires:
 - STR_SENTINEL_INTERCEPTOR
listOrder: 3251
space: 26
time: 8000
cost: 350000
requiredItems:
  - STR_ALIEN_ALLOYS: 35
  - STR_UFO_NAVIGATION: 2
ufopaedia:
- id: STR_SENTINEL
type_id: 1
section: STR_XCOM_CRAFT_ARMAMENT
image_id: SENTINEL_BIG
listOrder: 401
rect_stats:
  x: 5
  y: 132
  width: 140
  height: 60
rect_text:
  x: 5
  y: 40
  width: 310
  height: 60
text: STR_SENTINEL_UFOPEDIA
requires:
 - STR_SENTINEL_INTERCEPTOR
extraSprites:
- type: BASEBITS.PCK
files:
 54: Resources/Sentinel/BASEBITS/Sentinel_Base_View.gif
- type: INTICON.PCK
files:
 21: Resources/Sentinel/INTICON/Sentinel_Minimized.gif
 32: Resources/Sentinel/INTICON/Sentinel_Dogfight.gif
- type: SENTINEL_BIG
singleImage: true
width: 320
height: 200
files:
 0: Resources/Sentinel/UFOPEDIA/Sentinel_Article.gif
extraStrings:
- type: en-US
strings:
  STR_SENTINEL: SENTINEL
  STR_SENTINEL_INTERCEPTOR: Sentinel Interceptor
  STR_SENTINEL_UFOPEDIA: A HEAVY COMBAT AIRCRAFT WITH TWIN SCRAMJET ENGINES AND THE LATEST IN AVIONIC ARMOR TECHNOLOGY. THE TRADEOFF IS A HIGHER LEVEL OF FUEL CONSUMPTION AND A LOW ACCELERATION RATE DUE TO INCREASED WEIGHT.
- type: en-GB
strings:
  STR_SENTINEL: SENTINEL
  STR_SENTINEL_INTERCEPTOR: Sentinel Interceptor
  STR_SENTINEL_UFOPEDIA: A HEAVY COMBAT AIRCRAFT WITH TWIN SCRAMJET ENGINES AND THE LATEST IN AVIONIC ARMOUR TECHNOLOGY. THE TRADEOFF IS A HIGHER LEVEL OF FUEL CONSUMPTION AND A LOW ACCELERATION RATE DUE TO INCREASED WEIGHT.
- type: fr
strings:
  STR_SENTINEL: SENTINEL
  STR_SENTINEL_INTERCEPTOR: Intercepteur Classe Sentinel
  STR_SENTINEL_UFOPEDIA: ENGIN HYBRIDE COMBINANT LES TECHNIQUES DE COMBATS DE L'AVION ET DE L'HELICOPTER. SON BLINDAGE LOURD LIMITE CEPENDANT SON RAYON D'ACTION.
« Last Edit: April 19, 2014, 10:59:36 pm by Human Ktulu »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [French Modpack Project] Mistake in ruleset ...
« Reply #1 on: April 19, 2014, 04:51:51 pm »
Hmm... I can see nothing bad in the code you attached. It might be a matter of syntax (like wrong number of spaces or whatever), but I'm not exactly a master coder either, so it could be something code-related (though my Sentinel is virtually the same, and it works).

What I would do is to add a costBuy flag to check if it comes up on the equipment purchase screen. If it does, then the mod is activated and there's something wrong with research or production. If it doesn't, then the problem is something else.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: [French Modpack Project] Mistake in ruleset ...
« Reply #2 on: April 19, 2014, 05:01:44 pm »
Watch the spacing:

Code: [Select]
crafts:
  - type: STR_SENTINEL
    requires:
      - STR_SENTINEL_INTERCEPTOR
    listOrder: 101
    sprite: 21
    fuelMax: 400
    damageMax: 600
    speedMax: 2200
    accel: 2
    weapons: 2
    costSell: 450000
    refuelRate: 25
    transferTime: 96
    score: 250
research:
  - name: STR_SENTINEL_INTERCEPTOR
    cost: 400
    points: 25
    dependencies:
      - STR_ALIEN_ALLOYS
      - STR_UFO_NAVIGATION
manufacture:
  - name: STR_SENTINEL
    category: STR_CRAFT
    requires:
      - STR_SENTINEL_INTERCEPTOR
    listOrder: 3251
    space: 26
    time: 8000
    cost: 350000
    requiredItems:
      - STR_ALIEN_ALLOYS: 35
      - STR_UFO_NAVIGATION: 2
ufopaedia:
  - id: STR_SENTINEL
    type_id: 1
    section: STR_XCOM_CRAFT_ARMAMENT
    image_id: SENTINEL_BIG
    listOrder: 401
    rect_stats:
      x: 5
      y: 132
      width: 140
      height: 60
    rect_text:
      x: 5
      y: 40
      width: 310
      height: 60
    text: STR_SENTINEL_UFOPEDIA
    requires:
      - STR_SENTINEL_INTERCEPTOR
extraSprites:
  - type: BASEBITS.PCK
    files:
      54: Resources/Sentinel/BASEBITS/Sentinel_Base_View.gif
  - type: INTICON.PCK
    files:
      21: Resources/Sentinel/INTICON/Sentinel_Minimized.gif
      32: Resources/Sentinel/INTICON/Sentinel_Dogfight.gif
  - type: SENTINEL_BIG
    singleImage: true
    width: 320
    height: 200
    files:
      0: Resources/Sentinel/UFOPEDIA/Sentinel_Article.gif
extraStrings:
  - type: en-US
    strings:
      STR_SENTINEL: SENTINEL
      STR_SENTINEL_INTERCEPTOR: Sentinel Interceptor
      STR_SENTINEL_UFOPEDIA: A HEAVY COMBAT AIRCRAFT WITH TWIN SCRAMJET ENGINES AND THE LATEST IN AVIONIC ARMOR TECHNOLOGY. THE TRADEOFF IS A HIGHER LEVEL OF FUEL CONSUMPTION AND A LOW ACCELERATION RATE DUE TO INCREASED WEIGHT.
  - type: en-GB
    strings:
      STR_SENTINEL: SENTINEL
      STR_SENTINEL_INTERCEPTOR: Sentinel Interceptor
      STR_SENTINEL_UFOPEDIA: A HEAVY COMBAT AIRCRAFT WITH TWIN SCRAMJET ENGINES AND THE LATEST IN AVIONIC ARMOUR TECHNOLOGY. THE TRADEOFF IS A HIGHER LEVEL OF FUEL CONSUMPTION AND A LOW ACCELERATION RATE DUE TO INCREASED WEIGHT.
  - type: fr
    strings:
      STR_SENTINEL: SENTINEL
      STR_SENTINEL_INTERCEPTOR: Intercepteur Classe Sentinel
      STR_SENTINEL_UFOPEDIA: ENGIN HYBRIDE COMBINANT LES TECHNIQUES DE COMBATS DE L'AVION ET DE L'HELICOPTER. SON BLINDAGE LOURD LIMITE CEPENDANT SON RAYON D'ACTION.

https://yaml-online-parser.appspot.com/
« Last Edit: April 19, 2014, 05:06:26 pm by SupSuper »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [French Modpack Project] Mistake in ruleset ...
« Reply #3 on: April 19, 2014, 05:09:56 pm »
Watch the spacing:

Ha! I'm a genius! :P

Offline Human Ktulu

  • Colonel
  • ****
  • Posts: 129
  • Cuistre !
    • View Profile
Re: [French Modpack Project] Mistake in ruleset ...
« Reply #4 on: April 19, 2014, 06:19:31 pm »
Thanks à lot for explaination  (and Solarius for the mod ;) ).

But I'm not sure to be all understand ... I have another probleme with mod "Custom grenade", I have only replace espagna translation string by french and the mod shut down ... The most stange it's I have modify 30 mods and only this 2 mods have the problem ???

Code: [Select]
items:
  - type: STR_INCENDIARY_GRENADE
    size: 0.1
    costSell: 4000
    weight: 3
    bigSprite: 27
    floorSprite: 27
    power: 60
    damageType: 2
    battleType: 4
    armor: 20
    blastRadius: 6
    listOrder: 4001
  - type: STR_STUN_GRENADE
    size: 0.1
    costSell: 25000
    weight: 3
    bigSprite: 59
    floorSprite: 37
    power: 90
    blastRadius: 6
    damageType: 6
    battleType: 4
    armor: 20
    listOrder: 5901
research:
  - name: STR_INCENDIARY_GRENADE
    cost: 200
    points: 10
    listOrder: 601
  - name: STR_STUN_GRENADE
    cost: 200
    points: 10
    dependencies:
      - STR_SMALL_LAUNCHER
      - STR_STUN_BOMB
    listOrder: 4401
manufacture:
  - name: STR_INCENDIARY_GRENADE
    category: STR_WEAPON
    requires:
      - STR_INCENDIARY_GRENADE
    space: 2
    time: 150
    cost: 3200
    listOrder: 1101
  - name: STR_STUN_GRENADE
    category: STR_WEAPON
    requires:
      - STR_STUN_GRENADE
    space: 2
    time: 200
    cost: 5100
    requiredItems:
      STR_STUN_BOMB: 1
    listOrder: 2401
ufopaedia:
  - id: STR_INCENDIARY_GRENADE
    type_id: 4
    section: STR_WEAPONS_AND_EQUIPMENT
    text: STR_INCENDIARY_GRENADE_UFOPEDIA
    requires:
      - STR_INCENDIARY_GRENADE
    listOrder: 4201
  - id: STR_STUN_GRENADE
    type_id: 4
    section: STR_WEAPONS_AND_EQUIPMENT
    requires:
      - STR_STUN_GRENADE
    text: STR_STUN_GRENADE_UFOPEDIA
    listOrder: 5801
extraSprites:
  - type: BIGOBS.PCK
  files:
      59: Resources/CustomGrenades/StunGrenade.png
extraStrings:
  - type: en-US
    strings:
      STR_INCENDIARY_GRENADE: Incendiary Grenade
      STR_STUN_GRENADE: Stun Grenade
      STR_INCENDIARY_GRENADE_UFOPEDIA: Incendiary grenades are invaluable for lighting up the night and clearing obnoxious vegetation.
      STR_STUN_GRENADE_UFOPEDIA: Learning how the stun bomb is activated has allowed us to attach a trigger to it, turning it into a grenade that can be primed and thrown normally.
  - type: en-GB
    strings:
      STR_INCENDIARY_GRENADE: Incendiary Grenade
      STR_STUN_GRENADE: Stun Grenade
      STR_INCENDIARY_GRENADE_UFOPEDIA: Incendiary grenades are invaluable for lighting up the night and clearing obnoxious vegetation.
      STR_STUN_GRENADE_UFOPEDIA: Learning how the stun bomb is activated has allowed us to attach a trigger to it, turning it into a grenade that can be primed and thrown normally.
   - type: fr
   strings:
      STR_INCENDIARY_GRENADE: Grenade Incendiaire
      STR_STUN_GRENADE: Grenade Assomante
      STR_INCENDIARY_GRENADE_UFOPEDIA: Les grenades incendiaires sont très éfficace pour éclaircir la nuit et/ou la végétation.
      STR_STUN_GRENADE_UFOPEDIA: S'utilise comme une granade standard et permet de capturer des aliens vivants.

And last question, what is "listOrder" command ?

Thanks a lot, again :D
« Last Edit: April 19, 2014, 06:21:34 pm by Human Ktulu »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [French Modpack Project] Mistake in ruleset ...
« Reply #5 on: April 19, 2014, 06:25:26 pm »
Thanks, but it wasn't my mod... The Sentinel was made by Warboy, I said "my code" referring to the one I have on my disc. :) (Which I, admittedly, modified a little in an attempt to balance several craft mods.)

The listOrder command places your new item - a grenade in this case - in a particular position on various in-game lists, such as purchase/selling list or craft equipment list. I highly recommend reading this article for more information on flags, and ruleset in general. It may also solve your main problem.

Offline Human Ktulu

  • Colonel
  • ****
  • Posts: 129
  • Cuistre !
    • View Profile
Re: [French Modpack Project] Mistake in ruleset ...
« Reply #6 on: April 19, 2014, 06:33:34 pm »
Ah ! I just understand how work YAML Parser !
All work now !

I will read the Ruleset wiki ^^

Offline Human Ktulu

  • Colonel
  • ****
  • Posts: 129
  • Cuistre !
    • View Profile
Re: Mistake in ruleset ...
« Reply #7 on: April 19, 2014, 10:57:33 pm »
I have another question :p

I begin french translation string for few mods, but I see specials caracteres (é,è,à,ç, ...) are don't show in-game. Exemple :
Code: [Select]
      STR_COMBAT_KNIFE: Poignard de combat
      STR_COMBAT_KNIFE_UFOPEDIA: Arme de combat rapproché qui permet d'éliminer une cible légèrement protégé.{NEWLINE}Son utilisation délicate est réservé aux unités spécialement entrainés aux techniques d'infiltrations.

Edit : I see that :
Quote
It's because your files are in ANSI and OpenXcom uses UTF-8. I've fixed this on my end, for future reference, you can change this in Notepad's Save As.
« Last Edit: April 19, 2014, 11:03:01 pm by Human Ktulu »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [Resolved] Find mistake in ruleset ?
« Reply #8 on: April 20, 2014, 12:57:20 am »
I think it causes trouble if you add more than one non-English language to the same .rul file. I had the same problem with Polish. It's mostly speculation though; I remember someone said something like this, but I need to find it again. I'll try :)