aliens

Author Topic: Help with a mod  (Read 4309 times)

Offline Dogstar359

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Help with a mod
« on: February 17, 2019, 01:26:06 pm »
Hi just recently joined i have a slight problem well a few but anyway.

Ive built a new craft, and using OXCE given it shields. I then created a new recoverable item called "UFO Shield Generator" created the research topics ect... then, using MCDEdit in the Target_Type:59 box i entered a value of 15 so that the entry would appear on the recovered items list. Of course it does, but it appears at the bottom of the list. Is there a way of making it appear above "UFO Power Source" i know that there is a command called listOrder but there isnt anything for the UFO Recovery Screen. I actually know why its doing it, its because of the Target_Type:59 in MCDEdit because i set a value of 15
it will appear at the bottom of the list, and i cant set it to a lower number beacuse there all mapped to different ufo components.

Also  i want  to ask if anyone knows how to make items explode on mission start like the "UFO Power Source" as i want to do the same for my Shield Generator, but cant find anything in the ruleset to help me?

Thanks

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
Re: Help with a mod
« Reply #1 on: February 17, 2019, 09:35:44 pm »
Welcome!

To reorder items in loot section you must use rule listOrder in item description. Look which number to use you can here: https://www.ufopaedia.org/index.php/Ruleset_List_Order_(OpenXcom)
If you want your item before alien power source, you must use number between 9500 and 9600.

Explosions of alien power sources are hardcoded and depends on ufo damage level.
But you can place an invisible grenade in your shield generator, with timer sent to 1.
Like in XPirates:
Code: [Select]
  - name: COMPLEXGHOUL
    mapDataSets:
      - BLANKS
      - AREA51_A3
      - AREA51_B2
      - AREA51_C2
      - AREA51_DGHOULE
    civilianTypes:
      - MALE_CIVILIAN
      - FEMALE_CIVILIAN
      - CIVILIAN_MUT_3
      - CIVILIAN_MUT_4
      - CIVILIAN_MUT_5
    script: COMPLEXURBAN
    mapBlocks:
      - name: COMPLEXURBAN00
        width: 10
        length: 10
        items:
          STR_DAMSEL_VICTIM:
            - [4, 8, 1]
          TIMEBOMB_FUMES:
            - [2, 1, 0]
            - [6, 2, 0]
            - [8, 7, 0]
            - [2, 8, 0]
            - [5, 4, 0]
            - [2, 1, 0]
            - [6, 2, 0]
            - [8, 7, 0]
            - [2, 8, 0]
            - [5, 4, 0]
        fuseTimers:
          TIMEBOMB_FUMES: [0, 50]
Here defined a terrain with one mapblock, containing set of explosive items. And these timebombs will explode in random turns between 0 and 50.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9105
    • View Profile
Re: Help with a mod
« Reply #2 on: February 17, 2019, 09:48:09 pm »
Explosions of alien power sources are hardcoded and depends on ufo damage level.

Just to correct a little bit, damage level is not a factor... every crashed UFO has a 75% chance for each power source to explode.

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
Re: Help with a mod
« Reply #3 on: February 18, 2019, 10:21:45 am »
Just to correct a little bit, damage level is not a factor... every crashed UFO has a 75% chance for each power source to explode.
Well theoretically...
If damage >0, then 75%, else 0%.  :)

Offline Dogstar359

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Re: Help with a mod
« Reply #4 on: February 18, 2019, 10:22:54 am »
I messed with the listOrder command in my items.rul

  - type: STR_UFO_SHIELD_GENERATOR
    listOrder: 9510
    size: 1.2
    costSell: 500000
    specialType: 15
    recoveryPoints: 40

in research.rul its

  - name: STR_UFO_SHIELD_GENERATOR
    listOrder: 4910
    cost: 850
    points: 60
    needItem: true

and in ufopedia.rul its

  - id: STR_UFO_SHIELD_GENERATOR
    listOrder: 11010
    type_id: 7
    section: STR_UFO_COMPONENTS
    requires:
      - STR_UFO_SHIELD_GENERATOR
    image_id: SHIELD_GENERATOR.SPK
    text: STR_UFO_SHIELD_GENERATOR_UFOPEDIA
    text_width: 163

everything seems to be right except for the UFO Recovery screen the one you get after you complete your mission it appears like this.

UFO RECOVERY

UFO Power Source          4    80
UFO Navigation               4    20
Alien Enterainment        24   48
Alien Alloys                   238 238
UFO Shield Generator      1    40
Elerium-115                  200   20

Ive got a feeling its hardcoded  :'( but what i was trying to do was this

UFO RECOVERY

UFO Shield Generator     1    40
UFO Power Source          4    80
UFO Navigation               4    20
Alien Enterainment        24   48
Alien Alloys                   238 238
Elerium-115                  200   20

Also are there any guides on using mapview2 im having trouble creating certain walls either i walk through them or i cant step on them at all.

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
Re: Help with a mod
« Reply #5 on: February 18, 2019, 02:56:46 pm »

UFO Power Source          4    80
UFO Navigation               4    20
Alien Enterainment        24   48
Alien Alloys                   238 238
UFO Shield Generator      1    40
Elerium-115                  200   20
Looks like you are right. This is order of mcd TargetType.
Quote
Also are there any guides on using mapview2 im having trouble creating certain walls either i walk through them or i cant step on them at all.
I think your problem is - placing wall in wrong slot of map cell.
There is four of them - floor, west wall, north wall, object. So west wall, placed in, lets say, north wall slot, will be passable through, but drawed as it should.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: Help with a mod
« Reply #6 on: February 18, 2019, 08:43:39 pm »
I think your problem is - placing wall in wrong slot of map cell.
There is four of them - floor, west wall, north wall, object. So west wall, placed in, lets say, north wall slot, will be passable through, but drawed as it should.

yes, anything and everything from TU usage to explosion propagation depends on tileparts in the correct slots

it's a rule that can be broken, but i suggest it only if you really really know what you're doing.