aliens

Author Topic: [OLD] Old OXCE discussion thread  (Read 674844 times)

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3209
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #825 on: July 04, 2016, 10:05:56 pm »

Some time ago a similar bug was fixed in the main openxcom branch.
https://github.com/SupSuper/OpenXcom/commit/ab552fb0aa7b16ef29f3c178bddcbb0b9546903b
Thanks, you save me some hours of work to figuring out this bug :)

[ps]

Ok I probably fixed all this bugs. Geoscape hanging is because each research project try find alien with that same name and this cause new line in debug log.
This is VERY slow. Today or tumorrow I will release new version 3.1 with bug fix and some new functionality.
« Last Edit: July 05, 2016, 01:59:27 am by Yankes »

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8626
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #826 on: July 05, 2016, 09:10:58 am »
The compilation on VS2015 with the fix works now, but when I tried to merge the whole branch I got several errors because of mismatch between std::set and std::vector where getProvidedBaseFunc is used (https://github.com/Yankes/OpenXcom/commit/ad27f8deefb69a3cc8797a138478635f5ed22a7e). Sometimes it's set, sometimes vector.

Also, you may want to rename forbidenBaseFunc to forbiddenBaseFunc, just for spelling correctness before you release 3.1 :)

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3209
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #827 on: July 05, 2016, 01:58:46 pm »
please cherry pick only one commit, I push my working copy of 3.1 and one bug slip in it. Sorry for not saying this clearly previously.

[ps]

https://github.com/Yankes/OpenXcom/commit/5dad96d0c2d955b1df02fdee4516a5dd08f88aeb
I push commits that fix bugs that you encounter. I prefer if you cherry-pick then because I don't finished yet 3.1. It will take me around day to finish it.
« Last Edit: July 05, 2016, 02:03:32 pm by Yankes »

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8626
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #828 on: July 05, 2016, 06:24:36 pm »
Finally! Awesome!  Grr and I can't really work on the mod now! :) Does your build include all the latest Meridian's changes? Or is it just 'base' and we have to wait for Meridian to make his own build with all non-mechanic extras?

OXCE+ 3.0 is ready here: https://openxcom.org/forum/index.php/topic,4187.0.html

I tried the Commendations too (Draco's package)... looks to be working in general, but I guess it will require a lot of polishing.
Btw. where is the latest official Commendations mod? There are so many different versions floating around :(

@Ivan: I have the Draco's package (https://openxcom.org/forum/index.php/topic,3626.msg56043.html#msg56043) and some medals just say "PlaceHolder"... is this something you have abandoned? or are still working on? or don't know about at all?

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: [EXE] OpenXcom Extended
« Reply #829 on: July 05, 2016, 07:41:26 pm »
@Ivan: I have the Draco's package (https://openxcom.org/forum/index.php/topic,3626.msg56043.html#msg56043) and some medals just say "PlaceHolder"... is this something you have abandoned? or are still working on? or don't know about at all?

I believe the latest official Commendations Mod should be in Shoe's thread. (https://openxcom.org/forum/index.php/topic,1718.msg55250.html#msg55250)
Soldier Diaries was merged into the nightlies, so we should be tracking soldier kills etc, now.

I haven't worked on Commendations for a while (about a year or more iirc).  There is a "Place Holder" medal iirc that is meant to be just that.  If a medal was created after I stopped working on it, the placeholder image is available to fill in.  I'm not sure which are using it now or not.

The simple ribbons in Commendations are fine, such as they are, but I think there might have been some discussion on changing the formatting to something else entirely, such as tattoos or gems/jewelry etc.  This would require re-coding how the graphics are displayed, etc.

I see Draco has given the commendations a Face lift with Piratey names and Piratey descriptions.  I'm not sure if these will fit directly with the current commendations requirements settings.  For example, some awards are given for vanilla races/foes. (Also worth noting, I think there might be a lingering bug or two in the awards that Shoes was still sorting out. i.e. awards being given undeservedly, and or awards with two criteria not working correctly.)

Anyway, I think I'll fire up a PirateZ Commendations thread, and try to compile stuff there instead of thread jacking this one.

« Last Edit: July 05, 2016, 10:00:29 pm by ivandogovich »

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3209
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #830 on: July 07, 2016, 03:48:28 pm »
This is script that will work in 3.1 that allow altering corpse graphic based on unit state.
Code: [Select]
extended:
  tags:
    RuleArmor:
      CORPSE_SWITCH_ENABLED: int
      CORPSE_SWITCH_RESOURCES_MOD: RuleList
      CORPSE_SWITCH_SPRITE_STUN: int
      CORPSE_SWITCH_SPRITE_WOUND: int
      CORPSE_SWITCH_SPRITE_DEAD: int
     
  scripts:
    selectItemSprite:
      - offset: 1
        code: |
          var int curr_hp;
          var int curr_wounds;
          var int temp;
          var ptr BattleUnit unit;
          var ptr RuleArmor armor;
         
          item.getBattleUnit unit;
          unit.getRuleArmor armor;
          if neq armor null;
            if eq blit_part blit_item_floor;
              unit.getHealth curr_hp;
              unit.getFatalwoundsTotal curr_wounds;
              armor.getTag temp Tag.CORPSE_SWITCH_ENABLED;
              if eq temp 1;
                if le curr_hp 0;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_DEAD;
                else gt curr_wounds 0;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_WOUND;
                else;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_STUN;
                end;
                armor.getTag temp Tag.CORPSE_SWITCH_RESOURCES_MOD;
                rules.getSpriteOffsetFloorob sprite_index temp;
                return sprite_index;
              end;
            end;
          end;
          return sprite_index;
#usage
armors:
  - type: STR_NONE_UC
    tags:
      CORPSE_SWITCH_ENABLED: 1 #1 enable this functionality for this unit, 0 disable
      CORPSE_SWITCH_RESOURCES_MOD: master #to what mod sprites belongs to, `current` mean this mod.
      CORPSE_SWITCH_SPRITE_STUN: 39
      CORPSE_SWITCH_SPRITE_WOUND: 40
      CORPSE_SWITCH_SPRITE_DEAD: 42

I will add some small features to 3.1 and I will release it soon.
« Last Edit: July 08, 2016, 05:43:42 pm by Yankes »

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3209
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #831 on: July 07, 2016, 10:45:03 pm »
New version 3.1 is ready:

Base building can now prevent building other buildings.
New tag type that store other mod id.
Option for changing defualt unit light radius.
New functions exposed to script.
Reaction scripts have now information about runing or strafing of target.

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: [EXE] OpenXcom Extended
« Reply #832 on: July 07, 2016, 11:11:06 pm »
Some questions about Scripts:

Can I have the Script in its own separate .rul file in the mod folder, or does it need to be included in the .rul file that calls the script functions?

Second: in your corpse replacement script example:  Will this same script work to define both FloorObs and BigObs?   or would something here:
Code: [Select]
if eq blit_part blit_item_floorneed to be updated for the BigObs?

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3209
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #833 on: July 08, 2016, 12:35:50 am »
Some questions about Scripts:

Can I have the Script in its own separate .rul file in the mod folder, or does it need to be included in the .rul file that calls the script functions?

Second: in your corpse replacement script example:  Will this same script work to define both FloorObs and BigObs?   or would something here:
Code: [Select]
if eq blit_part blit_item_floorneed to be updated for the BigObs?
right I did it only for FloorObs. You probaby need copy paste this `if` to `end` replaced `getSpriteOffsetFloorob` with `getSpriteOffsetBigobs`.
Add new tags that will store index for bigobs.

And for where script should go. You can place in any `.rul` file, but in each file you need add `extended->tags->RuleArmor`. If armors and script would be in different files you need copy this tags to both files.

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: [EXE] OpenXcom Extended
« Reply #834 on: July 08, 2016, 01:13:26 am »
Okay, I think I have it.   Here is my proposed script:

Code: [Select]
extended:
  tags:
    RuleArmor:
      CORPSE_SWITCH_ENABLED: int
      CORPSE_SWITCH_RESOURCES_MOD: RuleList
      CORPSE_SWITCH_SPRITE_FLOOR_STUN: int
      CORPSE_SWITCH_SPRITE_FLOOR_WOUND: int
      CORPSE_SWITCH_SPRITE_FLOOR_DEAD: int
      CORPSE_SWITCH_SPRITE_BIG_STUN: int
      CORPSE_SWITCH_SPRITE_BIG_WOUND: int
      CORPSE_SWITCH_SPRITE_BIG_DEAD: int
     
  scripts:
    selectItemSprite:
      - offset: 1
        code: |
          var int curr_hp;
          var int curr_wounds;
          var int temp;
          var ptr BattleUnit unit;
          var ptr RuleArmor armor;
         
          item.getBattleUnit unit;
          unit.getRuleArmor armor;
          if neq armor null;
            if eq blit_part blit_item_floor;
              unit.getHealth curr_hp;
              unit.getFatalwoundsTotal curr_wounds;w
              armor.getTag temp Tag.CORPSE_SWITCH_ENABLED;
              if eq temp 1;
                if le curr_hp 0;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_DEAD;
                else gt curr_wounds 0;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_WOUND;
                else;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_STUN;
                end;
                armor.getTag temp Tag.CORPSE_SWITCH_RESOURCES_MOD;
                rules.getSpriteOffsetFloorob sprite_index temp;
                return sprite_index;
              end;
            if eq blit_part blit_item_floor;
              unit.getHealth curr_hp;
              unit.getFatalwoundsTotal curr_wounds;w
              armor.getTag temp Tag.CORPSE_SWITCH_ENABLED;
              if eq temp 1;
                if le curr_hp 0;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_DEAD;
                else gt curr_wounds 0;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_WOUND;
                else;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_STUN;
                end;
                armor.getTag temp Tag.CORPSE_SWITCH_RESOURCES_MOD;
                rules.getSpriteOffsetBigobs sprite_index temp;
                return sprite_index;
              end;
            end;
          end;
          add sprite_index sprite_offset;
          return sprite_index;
#usage
armors:
  - type: STR_NONE_UC
    tags:
      CORPSE_SWITCH_ENABLED: 1 #1 enable this functionality for this unit, 0 disable
      CORPSE_SWITCH_RESOURCES_MOD: current #to what mod sprites belongs to, `current` mean this mod.
#      CORPSE_SWITCH_RESOURCES_MOD: master #to what mod sprites belongs to, `current` mean this mod.
      CORPSE_SWITCH_SPRITE_FLOOR_STUN: 1001
      CORPSE_SWITCH_SPRITE_FLOOR_WOUND: 1002
      CORPSE_SWITCH_SPRITE_FLOOR_DEAD: 1003
      CORPSE_SWITCH_SPRITE_BIG_STUN: 2001
      CORPSE_SWITCH_SPRITE_BIG_WOUND: 2002
      CORPSE_SWITCH_SPRITE_BIG_DEAD: 2003

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3209
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #835 on: July 08, 2016, 01:41:17 am »
You made couple of mistaken, here fixed version:
Code: [Select]
  scripts:
    selectItemSprite:
      - offset: 1
        code: |
          var int curr_hp;
          var int curr_wounds;
          var int temp;
          var ptr BattleUnit unit;
          var ptr RuleArmor armor;
         
          item.getBattleUnit unit;
          unit.getRuleArmor armor;
          if neq armor null;
            unit.getHealth curr_hp;
            unit.getFatalwoundsTotal curr_wounds;
            armor.getTag temp Tag.CORPSE_SWITCH_ENABLED;
            if eq temp 1;
              armor.getTag temp Tag.CORPSE_SWITCH_RESOURCES_MOD;
              if eq blit_part blit_item_floor;
                if le curr_hp 0;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_FLOOR_DEAD;
                else gt curr_wounds 0;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_FLOOR_WOUND;
                else;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_FLOOR_STUN;
                end;
                rules.getSpriteOffsetFloorob sprite_index temp;
                return sprite_index;
              else eq blit_part blit_item_big;
                if le curr_hp 0;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_BIG_DEAD;
                else gt curr_wounds 0;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_BIG_WOUND;
                else;
                  armor.getTag sprite_index Tag.CORPSE_SWITCH_SPRITE_BIG_STUN;
                end;
                rules.getSpriteOffsetBigobs sprite_index temp;
                return sprite_index;
              end;
            end;
          end;
          return sprite_index;

How you choose sprite indexs? In what mod you plan add this graphics?

[ps]

New version, previous had bug.
« Last Edit: July 08, 2016, 05:44:16 pm by Yankes »

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: [EXE] OpenXcom Extended
« Reply #836 on: July 08, 2016, 02:00:14 am »
Awesome, Yankes! Thanks for spotting those!  I knew you would be able to spot any mistakes I made there!

I'll be working the alt-corpses up for Piratez.  It will be a stand alone mod, so I'll create my own sprite index for the mod (using "current") as the overall index for sprites in Piratez is very extensive.  I'll number the floor obs in the 1000s and the big obs in the 2000s or vica versa.

Also: Now that this functionality is in 3.1 has the "bigSpriteAlt"  (and floorSpriteAlt?)  been deprecated?  Or will it still be there for a while?

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3209
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #837 on: July 08, 2016, 01:07:26 pm »
"bigSpriteAlt" was drop in 3.0.

And for sprites, if you choose value bigger that last index in piratez it should work, but need be less than last+1000 otherwise you will overlap with next mod.
Good thing is that you can easy split resources part into two mods and only define tags in other to have same functionality.

[ps]

btw I can take couple of small request for new functionality. I plan doing couple of small releases (3.2 to 3.4) and one big one 3.5 with merge of current master.

[ps2]

@ivandogovich I update script again because I made bug in it too.
« Last Edit: July 08, 2016, 05:47:04 pm by Yankes »

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: [EXE] OpenXcom Extended
« Reply #838 on: July 11, 2016, 04:22:52 pm »
Is it possible to change master settings for damage types through ruleset? Manually resetting RandomStun from false to true for every non-stun weapon seems insane; same goes for other settings I would like to add to every weapon dealing certain damage type, like armor piercing for all laser weapons.
« Last Edit: July 11, 2016, 04:27:50 pm by Dioxine »

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3209
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #839 on: July 11, 2016, 06:53:57 pm »
Is it possible to change master settings for damage types through ruleset? Manually resetting RandomStun from false to true for every non-stun weapon seems insane; same goes for other settings I would like to add to every weapon dealing certain damage type, like armor piercing for all laser weapons.

I could say that in 80% you can do something like that, you will still need change every weapon but only once:

Code: [Select]
customDefalutStunWeapon: &refStun
  damageType: 5
  damageAlter:
    RandomStun: true

customDefalutStunAPWeapon: &refStunAP
  refNode: *refStun #share values from `refStun`
  damageAlter:
    ArmorEffectiveness: 0.5

items:
  - type: SOME_STUN
    refNode:  *refStun
    # `damageType` need be commentout otherwise it will override values from `refStun`
    #damageType: 5
  - type: SOME_STUN_2
    refNode:  *refStun
  - type: SOME_STUN_3
    refNode:  *refStun
  - type: SOME_STUN_4
    refNode:  *refStunAP #no with AP
  - type: SOME_STUN_5
    refNode:  *refStunAP

Its need more work than global switch but it lot more powerful. You can share in that way all properties of item.