Author Topic: New to modding openXcom. How to begin?  (Read 10620 times)

Offline Fat_Pokemon

  • Sergeant
  • **
  • Posts: 10
  • Blocking the road.
    • View Profile
New to modding openXcom. How to begin?
« on: June 12, 2013, 01:05:33 pm »
Hello people of the fourm.

I'm a newcomer here, but i've been playing X-Com since it existed in the 90's.

After looking around on the fourms here i couldn't find anything like a tutorial on how to actually mod openXcom. Does one actually exist? If so, a direction towards it would be really appricated.

Offline Nightwolf

  • Captain
  • ***
  • Posts: 70
    • View Profile
Re: New to modding openXcom. How to begin?
« Reply #1 on: June 12, 2013, 01:10:01 pm »
Download some mod already done, and just tweak it. Basically you can change ruleset, adding new items, gfx, sounds, etc.

Offline Fat_Pokemon

  • Sergeant
  • **
  • Posts: 10
  • Blocking the road.
    • View Profile
Re: New to modding openXcom. How to begin?
« Reply #2 on: June 12, 2013, 01:12:13 pm »
So there is no real tutorial?

Dang... well i guess that will have to do.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: New to modding openXcom. How to begin?
« Reply #3 on: June 12, 2013, 01:17:53 pm »
the modability features are still being developed, hence the lack of documentation, but if you'd like to write a guide, i'd like to help you.

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: New to modding openXcom. How to begin?
« Reply #4 on: June 12, 2013, 01:48:31 pm »
I've got a pretty cool idea for a mod, and I'm now not working tomorrow (had to change my days), so if you're about on IRC, Warboy, I'll try and pop on and we can go through making my mod, and I'll document it as we go

Offline Fat_Pokemon

  • Sergeant
  • **
  • Posts: 10
  • Blocking the road.
    • View Profile
Setting weapon max range.
« Reply #5 on: June 12, 2013, 02:11:07 pm »
Quick question if that's ok.

Is there any way to set the max range of a weapon if possible? All i can see in the values of the ruleset file is either firearm or melee.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Setting weapon max range.
« Reply #6 on: June 12, 2013, 02:42:08 pm »
just go ahead and define a maxRange: in your ruleset, if functionality for it doesn't exist yet, it will soon, i need it too :P

Offline Fat_Pokemon

  • Sergeant
  • **
  • Posts: 10
  • Blocking the road.
    • View Profile
Understanding where all the files are?
« Reply #7 on: June 12, 2013, 04:47:18 pm »
Hello, me again on the same day.

I've built myself a ruleset to create a new research item, manufacturing item, UFOpedia entry for that item, and the item itself for combat.

With that in mind, where do the files the game relate to in the openxcom directory (The so called STR entries)? I can't find them anywhere.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Understanding where all the files are?
« Reply #8 on: June 12, 2013, 05:17:21 pm »
they're the .lng files in data/language, but you don't need to edit those, you can define extraStrings in the ruleset.
for example:

Code: [Select]
extraStrings:
  - type: English
    strings:
      STR_SNIPER_RIFLE: Sniper Rifle
      STR_SNIPER_RIFLE_CLIP: Sniper Rifle Clip

Offline Fat_Pokemon

  • Sergeant
  • **
  • Posts: 10
  • Blocking the road.
    • View Profile
Firearm not appearing in Skyranger equipment screen
« Reply #9 on: June 12, 2013, 07:56:02 pm »
Ah.. so that's what that is for. Thanks ;D

--- posts merged ---

After researching and building my new weapon that i've created, i try putting it inside a skyranger so it could be used for a mission.

It doesn't appear. I check my base's inventory to see if it does exist, which it does. Am i doing something wrong?

  - type: STR_WEAPON_EXAMPLE
    size: 0.1
    invWidth: 2
    invHeight: 2
    weight: 2
    battleType: 1
    power: 80
    damageType: 6
    armor: 10
    clipSize: 3
    maxRange: 5
    attraction: 1
    accuracySnap: 50
    accuracyAimed: 65
    tuSnap: 30
    tuAimed: 50
    costSell: 28000
    bigSprite: -1
    floorSprite: -1
    handSprite: -1
    bulletSprite: -1
    fireSound: -1
    hitSound: -1

(Note, the sprite hasn't been made yet)
« Last Edit: February 07, 2016, 11:33:41 am by Solarius Scorch »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Firearm not appearing in Skyranger equipment screen
« Reply #10 on: June 12, 2013, 07:59:31 pm »
you need to define a bigsprite or it won't show up.

Offline Fat_Pokemon

  • Sergeant
  • **
  • Posts: 10
  • Blocking the road.
    • View Profile
Re: New to modding openXcom. How to begin?
« Reply #11 on: June 12, 2013, 08:01:34 pm »
Ah.. ok then. Thanks, i'll give that a go. I'll just use a placeholder for now from another item.

*Edit* Hmm... i've gotten it to appear in battle now, so that's good progress for me, however i got 2 issues with my weapon.

1 - Is there a way to give it limited ammo without using a ammo clip of some sort?
2 - The UFOpedia screen doesn't even notice my new item, dispite a profile created via code for it

ufopaedia:
  - id: STR_WEAPON_EXAMPLE
    type_id: 4
    section: STR_WEAPONS_AND_EQUIPMENT
    requires:
      - STR_WEAPON_EXAMPLE
    text: STR_WEAPON_EXAMPLE_UFOPEDIA
« Last Edit: June 12, 2013, 08:21:11 pm by Fat_Pokemon »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: New to modding openXcom. How to begin?
« Reply #12 on: June 12, 2013, 08:34:36 pm »
1: i'll fix this, your item definition shouldn't need changing.
2:
Code: [Select]
ufopaedia:
  - id: STR_WEAPON_EXAMPLE
    type_id: 4
    section: STR_WEAPONS_AND_EQUIPMENT
    requires:
      - STR_WEAPON_EXAMPLE_RESEARCH_TOPIC
    text: STR_WEAPON_EXAMPLE_UFOPEDIA

the "requires" section refers to the associated research topic. maybe that's the problem?

also, you might want to add list weights.
Toshiaki's Sniper Rifle
is inserted into lists after "rifle clip"

every item has a list weight, starting at 100, and going up by increments of 100 for every item defined, so for example, rifle clip is 2200, laser rifle is 3600 and so on.
set your item's weight to something above that of the item you want it to appear below. (for example 2201)

the following items have list weights:

facilities,
crafts,
items (and by extension, craft weapons and soldier armors),
research topics,
manufacturing projects,
ufopaedia entries.
« Last Edit: June 12, 2013, 08:36:54 pm by Warboy1982 »

Offline Fat_Pokemon

  • Sergeant
  • **
  • Posts: 10
  • Blocking the road.
    • View Profile
Re: New to modding openXcom. How to begin?
« Reply #13 on: June 12, 2013, 09:16:10 pm »
Alrighty.. that fixed my UFOpedia problem. Thanks mate.

Just a quick question before i retire this morning (4am here). What's the list weight of a stun rod?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: New to modding openXcom. How to begin?
« Reply #14 on: June 13, 2013, 12:33:29 pm »
stun rod:
  item: 4500              (it's the 45th item listed in the ruleset)
  ufoPaedia: 4700     (it's the 47th ufopaedia entry in the ruleset)

--- posts merged ---

Quick question if that's ok.

Is there any way to set the max range of a weapon if possible? All i can see in the values of the ruleset file is either firearm or melee.

just added this.
« Last Edit: February 07, 2016, 11:33:00 am by Solarius Scorch »