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] 2 3 4
Help / A few questions about this "Poison Script" (OXCE)
« on: January 01, 2020, 03:54:40 pm »
This poison script created by Yankes looks very useful.

Simple poison bullets that do damage over time:

Code: [Select]
      POISON_LEVEL: int
      - offset: 1
        code: |
          var int susceptibility 0;
          var int strength 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;
          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;
      - 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;
      - offset: 4
        code: |
          var int poison;
          unit.getTag poison Tag.POISON_LEVEL;
          if gt poison 0;
            set_color new_pixel 4; #green color
          return new_pixel;


I have a few questions about how it is used.

(Question #1):
Which *.rul file does it need to be in to function?

Can I place it in its own PoisonScript.rul file or does it need to be in the same file as the *.rul that has the items: section in it?

(Question #2):
I'm guessing that the variable POISON_STRENGTH: on the item and POISON_SUSCEPTIBILITY: on the unit armor determine how much HP is lost by a poisoned unit per turn and either the number of turns the unit is poisoned or a resistance to the applied poison effect, I'm not sure exactly which from trying to read the code.

How do this work?

(Question #3):
Although the above question may answer this, I'll ask directly as it would be odd to see mechanical tanks succumbing to the effects of poisoning.

Is it possible to prevent a unit from being able to be afflicted with the poison script's effects?

(Question #4):
If a unit is already poisoned and is afflicted with poison again, what happens?
. Does it overwrite the Poison with the new value?
. Does it overwrite the Poison with the highest value?
. Does increase the value of the Poison by combining both?
. Do the instances of Poison stack each running separately?
. Or can a unit already effected by poison not be poisoned further?

(Question #5):
The words recolorUnitSprite: seem to suggest that the poisoned unit will display its affliction by shifting colour to a greenish tint.

Is it possible to cause this effect to display as other colours?

(Question #6):
Can a poisoned unit be cured of the poison effect, or must it run its course once inflicted?

For example by a medkit?

(Question #7):
Is it possible to have several versions of this script running simultaneously if these three varables are renamed in an additional copy of the script which is also present in a *.rul file along side the original?

For example:

If that is possible and the scripts unit affliction display colour can be altered then one version of the script could cause an effected unit to become green coloured when hit while others could switch to different colours representing other damaging afflictions.
(Also they would both have separate instances of damage if applied to the same unit.)

This would be very useful.

Offtopic / "Merry Christmas!
« on: December 25, 2019, 07:29:56 am »
Merry Christmas!

Resources / [UNIT][GRAPHICS] Cyber Cylinder
« on: December 25, 2019, 06:29:41 am »
The alien threat has deployed several types of mechanical weapons against X-Com already.


Cyber Spheres: (Drawn by NeoWorm)

And now, Cyber Cylinders!

(Note: The above animated examples look correct ingame, the *.gif file type doesn't always capture the energy effect under the Cyber Cylinder properly.)

What geometric horror will emerge next?

I've setup three different versions of the Cyber Cylinder type enemy.

The first one's sprite sheet can be used like the original Cyberdisc's sprites (drawingRoutine: 3) and also comes in a colour varient matching the original disc's colours if you wish it: (I think the blue one looks better though.)

The second one requires you to use drawingRoutine: 12 (Hallucinoid) instead of drawingRoutine: 3 (Cyberdisc). Unlike the above version this one cannot visually turn, however this sacrifice allows for an animated light to run along its outer hull in a sequence.
(Like the above both colour varients are available.)

And the third version is a slightly taller Cyber Cylinder that rapidly flashes different colours in a repeating sequence, again you will need to use drawingRoutine: 12 (Hallucinoid) instead of drawingRoutine: 3 (Cyberdisc) to make it work.

Have fun. ^_^

Help / Armed civilians?
« on: December 01, 2019, 04:06:45 am »
If a civilian unit spawns with a weapon will it fire on alien units?

Help / Randomized alien equipment?
« on: November 23, 2019, 06:43:29 am »
I'm trying to make it so that an alien soldier sometimes spawns with weapon (A) and sometimes with weapon (B).

So for example if an alien UFO held the following aliens:
Rank 0 - Commander
Rank 1 - Leader
Rank 2 - Engineer 
Rank 3 - Medic     
Rank 4 - Navigator
Rank 5 - Soldier
Rank 6 - Terrorist 1
Rank 7 - Terrorist 2

And there are 3 "Rank 5" Soldiers deployed, each soldier may be carrying a different weapon.

To achieve this my first thought was to use extraRandomItems: to grant that rank random weapons and leave their rank's itemSets: without weapons so the extraRandomItems: would be the sole source supplying them firearms.

In theory this would work, however only for weapons that do not require ammo as extraRandomItems: appears to only award one item from each list so unless the alien spawns with all possible ammo types their weapon will potentially be unloaded.

My other thought was to expand the number of Ranks so that there were more variants of a specific "Rank" then use lowQty, highQty & extraQty to make that enemy item set randomly appear by giving it a lowQty / highQty value of 0 with an extraQty value of X(Desired max number).

So it would look more like this:
Rank 0 - Commander
Rank 1 - Leader
Rank 2 - Engineer 
Rank 3 - Medic     
Rank 4 - Navigator
Rank 5 - Soldier
Rank 6 - Additional Soldier (A)
Rank 7 - Additional Soldier (B)
Rank 8 - Additional Soldier (C)
Rank 9 - Additional Soldier (D)
Rank 10 - Terrorist 1
Rank 11 - Terrorist 2

However if all of the soldier ranks can spawn lowQTy / highQty of 0 the UFO could be devoid of soldiers, and if I make it so each "Soldier" rank has a minimum value greater than 0 that just assures the deployment of the item set defeating the intended purpose of making it not always present.

I also considered trying to force the alien to spawn with the intended weapons using an attached weapon and the livingWeapon: setting, but my understanding is that would prevent it from accessing its inventory or dropping the weapon if the unit panicked.

The builtInWeaponSets: variable appears to be what I'm looking for as if I'm reading this correctly it will allow a randomization between several pre-defined item sets specifically referenced by that unit itself.

(builtInWeaponSets)    A set of lists of weapons this unit can come pre-equipped with. Game will pick one set "at random" (randomness comes from the current alien tech level definition). These weapons WILL appear in inventory slots (references items).

So if builtInWeaponSets: was used in combination with membersRandom: and the Rank 5 Soldier was configured to spawn either as a Sectoid soldier or a Muton soldier, builtInWeaponSets: could then be used to cause the Sectoid to spawn randomly with a Plasma Pistol or Plasma Rifle where as the Muton could be configured to only spawn with an Alien Launcher or Blaster Bomb. Do I understand this correctly?

(membersRandom)    Alternative to members. Instead of defining just a single unit type per alien rank, you can define any number of unit types here and one will be chosen randomly (each time a new unit is generated). To increase a chance of a certain unit type being selected, you can add it multiple times.

For example using builtInWeaponSets: there would be 3 different units of a Sectoid soldier with the only difference between them being the contents of the builtInWeaponSets: list:
A: Sectoid with Plasma Pistol | Plasma Pistol Clip
B: Sectoid with Plasma Rifle | Plasma Rifle Clip
C: Sectoid with Heavy Plasma  | Heavy Plasma Clip

Then membersRandom: would randomly deploy either A, B or C version of the Sectoid soldier every time a Rank 5 was placed in the UFO. So if a UFO had 4 soldiers in it they could potentially all be Rank 5 soldier but be carrying different equipment.

Is this membersRandom: + builtInWeaponSets: the best method for setting up multiple potential loadouts for the same unit in a UFO without other aliens of the same rank sharing that randomized loadout, or is there a different way of doing this?

Help / (OXCE) SmokeThreshold: not preventing smoke from appearing?
« on: November 04, 2019, 12:43:03 pm »
When the weapon's projectile explodes it still produces smoke from the explosion even though I've set SmokeThreshold: to the high value of 99999.

Am I misunderstanding how SmokeThreshold: operates?

Does it not increase the tier of smoke on the struck tile by the number of times the weapon's impact power can be divided into the SmokeThreshold: value?

SmokeThreshold:    How much damage is needed to create smoke on a tile.

Here is the code I'm working with:
Code: [Select]
    size: 0.3
    costSell: 61000
    weight: 1
    bigSprite: 602
    floorSprite: 631
    handSprite: 2464
    bulletSprite: 1
    fireSound: 123
    hitSound: 0
    hitAnimation: 0
    power: 10 # Was 75
    damageType: 3
      ToHealth: 0.1
      ToWound: 0.1
      RandomWound: false
      ToStun: 0.0
      ToTile: 0.05
      SmokeThreshold: 99999
      FixRadius: 3
      flatHundred: 1.0
    accuracyAimed: 84
    tuAimed: 44
      firing: 0.0
      throwing: 1.0
    clipSize: -1
    battleType: 1
    twoHanded: false
    invWidth: 1
    invHeight: 1
    attraction: 9
    arcingShot: true
      shots: 1
      ammoSlot: 0
      arcing: true

Help / What is the maximum number of different aliens per-battle?
« on: October 28, 2019, 07:55:30 am »
I'm currently reading the alienRaces: section of the UFOpaedia, am I correct in my assumption that members: controls which aliens are able to be found in a battle making the max different types of alien units per battle 8?

Alien crew associated with this alien race (e.g. race units + terrorist units), defined by a list of unit string IDs. Order here will define rank in terms of deployment. Generally speaking the order is:

    0 - Commander
    1 - Leader
    2 - Engineer
    3 - Medic
    4 - Navigator
    5 - Soldier
    6 - Terrorist 1
    7 - Terrorist 2

but of course, not all races have all ranks, so the "fill in" rank would be listed multiple times (see Ethereals).


If I am understanding correctly membersRandom: (OXCE) can be used to drastically expand this by making each members: slot pull from a different list of potential enemies each time one is placed.

Alternative to members. Instead of defining just a single unit type per alien rank, you can define any number of unit types here and one will be chosen randomly (each time a new unit is generated). To increase a chance of a certain unit type being selected, you can add it multiple times.

So in OpenXcom the limit would be 8 but in OXCE the limit is much higher.

Help / (OXCE) How is "nameAsAmmo" used?
« on: October 28, 2019, 12:50:14 am »
I noticed a variable called "nameAsAmmo" in the UFOpaedia "Ruleset Reference Nightly > Items > Naming, Categorization and Storage" section.

Unfortunately a search of the forum for information on the use of nameAsAmmo came up empty.

Could someone please explain its use and the syntax required to code it into an entry in the items: section?

I'm hoping that meaning of the variable's description "Extension for the name of weapons loaded with this item as ammo." is that you can store a second string of text in it which is added to the end of the text for the equipment the ammo is loaded into.

Example images of how that would be useful are attached to this post:

Help / (OXCE) Error when loading custom bullet sprites?
« on: October 23, 2019, 07:37:28 am »
I'm trying to add custom bullet sprites however I'm encountering an error when starting OXCE.

So far I've added the images to the extraSprites: section and that appears to load without displaying an error. However when I assign the index for bulletSprite: in the items: section I get the following error:

"ERROR: failed to load 'Bullet Example'; mod disabled
Error for 'STR_EXAMPLE_WEAPON': offset '875' exceeds mod size limit 57 in set 'Projectiles'

Here is the code for the extraSprites: section:
Code: [Select]
  - type: Projectiles
    height: 3
    width: 65
    subX: 3
    subY: 3
      385: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      420: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      455: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      490: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      525: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      595: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      630: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      665: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      700: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      735: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      770: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      805: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      840: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png
      875: Resources/Bullet_Sprite_Example/Bullets/BlueHeavyLaser_bullet.png

Here is the code for the items: section:
Code: [Select]
    size: 0.2
    costSell: 36900
    weight: 8
    bigSprite: 1
    floorSprite: 1
    handSprite: 0
    bulletSprite: 875
    fireSound: 1
    hitSound: 1
    hitAnimation: 1
    power: 60
    damageType: 4
    accuracyAuto: 46
    accuracySnap: 65
    accuracyAimed: 100
    tuAuto: 34
    tuSnap: 25
    tuAimed: 50
    clipSize: -1
    battleType: 1
    twoHanded: true
    invWidth: 1
    invHeight: 3
    attraction: 9
    listOrder: 3725

I'll also attach to this post a small example mod containing the above code that reproduces the error message.

After defeating the last alien a prompt appeared with the following message:
Mission complete

1 of us is still fatally wounded

End Mission?

(Question 1)
What is the negative in successfully completing a mission while you still have wounded personnel?
(Do they just take longer to heal on the Geoscape or is there an additional penalty?)

(Question 2)
I don't remember seeing this before, is it a feature of OXCE?
(I'm going to feel really silly if this was present in classic X-Com and I've just forgotten about it.)


I'm trying to increase the speed that a weapon that uses a X1.PCK explosion animation can fire at, but at the moment the long animation has to finish playing before the next projectile can be fired.

Is there a way to increase/decrease the speed that an explosion's animation plays at?

I've tried using the explosionSpeed: variable on both the weapon and the ammo items, but so far I haven't noticed an increase or reduction in the animations speed.

Is explosionSpeed: only for bullet impacts and a different command is used specifically for X1.PCK based explosion animations?

I would be interested in the ability for weapons or ammo to be configured so that on impact the struck unit is afflicted with "Panic", "Berserk" or "Mind Control".

This would preferably be independent of the units morale check and unlike a PSI attack would not be reliant on the attacker or defenders psionics stats as the effect would simply be 100% certain to occur.

Example weapon that causes struck units to become Berserk:

Code: [Select]
    panicOnHit: false
    berserkOnHit: true
    mindControlOnHit: false
    size: 0.2
    costSell: 36900
    weight: 8
    bigSprite: 0
    floorSprite: 0
    handSprite: 8
    bulletSprite: 6
    fireSound: 11
    hitSound: 19
    hitAnimation: 36
    power: 60
    damageType: 4
    accuracyAuto: 46
    accuracySnap: 65
    accuracyAimed: 100
    tuAuto: 34
    tuSnap: 25
    tuAimed: 50
    clipSize: -1
    battleType: 1
    twoHanded: true
    invWidth: 1
    invHeight: 3

Help / Panic, Berserk or Mind Control on projectile hit
« on: October 15, 2019, 02:17:56 pm »
I'm hoping that there is a way to have a weapon or ammo type that causes a unit struck by its projectile to suffer the "Panic", "Berserk" or "Mind Control" effect without lowering the units moral.

So basically the effect itself is triggered independently of the units Morale check.

Perhaps an items: variable something like this:
- panicOnHit: 1
- berserkOnHit: 1
- mindControlOnHit: 1

After looking over the
UFOpaedia's Ruleset Reference Nightly I didn't notice any commands to perform this action, is it possible?

Help / Alien use of ammo: AI can use additional ammo slots?
« on: October 08, 2019, 12:02:32 pm »
If you define a weapon with multiple ammo slots is the enemy AI able understand and use the additional ammo types?

Or is this strictly a feature for player units?

(UFOpaedia: Compatible ammo and Action Mapping)
Code: [Select]
       compatibleAmmo: [ STR_AMMO_1, STR_AMMO_2 ]
       tuLoad: 5
       tuUnload: 2
       compatibleAmmo: [ STR_AMMO_3 ]
       tuLoad: 10
       tuUnload: 4
       compatibleAmmo: [ STR_AMMO_1, STR_AMMO_4 ]
       tuLoad: 10
       tuUnload: 4
       compatibleAmmo: [ STR_GRENADE ]
       tuLoad: 20
       tuUnload: 8
Code: [Select]
     shots: 1
     name: STR_AIMED_SHOT
     ammoSlot: 0
     arcing: false
     shots: 2
     ammoSlot: 0
     arcing: false
     shots: 1
     ammoSlot: 3
     arcing: true

Help / Alien use of ammo: Can they run out?
« on: October 08, 2019, 11:57:11 am »
Do enemy units consume the ammo in their inventory as they fire weapons and reload from their own personal inventory supplies when necessary?

Or do they just have an infinite supply of ammo and only the player is restricted by a units total ammo loaded/carried?

Pages: [1] 2 3 4