aliens

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - The Martian

Pages: 1 ... 3 4 [5] 6 7 ... 11
61
Work In Progress / [TFTD][WIP][OXCE] Visual Enhancement Pack for TFTD
« on: October 24, 2021, 08:49:59 pm »
[OpenXcom Extended version 7.0 or newer is required to use this mod]
(Get OXCE 'HERE')


If you are looking to experience unaltered Terror From The Deep gameplay with a visual update this mod may be of interest to you.

All changes are only cosmetic and should only effect the game's graphical content.


This mod currently has five effects:
. Equipment has had its appearance altered to make the BigOb, FloorOb & HandOb match.
. Some equipment has had minor changes to make it easier to distinguish from similar items.
. Weapons will display if they are loaded or unloaded.
. Zombies will wear the armor of the X-Com soldier that the Tentaculat killed.
. Deep Ones will visually carry a weapon that matches their Ufopaedia entry's image.



Additional credit goes to Ohartenstein23 who wrote the script that allows changing of BigOb, FloorOb & HandOb sprites during the battlescape.
Thank you for making that script available for the community to use.


Downloads:
. Visual Enhancement Pack for TFTD (V1-0)

62
Help / What are [units:] race: & rank variables used for?
« on: October 09, 2021, 11:46:32 am »
(Question)
How do you use these variables?

[In the units: section]
race:
rank:


[In the alienDeployments: section]
alienRank:




So far I've been creating aliens in the units: section then assigning those units to a race in the alienRaces: section and fighting them via "New Battle" from the main menu screen.

To correctly integrate them into a real campaign I would like to know what to do with race: and rank: in the units: section.

I've just been giving these two variables temporary values like:
Code: [Select]
    race: STR_ALIENNAME
    rank: STR_LIVE_TERRORIST


The UFOpaedia Ruleset Reference Nightly lists what the variable is, but unfortunately it doesn't elaborate on how to use them:
Code: [Select]
race String ID of the unit race (for alien units).
rank String ID of the unit rank (for alien units).


The alienRaces: section of code appears to already assign each rank of alien to a deployment slot and the id: section controls the race, I think.

Code: [Select]
alienRaces:
  - id: STR_AQUATOID
    members:
      - STR_AQUATOID_COMMANDER
      - STR_AQUATOID_NAVIGATOR
      - STR_AQUATOID_MEDIC
      - STR_AQUATOID_TECHNICIAN
      - STR_AQUATOID_SQUAD_LEADER
      - STR_AQUATOID_SOLDIER
      - STR_CALCINITE_TERRORIST
      - STR_CALCINITE_TERRORIST
  - id: STR_AQUATOID_UNDERWATER
    members:
      - STR_AQUATOID_COMMANDER
      - STR_AQUATOID_NAVIGATOR
      - STR_AQUATOID_MEDIC
      - STR_AQUATOID_TECHNICIAN
      - STR_AQUATOID_SQUAD_LEADER
      - STR_AQUATOID_SOLDIER
      - STR_HALLUCINOID_TERRORIST
      - STR_HALLUCINOID_TERRORIST


I can tell there is more going on as alienDeployments: also appears to use the alienRank: variable to select units for deployment in some way.

UFOpaedia Ruleset Reference Nightly:
Code: [Select]
alienRank Rank associated with this deployment data, as defined by the order of the race in question

I've noticed that in the units: section the rank: names have _LIVE_ instead of the alien race's name from the alienRaces: members: list.
Code: [Select]
    rank: STR_LIVE_SOLDIER
    rank: STR_LIVE_SQUAD_LEADER
    rank: STR_LIVE_TECHNICIAN
    rank: STR_LIVE_TERRORIST

Is this related to the live alien item when a unit is captured?

I can see that in OXCE the liveAlien: variable on the unit controls the recovered live alien and from what I've read in the UFOpaedia OpenXcom's default method for determining the live alien is to use an item with the same name as the alien unit.

So I'm guessing that this is unrelated with a recovered item and instead performs a different action?




63
OXCE Support Y-scripts / [Solved] "BattleGame.getTurnSide" vs "side"
« on: October 08, 2021, 06:49:54 am »
I was going to try using BattleGame.getTurnSide to determine which side (X-Com, Aliens, Civilians) is currently active, but then I noticed the variable "side" in the openxcom.log...

And thus I have two questions:

(Question #1)
What are the values that BattleGame.getTurnSide and "side" can possess?

For example I've seen this code in existing scripts which leads me to believe that X-Com may have a value of 0 and then the aliens would have 1 as their turn "side" value.
Code: [Select]
          # Make sure this doesn't run an extra time when civilians have a turn
          if eq side 2;
            return;
          end;


(Question #2)
So long as the script hook (For example: damageUnit: or newTurnUnit:) supports both "side" and BattleGame.getTurnSide is there a reason to use one over the other?

(If I'm using the wrong description and these commands aren't know as 'script hooks' please let me know, I'm still learning the terminology.)





64
OXCE Support Y-scripts / [Solved] Scripting tags in split .rul files?
« on: October 07, 2021, 01:18:26 pm »
(Question #1)
Is there a limit to the number of tag variables I can use in a mod?


(Question #2)
I'm using separate .rul files for each of the code sections:
. items: in item.rul
. armors: in armor.rul
. units: in unit.rul

When adding scripting tags to the extended: section of each of these files do I need to duplicate all three RuleItem: RuleArmor: BattleUnit: tags in each .rul file?

Or only in the file with the corresponding section?


(Examples)

This code in each file:
Code: [Select]
extended:
  tags:
    RuleItem:
      STATUSEFFECT_HP_STRENGTH_ITEM: int
      STATUSEFFECT_HP_DURATION_ITEM: int
      STATUSEFFECT_ENERGY_STRENGTH_ITEM: int
      STATUSEFFECT_ENERGY_DURATION_ITEM: int
      STATUSEFFECT_TU_STRENGTH_ITEM: int
      STATUSEFFECT_TU_DURATION_ITEM: int
      STATUSEFFECT_MORALE_STRENGTH_ITEM: int
      STATUSEFFECT_MORALE_DURATION_ITEM: int
      STATUSEFFECT_STUN_STRENGTH_ITEM: int
      STATUSEFFECT_STUN_DURATION_ITEM: int
      STATUSEFFECT_WOUND_STRENGTH_ITEM: int
      STATUSEFFECT_WOUND_DURATION_ITEM: int
      STATUSEFFECT_MANA_STRENGTH_ITEM: int
      STATUSEFFECT_MANA_DURATION_ITEM: int


    RuleArmor:
      STATUSEFFECT_HP_SUSCEPTIBILITY_ARMOR: int
      STATUSEFFECT_ENERGY_SUSCEPTIBILITY_ARMOR: int
      STATUSEFFECT_TU_SUSCEPTIBILITY_ARMOR: int
      STATUSEFFECT_MORALE_SUSCEPTIBILITY_ARMOR: int
      STATUSEFFECT_STUN_SUSCEPTIBILITY_ARMOR: int
      STATUSEFFECT_WOUND_SUSCEPTIBILITY_ARMOR: int
      STATUSEFFECT_MANA_SUSCEPTIBILITY_ARMOR: int


    BattleUnit:
      STATUSEFFECT_HP_STRENGTH_UNIT: int
      STATUSEFFECT_HP_DURATION_UNIT: int
      STATUSEFFECT_ENERGY_STRENGTH_UNIT: int
      STATUSEFFECT_ENERGY_DURATION_UNIT: int
      STATUSEFFECT_TU_STRENGTH_UNIT: int
      STATUSEFFECT_TU_DURATION_UNIT: int
      STATUSEFFECT_MORALE_STRENGTH_UNIT: int
      STATUSEFFECT_MORALE_DURATION_UNIT: int
      STATUSEFFECT_STUN_STRENGTH_UNIT: int
      STATUSEFFECT_STUN_DURATION_UNIT: int
      STATUSEFFECT_MANA_STRENGTH_UNIT: int
      STATUSEFFECT_MANA_DURATION_UNIT: int
      STATUSEFFECT_DISPLAY_COUNTER: int



Or each file only has only its own related tags declared:

item.rul
Code: [Select]
extended:
  tags:
    RuleItem:
      STATUSEFFECT_HP_STRENGTH_ITEM: int
      STATUSEFFECT_HP_DURATION_ITEM: int
      STATUSEFFECT_ENERGY_STRENGTH_ITEM: int
      STATUSEFFECT_ENERGY_DURATION_ITEM: int
      STATUSEFFECT_TU_STRENGTH_ITEM: int
      STATUSEFFECT_TU_DURATION_ITEM: int
      STATUSEFFECT_MORALE_STRENGTH_ITEM: int
      STATUSEFFECT_MORALE_DURATION_ITEM: int
      STATUSEFFECT_STUN_STRENGTH_ITEM: int
      STATUSEFFECT_STUN_DURATION_ITEM: int
      STATUSEFFECT_WOUND_STRENGTH_ITEM: int
      STATUSEFFECT_WOUND_DURATION_ITEM: int
      STATUSEFFECT_MANA_STRENGTH_ITEM: int
      STATUSEFFECT_MANA_DURATION_ITEM: int

items:

armor.rul
Code: [Select]
extended:
  tags:
    RuleArmor:
      STATUSEFFECT_HP_SUSCEPTIBILITY_ARMOR: int
      STATUSEFFECT_ENERGY_SUSCEPTIBILITY_ARMOR: int
      STATUSEFFECT_TU_SUSCEPTIBILITY_ARMOR: int
      STATUSEFFECT_MORALE_SUSCEPTIBILITY_ARMOR: int
      STATUSEFFECT_STUN_SUSCEPTIBILITY_ARMOR: int
      STATUSEFFECT_WOUND_SUSCEPTIBILITY_ARMOR: int
      STATUSEFFECT_MANA_SUSCEPTIBILITY_ARMOR: int

armors:

unit.rul
Code: [Select]
extended:
  tags:
    BattleUnit:
      STATUSEFFECT_HP_STRENGTH_UNIT: int
      STATUSEFFECT_HP_DURATION_UNIT: int
      STATUSEFFECT_ENERGY_STRENGTH_UNIT: int
      STATUSEFFECT_ENERGY_DURATION_UNIT: int
      STATUSEFFECT_TU_STRENGTH_UNIT: int
      STATUSEFFECT_TU_DURATION_UNIT: int
      STATUSEFFECT_MORALE_STRENGTH_UNIT: int
      STATUSEFFECT_MORALE_DURATION_UNIT: int
      STATUSEFFECT_STUN_STRENGTH_UNIT: int
      STATUSEFFECT_STUN_DURATION_UNIT: int
      STATUSEFFECT_MANA_STRENGTH_UNIT: int
      STATUSEFFECT_MANA_DURATION_UNIT: int
      STATUSEFFECT_DISPLAY_COUNTER: int

units:

65
(Goal)
I've been trying to modify Yankes "Poison Script" into one that reduces all armor on an effected unit instead.

(Problem)
. The mod is producing an "End of map not found." error.
Code: [Select]
ERROR: failed to load 'Testing Mod: Acid Script'; mod disabled
./user/mods/TestModAcid/Ruleset/scriptAcid.rul: yaml-cpp: error at line 70, column 13: end of map not found

(What I've tried so far)
So far I've check that:
. All the code is indented via two spaces.
. All IF statements have a corresponding end; command.
. All lines end in a ; to close them.


(Example Mod)
For convenience I've attached the mod I'm working with that contains the modified script to this post:
TestModAcid V0-1.zip


Last time I was working with a script and it produced an "End of map not found." the error was an IF statement without an end; command.

This time all IF statements appear to be properly closed with an end; and if I remove the section of code that is referenced by the error message it just changes the line that is producing the error to be later in the .rul file.



I'm at a loss with this.





I tried removing sections of the code that had the "error at line" message but the error continued to occur:

Code: [Select]
scriptAcid.rul: yaml-cpp: error at line 70, column 13: end of map not found.
As line 70 is this block of code:
Code: [Select]
# Make sure Armor is not Less than 0
            if lt frontarmor 0;
              set frontarmor 0;
            end;

            if lt leftarmor 0;
              set leftarmor 0;
            end;

            if lt reararmor 0;
              set reararmor 0;
            end;

            if lt rightarmor 0;
              set rightarmor 0;
            end;

            if lt underarmor 0;
              set underarmor 0;
            end;


my first thought was that perhaps you cannot nest IF statements, example:
Code: [Select]
            if lt X 0;
              if lt Y 0;
                set underarmor 0;
              end;
            end;

However I've seen scripts with nested IF statements so I don't think that is the problem.

When I removed the section of code that was mentioned in the error message a new one was produced:
Code: [Select]
scriptAcid.rul: yaml-cpp: error at line 90, column 13: end of map not found.
Line 90 is the following code:
Code: [Select]
            Unit.setArmor 0 frontarmor;
            Unit.setArmor 1 leftarmor;
            Unit.setArmor 2 reararmor;
            Unit.setArmor 3 rightarmor;
            Unit.setArmor 4 underarmor;


From what I've read in the openxcom.log with verboseLogging: true the BattleUnit.setArmor variable requires two variables.

The first is the direction of the armor to be effected and the second is a variable with the value to give the selected armor.

I've noticed that in other scripts the "BattleUnit." part is abbreviated to "Unit." if I'm using the wrong command please let me know.



I tried removing that section of code as well. I need it for the script to work but I wanted to see if it would load without an error.

Unfortunately this caused the same error but with a different line referenced:
Code: [Select]
scriptAcid.rul: yaml-cpp: error at line 96, column 13: end of map not found.
Line 96 is:
Code: [Select]
            sub frontarmor acid;
            sub leftarmor acid;
            sub reararmor acid;
            sub rightarmor acid;
            sub underarmor acid;

These commands should be simple subtraction of the "acid" value from each of the five "armor" variables.

Again I tried removing the code section and again the error appeared:
Code: [Select]
scriptAcid.rul: yaml-cpp: error at line 102, column 13: end of map not found.
Line 102 is:
Code: [Select]
            sub duration 1;
            unit.setTag Tag.ACID_REMAINING duration;


After removing the code around line 102 the error directed me to line 105:
Code: [Select]
scriptAcid.rul: yaml-cpp: error at line 105, column 13: end of map not found.
Line 105 is an end; command for an IF statement earlier in the code so it shouldn't be a problem.

I checked the indentation and it should match the IF statement that it belongs to so I'm not sure why it is throwing the error.



I could keep removing lines of code but it seems like that would created additional problems as the IF end; code block would be broken.


What am I missing?

66
(UPDATE)
I think that I've solved the mod loading error... but now the script's poison effect isn't working when the unit is struck.

Here is the new example Mod from 2nd post in this thread:
TestModPoison V0-2.zip





(Goal)
. Edit Yankes "Simple poison bullets that do damage over time" script so that it no longer decreases the amount of health lost as the duration reduces.
. Control the duration of the poison via a tag on the weapon item.
. Change the armors: POISON_SUSCEPTIBILITY tag to a 0-1 true-false switch that determines if an armor can be poisoned.


(Problem)
. Poison effect does not apply when a unit wearing the poisonable armor is struck.
. My current attempt is throwing the following error: (Solved, see 2nd post)
Spoiler:
Code: [Select]
ERROR:
[23-09-2021_15-36-06] [FATAL] Error loading file './user/mods/TestModPoison/Ruleset/scriptPoison.rul'
[23-09-2021_15-36-06] [WARN] disabling mod with invalid ruleset: TESTPOISON
[23-09-2021_15-36-06] [ERROR] failed to load 'Testing Mod: Poison Script'; mod disabled
./user/mods/TestModPoison/Ruleset/scriptPoison.rul: yaml-cpp: error at line 34, column 13: end of map not found

(Example Mod)
For convenience I've attached the mod I'm working with that contains the modified script to this post:
TestModPoison V0-1.zip





I've been reading up on how OpenXcom's scripting works and I thought I was finally ready to make the edits I attempted a year ago back in this thread "A few questions about this "Poison Script" (OXCE)".

Unfortunately the code is throwing an error so I've missed something.

I think the error is being triggered by the removal of these lines of code, but I'm not sure why:
Code: [Select]
            mul strength susceptibility;
            div strength 10;

I'm going to break down my understanding of Yankes's original code, if anyone spots my mistake or anything odd I'm doing please let me know.





This part creates the variables that the script keeps information on the effected item, armor and unit.

POISON_STRENGTH is the amount of damage the poison does.
POISON_SUSCEPTIBILITY is the armor's resistance to the poison.
POISON_LEVEL stores the amount of poison left on the unit.

This code needs to be in the items.rul armors.rul & units.rul files.
(If you have the armors: items: units: code sections split between different .rul files)

Code: [Select]
extended:
  tags:
    RuleItem:
      POISON_STRENGTH: int
    RuleArmor:
      POISON_SUSCEPTIBILITY: int
    BattleUnit:
      POISON_LEVEL: int

This script runs when a unit is damaged.

Code: [Select]
  scripts:
    damageUnit:

offset: 1 means this script will run before any script with offset: 2 or greater.

Code: [Select]
      - offset: 1
This code block creates temporary variables to handle the values the poison scripts works with.

The var int definitions are creating variables that can hold an integer.

I'm not sure exactly how the var ptr part works but I'm guessing it is loading the entire items: and armors: section for the script to access.

Code: [Select]
        code: |
          var int susceptibility 0;
          var int strength 0;
          var int temp 0;
          var ptr RuleArmor armor_rule;
          var ptr RuleItem item_rule;

the armor_rule variable is being assigned the value found on the unit being damaged's armor's POISON_SUSCEPTIBILITY tag.

This value is then being stored in the scripts susceptibility variable to make it easier to work with.

Similarly the item being used to damage the unit has the value of its POISON_STRENGTH assigned to the scripts strength variable.
         
Code: [Select]
          unit.getRuleArmor armor_rule;
          armor_rule.getTag susceptibility Tag.POISON_SUSCEPTIBILITY;
          damaging_item.getRuleItem item_rule;
          item_rule.getTag strength Tag.POISON_STRENGTH;

I'm not sure how the debug_log commands work but I'm guessing that both strength & susceptibility variables are written in the openxcom.log file by these commands.

Then if both strength & susceptibility are gt(Greater Than) 0 the item's poison strength is multiplied by the armor's susceptibility value.

After which strength is divided by 10.

The unit being damaged's POISON_LEVEL tag variable is then stored in the temp variable.

Then if temp is lt(Less than) strength the unit's POISON_LEVEL tag is given the value of strength.

If I'm reading it correctly what this section of code has done is check to see if incoming poison damage is of a higher value than any poison currently on the unit, and if it is the new higher poison value is given to the unit's tag.

I think that return; is used to end the script and return the flow of code back to the rest of the game engine loop.

Code: [Select]
          debug_log 1 strength;
          debug_log 2 susceptibility;
          if and gt strength 0 gt susceptibility 0;
          debug_log 3 3;
            mul strength susceptibility;
            div strength 10;
            unit.getTag temp Tag.POISON_LEVEL;
            if lt temp strength;
              unit.setTag Tag.POISON_LEVEL strength;
            end;
          end;
         
          return;

This code block is separate from the above one and is only run for each unit at the beginning of a new turn.

New temporary variables are declared called poison & hp.

The poison variable is assigned the value of the unit's POISON_LEVEL tag.

If the poison value is greater than 0 (The unit is currently poisoned) then the unit's health is assigned to the hp variable.

The value of poison is subtracted from hp and then the unit has its actual health value changed to match the hp variable.

The poison value is subtracted by 1 and then the unit's POISON_LEVEL is assigned the resulting new value.

Code: [Select]
    newTurnUnit:
      - offset: 1
        code: |
          var int poison;
          var int hp;
          unit.getTag poison Tag.POISON_LEVEL;
          if gt poison 0;
            unit.getHealth hp;
            sub hp poison;
            unit.setHealth hp;
            sub poison 1;
            unit.setTag Tag.POISON_LEVEL poison;
          end;
          return;

This code block changes the colour of a unit that is currently poisoned.

The 4 on the line:
set_color new_pixel 4; #green color
controls what the new colour is.

If I'm understanding it correctly the number indicates the row used in the X-Com palette.



When using the TFTD palette a value of 5 gives a similar green shade to the one expected in X-COM: UFO Defense.

Code: [Select]
    recolorUnitSprite:
      - offset: 4
        code: |
          var int poison;
          unit.getTag poison Tag.POISON_LEVEL;
          if gt poison 0;
            set_color new_pixel 4; #green color
          end;
          return new_pixel;





That is my understanding of how the code works, and now here is the way I've tried to alter the script.

Code: [Select]
extended:
  tags:
    RuleItem:
      POISON_STRENGTH: int
      POISON_DURATION: int
    RuleArmor:
      POISON_SUSCEPTIBILITY: int
    BattleUnit:
      POISON_REMAINING: int
      POISON_LEVEL: int
  scripts:
    damageUnit:
      - offset: 1
        code: |
          var int susceptibility 0;
          var int strength 0;
          var int duration 0;
          var int temp 0;
          var ptr RuleArmor armor_rule;
          var ptr RuleItem item_rule;
         
          unit.getRuleArmor armor_rule;
          armor_rule.getTag susceptibility Tag.POISON_SUSCEPTIBILITY;
          damaging_item.getRuleItem item_rule;
          item_rule.getTag strength Tag.POISON_STRENGTH;
          item_rule.getTag duration Tag.POISON_DURATION;
         
          debug_log 1 strength;
          debug_log 2 susceptibility;
          if and gt strength 0 gt susceptibility 0;
          debug_log 3 3;
#            mul strength susceptibility;
#            div strength 10;
            unit.getTag temp Tag.POISON_LEVEL;
            if lt temp strength;
              unit.setTag Tag.POISON_LEVEL strength;

            unit.getTag temp Tag.POISON_REMAINING;
            if lt temp duration;
              unit.setTag Tag.POISON_REMAINING duration;

            end;
          end;
         
          return;
    newTurnUnit:
      - offset: 1
        code: |
          var int poison;
          var int hp;
          var int duration 0;
          unit.getTag poison Tag.POISON_LEVEL;
          unit.getTag duration Tag.POISON_REMAINING;
          if gt poison 0;
            unit.getHealth hp;
            sub hp poison;
            unit.setHealth hp;
            sub duration 1;
            unit.setTag Tag.POISON_REMAINING duration;
          if le duration 0;
            unit.setTag Tag.POISON_LEVEL 0;
          end;
          return;
    recolorUnitSprite:
      - offset: 4
        code: |
          var int poison;
          unit.getTag poison Tag.POISON_LEVEL;
          if gt poison 0;
            set_color new_pixel 5; # 4 green color
          end;
          return new_pixel;


I've tried to changed the tags used by the script a bit.

(Items:)
POISON_STRENGTH = How strong the weapon's poison is.
POISON_DURATION = How long the weapon's poison lasts when applied.

(Armors:)
POISON_SUSCEPTIBILITY = Can this unit be poisoned? 0 = false. 1 = true.

(Units:)
POISON_REMAINING = Tag for storing POISON_DURATION when a unit is poisoned.
POISON_LEVEL = Tag for storing POISON_STRENGTH when a unit is poisoned.


A new variable is declared at the start of the script to store the amount of time the inflicted poison will last.
Code: [Select]
          var int duration 0;
The item also now passes the Tag.POISON_DURATION value to the scripts duration variable:
Code: [Select]
          item_rule.getTag duration Tag.POISON_DURATION;
As susceptibility now is used only to check if the armor can be poisoned or not these two lines of code are removed:
Code: [Select]
            mul strength susceptibility;
            div strength 10;


If the tag.POISON_DURATION of the weapon is higher than the tag.POISON_REMAINING value on the unit then the unit's POISON_REMAINING value is assigned the weapons poison duration value:
Code: [Select]
            unit.getTag temp Tag.POISON_REMAINING;
            if lt temp duration;
              unit.setTag Tag.POISON_REMAINING duration;


in the newTurnUnit: code block the temporary variable duration is created again:
Code: [Select]
          var int duration 0;
and has the value held by the unit's POISON_REMAINING tag assigned to it.
Code: [Select]
          unit.getTag duration Tag.POISON_REMAINING;
As POISON_LEVEL is no longer linked to the time a unit spends poisoned the duration variable is subtracted from instead of poison:
Code: [Select]
            sub duration 1;
            unit.setTag Tag.POISON_REMAINING duration;


An additional if statement is checked to see if the duration is 0 and then zero the POISON_LEVEL tag on the unit if it is:
Code: [Select]
          if le duration 0;
            unit.setTag Tag.POISON_LEVEL 0;


When the mod is loaded, the following error is displayed

Code: [Select]
ERROR:
[23-09-2021_15-36-06] [FATAL] Error loading file './user/mods/TestModPoison/Ruleset/scriptPoison.rul'
[23-09-2021_15-36-06] [WARN] disabling mod with invalid ruleset: TESTPOISON
[23-09-2021_15-36-06] [ERROR] failed to load 'Testing Mod: Poison Script'; mod disabled
./user/mods/TestModPoison/Ruleset/scriptPoison.rul: yaml-cpp: error at line 34, column 13: end of map not found

67
(Goal)
When a unit dies via damage caused by either enviroEffects: or negative health regen on its armor that unit will not trigger the specab: 1 effect on death and explode.

If I understand correctly this occurs because the unit is not dying during a turn but instead between turns.

This got me thinking that maybe a makeshift solution could be created using a pre-primed grenade.

Fortunately Greenscarf has posted a script that does just that: (Thank you for sharing your script Greenscarf!)
[Documentation][y-script] OXCE Script examples.

(Problem)
I've run into a snag, for some reason I cannot spawn a unit with a grenade using the units: builtInWeaponSets: list.

Code: [Select]
    builtInWeaponSets:
      - - STR_MAGNA_BLAST_GRENADE


If someone could take a quick look at my code in the mod attached to this post and see if they can spot the problem I would appreciate it. (TestMod.zip)

The small example mod is composed of:
- Greenscarf's scripts that auto-prime the grenade.
- A test unit that will die via decaying health on its armor.
- A test weapon to spawn the enemy unit quickly where it can easily be observed.


68
I'm hoping that it is possible to implement it so that one or both of the below methods can trigger the specab: 1 effect on unit death.

If a unit dies due to either having its armor cause negative health regen or via enviroEffects: damage the unit's death does not appear to trigger its specab: 1 effect and explode on death.


Armor with decaying health example:

Code: [Select]
armors:
  - type: AQUATOID_ARMOR
    spriteSheet: AQUATOID.PCK
    allowInv: false
    corpseBattle:
      - STR_AQUATOID_CORPSE
    frontArmor: 5
    sideArmor: 5
    rearArmor: 5
    underArmor: 5
    drawingRoutine: 4
    constantAnimation: true
    damageModifier:
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
    loftempsSet: [ 5 ]
    overKill: 10.0
    recovery:
      health:
        flatHundred: -0.5

items:
  - type: STR_AQUATOID_CORPSE
    size: 0.4
    costSell: 20000
    weight: 30
    bigSprite: 46
    floorSprite: 41
    invWidth: 2
    invHeight: 3
    recoveryPoints: 5
    battleType: 11
    armor: 26
    blastRadius: 5
    power: 100
    damageType: 2

enviroEffects: that causes harm to units example:

Code: [Select]
enviroEffects:
  - type: COND_P1
    mapBackgroundColor: 10
    environmentalConditions:
      STR_HOSTILE:
        chancePerTurn: 100
        firstTurn: 1
        lastTurn: 1000
        message: "STR_TEST"
        color: 29
        weaponOrAmmo: "STR_TEST_EFFECT"
        side: 4
        bodyPart: 1

items:
  - type: STR_TEST_EFFECT
    size: 0.3
    costSell: 9590
    weight: 3
    bigSprite: 25
    floorSprite: 33
    handSprite: 200
    hitSound: 31
    hitAnimation: 46
    power: 130
    damageType: 19
    clipSize: 10
    battleType: 2
    recoveryPoints: 1
    armor: 50
    attraction: 1
    vaporColor: 3
    vaporDensity: 30

armors:
  - type: AQUATOID_ARMOR0
    damageModifier:
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.6
      - 1.5
      - 1.0
      - 1.0 # Extra Resistances
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0 # Enviroment Effect

items:
  - type: STR_AQUATOID_CORPSE
    size: 0.4
    costSell: 20000
    weight: 30
    bigSprite: 46
    floorSprite: 41
    invWidth: 2
    invHeight: 3
    recoveryPoints: 5
    battleType: 11
    armor: 26
    blastRadius: 5
    power: 100
    damageType: 2

69
Help / Armor with decaying health?
« on: August 31, 2021, 05:47:53 am »
I'm trying to create an armor for a unit that loses health every turn.

So far I've tried both:

Code: [Select]
armors:
  - type: DECAYING_HEALTH_ARMOR
    recovery:
      health:
        flatHundred: -0.5


and

Code: [Select]
armors:
  - type: DECAYING_HEALTH_ARMOR
    recovery.health: -50


But the unit just wanders around and never loses any health.

What am I doing wrong?

70
Resources / The Martian's Cydonian Art Gallery
« on: July 28, 2021, 12:02:14 am »
Within this thread you will find a selection of altered, edited, recoloured or recombined images that may (or may not) be useful to you.

Please make sure to credit the original author(s) of the source images if you choose to make use of them.

71
I've been making a mod to display firing animations in TFTD.

So far the unit sprite sheets are finished but now I need the land variants to be worn by X-Com when not underwater.

The solution to this I'm attempting is to use startingConditions: & armorTransformations: to swap the X-Com soldier's armor for their land versions when engaging in the Base Defence, Port attacks, Island attacks and Ship attack missions.

Unfortunately my attempts to use startingConditions: have not yielded results.


In the current version of my mod when the aliens attack a surface city X-Com soldier's armor is not transformed into the variant without a helmet.


Here is the code involving the transformation.
Code: [Select]
# [====]  Alien Deployments [====]
alienDeployments:

# [=] Island Terror Mission [=]
  - type: STR_ISLAND_TERROR
    startingCondition: STR_LAND_MISSION_HELMETS_OFF

# [=] Port Terror Mission [=]
  - type: STR_PORT_TERROR
    startingCondition: STR_LAND_MISSION_HELMETS_OFF

# [=] Cargo Ship Mission (Part 1) [=]
  - type: STR_CARGO_SHIP_P1
    startingCondition: STR_LAND_MISSION_HELMETS_OFF

# [=] Cargo Ship Mission (Part 2) [=]
  - type: STR_CARGO_SHIP_P2
    startingCondition: STR_LAND_MISSION_HELMETS_OFF

# [=] Cruise Ship Mission (Part 1) [=]
  - type: STR_CRUISE_SHIP_P1
    startingCondition: STR_LAND_MISSION_HELMETS_OFF

# [=] Cruise Ship Mission (Part 2) [=]
  - type: STR_CRUISE_SHIP_P2
    startingCondition: STR_LAND_MISSION_HELMETS_OFF
   
# [=] Base Defence Mission [=]
  - type: STR_BASE_DEFENSE
    startingCondition: STR_LAND_MISSION_HELMETS_OFF
   

# [====] Starting Conditions [====]
startingConditions:
  - type: STR_LAND_MISSION_HELMETS_OFF
    armorTransformations:
      STR_NONE_UC: STR_NONE_UC_LAND
      STR_PLASTIC_AQUA_ARMOR_UC: STR_PLASTIC_AQUA_ARMOR_UC_LAND
      STR_ION_ARMOR_UC: STR_ION_ARMOR_UC_LAND
      STR_MAGNETIC_ION_ARMOR_UC: STR_MAGNETIC_ION_ARMOR_UC_LAND



I've also attached the mod directly to this post as well for convenience:
. Firing Animation for TFTD (V0-4)

72
Work In Progress / [TFTD][WIP][OXCE] Firing Animation for TFTD
« on: June 23, 2021, 07:05:32 am »
[OpenXcom Extended version 7.0 or newer is required to use this mod]
(Get OXCE 'HERE')

NastyKhan pointed out (In this thread) that for whatever reason in Terror From The Deep currently units do not animate when they fire a two handed weapon.

Oddly the DOS version of TFTD does not display this behavior so it may be a bug in OpenXcom.

This mod's goal is to make Aquanaut units display a firing animation again.

This is being done via changing the drawingRoutine: from 13 (Aquanauts) to 0 (Soldiers, Sectoid) and altering the arm section of the unit sprite sheets.
(You may notice some differences in arm placement.)

Features currently added:
. "Diving Suit" now has firing animation.
. "Plastic Aqua Armor" now has a firing animation.
. "Ion Armor" now has a firing animation.
. "Magnetic Ion Armor" now has a firing animation.


Changelog:
V0.5:
. Fixed separation between X-Com unit's torso and legs while moving and kneeling.

V0.4:
. X-Com Soldiers now use (Land) variants of armor when not underwater.
. Torso for Ion Armor (Land) has been fixed.
. Weapon carrying arm frames for Ion Armor & Magnetic Ion Armor have been made brighter.

V0.3:
. Added: Ion Armor (Water)
. Added: Ion Armor (Land)
. Added: Magnetic Ion Armor (Water)
. Added: Magnetic Ion Armor (Land)
. Added: Text Strings for (Land) variants of armor.

V0.2:
. Added: Plastic Aqua Armor (Water)
. Added: Plastic Aqua Armor (Land)

V0.1:
. Added: Dive Suit (Water)
. Added: Dive Suit (Land)




If you encounter any problems with the mod please let me know.


Downloads:
. Firing Animation for TFTD (V0-5)
. Firing Animation for TFTD (V0-4)
. Firing Animation for TFTD (V0-3)
. Firing Animation for TFTD (V0-2)
. Firing Animation for TFTD (V0-1)

73
I was going over the TFTD unit sprites and noticed these on the "Diving Suit" & "Ion Armor / Magnetic Ion Armor" but not the "Plastic Aqua Armor":

Does anyone know what these frames are?

74
Help / Encountered an error trying to use spriteInv:
« on: June 17, 2021, 10:51:39 am »
OXCE V6.5.5 (v2020-06-21)
Error: Sprite inventory_GUNDAM.SPK not found

Spoiler:

I've been creating a small mod as a tutorial for myself, unfortunately I've encountered an error that I can't seem to get past.

As far as I can tell the way I'm loading the inventory sprites is the same as other mods that I've looked at, could someone please take a quick look and point out my mistake?

I've attached the mod to this post for convenience. (HERE)

The openxcom.log Messages:
Code: [Select]
[17-06-2021_03-32-21] [FATAL] A fatal error has occurred: Sprite inventory_GUNDAM.SPK not found
[17-06-2021_03-32-21] [FATAL] ./OpenXcomEx(OpenXcom::CrossPlatform::stackTrace(void*)+0x36) [0x55680e101716]
[17-06-2021_03-32-21] [FATAL] ./OpenXcomEx(OpenXcom::CrossPlatform::crashDump(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x477) [0x55680e1022b7]
[17-06-2021_03-32-21] [FATAL] ./OpenXcomEx(exceptionLogger()+0x75) [0x55680df3fb05]
[17-06-2021_03-32-21] [FATAL] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x92ae6) [0x7f80ac27cae6]
[17-06-2021_03-32-21] [FATAL] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x92b21) [0x7f80ac27cb21]
[17-06-2021_03-32-21] [FATAL] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x92d54) [0x7f80ac27cd54]
[17-06-2021_03-32-21] [FATAL] ./OpenXcomEx(OpenXcom::Surface* OpenXcom::Mod::getRule<OpenXcom::Surface>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, OpenXcom::Surface*, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, OpenXcom::Surface*> > > const&, bool) const+0x1a7) [0x55680e37e957]
[17-06-2021_03-32-21] [FATAL] ./OpenXcomEx(OpenXcom::Mod::getSurface(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)+0x76) [0x55680e34f476]
[17-06-2021_03-32-21] [FATAL] ./OpenXcomEx(OpenXcom::InventoryState::init()+0x8b1) [0x55680e0a3d71]
[17-06-2021_03-32-21] [FATAL] ./OpenXcomEx(OpenXcom::Game::run()+0x3dc) [0x55680e121bec]
[17-06-2021_03-32-21] [FATAL] ./OpenXcomEx(main+0x175) [0x55680df1d795]
[17-06-2021_03-32-21] [FATAL] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f80ab864bf7]
[17-06-2021_03-32-21] [FATAL] ./OpenXcomEx(_start+0x2a) [0x55680df2428a]
[17-06-2021_03-32-46] [FATAL] OpenXcom has crashed: Sprite inventory_GUNDAM.SPK not found



Mod's Source Code:
Code: [Select]
extraSprites:
  - type: GUNDAM.PCK
    subX: 32
    subY: 40
    width: 512
    height: 720
    files:
      0: Resources/Images/Gundam/Unit_Gundam.png
  - type: ZEONGUNDAM.PCK
    subX: 32
    subY: 40
    width: 512
    height: 720
    files:
      0: Resources/Images/Zeon_Gundam/Unit_Zeon_Gundam.png
  - type: BIGOBS.PCK
    files:
      200: Resources/Images/Gundam/BigOb_Gundam_Wreck.png
  - type: FLOOROB.PCK
    files:
      200: Resources/Images/Gundam/FloorOb_Gundam_Wreck.png
  - type: HANDOB.PCK
    height: 40
    width: 256
    subX: 32
    subY: 40
    files:
      200: Resources/Images/Gundam/HandOb_Gundam_Wreck.png
  - type: inventory_GUNDAM
    singleImage: true
    files:
      0: Resources/Images/Gundam/Inventory_Gundam.png
  - type: inventory_ZEONGUNDAM
    singleImage: true
    files:
      0: Resources/Images/Zeon_Gundam/Inventory_Zeon_Gundam.png


items:
  - type: STR_CORPSE_SUIT
    name: STR_CORPSE
    weight: 26
    bigSprite: 200 # Was 44
    floorSprite: 200 # Was 41
    handSprite: 200 # Was Not Used
    invWidth: 2
    invHeight: 2 # Was 3
    armor: 40
    recover: false



armors:
  - type: STR_POWER_SUIT_UC
    spriteSheet: GUNDAM.PCK # Was XCOM_2.PCK
    spriteInv: inventory_GUNDAM
    forcedTorso: 1
  - type: STR_FLYING_SUIT_UC
    spriteSheet: ZEONGUNDAM.PCK # Was XCOM_2.PCK
    spriteInv: inventory_ZEONGUNDAM
    forcedTorso: 1 # Was 2

75
Help / Variable that offsets HandOb's vertical position?
« on: June 11, 2021, 06:06:42 pm »
I've been trying to match a sprite sheet to the general position of equipment HandObs, instead of redrawing the entire thing isn't there a way to change the elevation of the HandOb?

I could be wrong but I seem to remember reading that a variable could be set either in units: or armors: that raised or lowered the HandOb, am I misremembering this?

I've been reading through the Ruleset Reference Nightly for this variable that assigns the offset to the HandOb's vertical position when held by that unit, but so far I have not noticed it.

Is it the standHeight: kneelHeight: & floatHeight: variables?

Pages: 1 ... 3 4 [5] 6 7 ... 11