Author Topic: [Showcase] Hatching Chryssalids and Tentaculats  (Read 3695 times)

Offline Buscher

  • Colonel
  • ****
  • Posts: 184
    • View Profile
[Showcase] Hatching Chryssalids and Tentaculats
« on: March 22, 2021, 10:28:04 pm »
This is a show case for scripting. I will probably put some more proof of concepts on the forum at some point.

I have found this setSpawnUnit command in the scripting API so I wanted to do something with it.
One of the results is this mod "Hatching Chryssalids and Tentaculats" which handles zombification with scripting alone. The weapon of the Chryssalids and Tentaculats do not zombify in this mod.
Instead they infect soldiers with parasites which essentially is a tag used to determine damage per turn and whether soldiers should become zombies or not. Of course it's possible to spawn different units depending on the tag. So this means curses and such are also possible.

Of course anyone can use all the scripting of the mod. Feel free to do so. Some credit would be appreciated.

If you are curious you can find the mod on on mods.io

Code: [Select]
Features:
- Chryssalids and Tentaculats infect soldiers
- Infected soldiers turn to zombies whether by the infection itself or by any other damage
- Infected soldiers are indicated with a green color as visible feedback
- Medi-Kit can cure infections (previous painkiller position)
- Cure charges are dependent on research. The more research is done on Chryssalids and Tentaculats the more charges a Medi-Kit gets
- Infected surviving soldiers will be wracked by the parasite. This means that they will lose stats when finishing a mission still infected.
- Depending on research the stats loss will be reduced to 0.

A lot of thanks goes to Yankes who updated OXCE so this mod was possible.
As a consequence this requires the bleeding edge version of OXCE.

Required version:  Extended-7.0-ea2092bc5-2021-03-22.
You can find a download here

I hope you enjoy and any feedback would be appreciated.

Offline pWWWa

  • Sergeant
  • **
  • Posts: 36
    • View Profile
Re: [Showcase] Hatching Chryssalids and Tentaculats
« Reply #1 on: February 27, 2025, 02:58:25 pm »
Dear Buscher,

great thanks for that amazing mod. I slightly surprised why so fancy multinational script is so underrated by community :-)

Also, please, check some feedback:
- infected unit became orange, but not green in TFTD. Perhaps, it happens as planned, but if no -> please, replace COLOR_X1_PURPLE0 with COLOR_X1_GRAY;
- PSIed/MCed Chryssalids and Tentaculats also able to infect any alien unit, include zombies too. It can to occur "funny" endless transformation cycles, where 2 opposing"infectors" permanently generates yourself during hit exchanging (also infected zombie will spawn zombie again). I used my poor knowledge in y-script and particularly solved it via faction restricting:
Spoiler:
    damageUnit:
      - offset: 22 # infect unit
        code: |
          var ptr RuleArmor armorRule;
          var ptr RuleItem itemRule;
          var int temp;
          var int infectionDamage;
          var int side1;

          weapon_item.getRuleItem itemRule;
          itemRule.getTag infectionDamage Tag.CAN_DO_INFECTION_DAMAGE;

          if eq infectionDamage 0; # can't infect
            return;
          end;

          unit.getRuleArmor armorRule;
          armorRule.getSize temp;

          if eq temp 2; # don't affect tanks
            return;
          end;
          unit.getFaction side1;
          if eq side1 1; # don`t infect units at alien side <c> pWWWa
            return;
          end;

          if gt to_health 0; # only if pierced
            unit.setTag Tag.CURRENT_INFECTION_DAMAGE infectionDamage;
          end;

          return;
but I suppose, that correct solution for that issue is restriction for infecting exact units (especially STR_ZOMBIE), isn`t it ?
- it will be great, if incendiary / phosphor  damage type will able to remove infection from units too (based on comments in script code).