OpenXcom Forum

Modding => Help => Topic started by: Snowfield on January 06, 2018, 03:03:03 am

Title: Two questions.
Post by: Snowfield on January 06, 2018, 03:03:03 am
Hey, folks. I couldn't dig up an answer for these on my own, which leads me to believe they're not possible:

1. Is there any way in either the base ruleset or in OXCE(+) to define a unit's rate of energy consumption when moving, as per offset 45 in UNITREF.DAT?

2. Is there a way to make undeveloped squares in a base defense use a map block that isn't solid dirt, if one wished to represent above-ground bases?
Title: Re: Two questions.
Post by: ohartenstein23 on January 06, 2018, 03:28:53 am
I don't know about the first question, but I wrote the OXCE+ code to do exactly the second.  See here for a reference (https://openxcom.org/forum/index.php/topic,5316.0.html).
Title: Re: Two questions.
Post by: Warboy1982 on January 06, 2018, 03:56:03 am
1: no. energy consumption is a factor of time unit consumption. you CAN however enable 'alternate movement methods' to allow sprinting, which burns less time units and more energy to move.
2: yes. mapscripts can easily FillArea with an array of mapblocks rather than simply using dirt.
Title: Re: Two questions.
Post by: Solarius Scorch on January 06, 2018, 06:42:16 pm
While energy consumption is constant, in OXCE+ (I think only there) you can modify energy regeneration. Of course it's a bit different and I'm not sure if it meets your needs, but you might want to know about it.
Title: Re: Two questions.
Post by: Snowfield on January 10, 2018, 11:12:06 am
Thanks for the help, fellas. I've got more questions I couldn't pin down the answers to.

1. Is there a way to add LOFtemps via ruleset?

2. From what I can see, sight and shot height are magicnumbered at 1 and 4 voxels respectively below the topmost of the unit; is this so?

3. What do createsMeleeThreat and ignoresMeleeThreat (OXCE+) do, exactly? My inference is that they're just flags to help the AI of whether a unit is capable of conducting, or is at risk of, melee attacks, but I couldn't find the original post to confirm.
Title: Re: Two questions.
Post by: ohartenstein23 on January 10, 2018, 02:59:52 pm
The melee threat tags are an extension of the close quarters combat (https://openxcom.org/forum/index.php/topic,5431.msg82188.html#msg82188) feature, defining whether or not a unit can cause another to undergo the CQC check when firing (createsMeleeThreat) and whether the unit can ignore CQC checks (ignoresMeleeThreat).
Title: Re: Two questions.
Post by: Hobbes on January 10, 2018, 08:32:05 pm
1. Is there a way to add LOFtemps via ruleset?

No. It might be possible to edit the LOFTemps file to add additional shapes, but to my knowledge no one has ever tried it
Title: Re: Two questions.
Post by: Snowfield on January 18, 2018, 09:57:20 am
Just one question this time. I've seen posts mentioning the ability to restrict inventory slots only to certain items, but if it's been implemented I can't for the life of me find a post detailing it.
Title: Re: Two questions.
Post by: Meridian on January 18, 2018, 10:36:44 am
Just one question this time. I've seen posts mentioning the ability to restrict inventory slots only to certain items, but if it's been implemented I can't for the life of me find a post detailing it.

You can make an armor, with fixed item(s), and make these item(s):
- fixed to a specific slot (e.g. backpack)...
- non-transparent black (i.e. if you wanted to simulate a disappearing slot)

Code: [Select]
armors:
  - type: STR_SYNTH_SPACE_SUIT_UC
    spriteSheet: PIR_674.PCK
    spriteInv: MAN_675
    customArmorPreviewIndex: 79
    builtInWeapons:
      - INV_NULL_3X3     # blocks backpack
      - INV_NULL_2X1_B   # blocks belt
      - INV_NULL_1X1_RS  # right shoulder
      - INV_NULL_1X1_LS  # left shoulder
      - INV_NULL_1X1_LL  # left leg
      - INV_NULL_1X1_RL  # right leg
items:
  - type: INV_NULL_3X3
    weight: 0
    bigSprite: 829
    invWidth: 3
    invHeight: 3
    fixedWeapon: true
    defaultInventorySlot: STR_BACK_PACK
    recover: false
#
etc.
Title: Re: Two questions.
Post by: Snowfield on January 18, 2018, 11:41:50 am
I poked through the code just now and supportedInventorySections is actually what I was looking for. It's a per-item restriction, though, so if one wanted to have a slot only accept certain items then I suppose one would have some amount of copy-pasting to look forward to.

Thankfully, I've been wasting all my time typing up design and reference documents, so I haven't actually implemented a damn thing~