Author Topic: How do I make Chryssalids not always succeed?  (Read 20821 times)

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #30 on: July 27, 2018, 03:22:11 pm »
Yankes or Ohartenstein can write a script for you

Oh, I thought it was already done.


Simple: the chance of success is checked per attack, and is identical to the soldier's %remaining health. So it's possible for the attack to do no damage and turn them into a zombie, if they had already taken damage before. Probably they have a hole in their armor now...


I guess I'll hop back on the hype train then.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #31 on: July 27, 2018, 07:51:14 pm »
I also noticed in stats for nerds, armor has an attribute: Can be Zombified: true. How do I set this false for an armor?

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #32 on: July 27, 2018, 07:56:58 pm »
Code: [Select]
    zombiImmune: true

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #33 on: July 27, 2018, 07:57:28 pm »
I also noticed in stats for nerds, armor has an attribute: Can be Zombified: true. How do I set this false for an armor?

If you click on DEBUG button, you get the ruleset names of the attributes, in this case:

Code: [Select]
  zombiImmune: true

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #34 on: July 27, 2018, 09:05:05 pm »
Oh, I thought it was already done.


Simple: the chance of success is checked per attack, and is identical to the soldier's %remaining health. So it's possible for the attack to do no damage and turn them into a zombie, if they had already taken damage before. Probably they have a hole in their armor now...


I guess I'll hop back on the hype train then.
Is done in my code but not released. For functionality itself. You get number in range `1` to `100` then you can get value of attack (another number) and some stats of attacker and victim. With all this values you can do any basic arithmetic operations (like `+`, `-`, `/`, `*`, `%`) to get result in range of `0` to `100` and this number will be used by game engine to determine if this victim will change to zombi or not (`0` -> no zombi, `100` -> always zombi).

Offline kharille

  • Colonel
  • ****
  • Posts: 370
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #35 on: July 30, 2018, 10:44:38 am »
Oh?  I just shoot rookies and civilians when I know chryssalids are near.

Offline Ethereal

  • Commander
  • *****
  • Posts: 684
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #36 on: July 30, 2018, 11:00:56 am »
I don't really understand what these calculations are for, but I can confirm in armor with "zombiImmune: true" soldiers never become zombies. In the armor without this parameter, from turning into a zombie saves a "melee Dodge:" when Chryssalid stupidly misses the target. However if he not misses, the trouble can not be avoided, but it's as lucky. In General, the instruments to combat Chryssalid and Tentaculat full.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #37 on: October 12, 2020, 02:12:17 pm »
Pasting a sample script here, just in case people are still interested.

Code: [Select]
extended:
  scripts:
    damageUnit:
    # Global fix to Transformation attacks like Chryssalid zombification
    # Requires at least 1 hit point of damage before zombification triggers
    # This applies to *every* weapon that zombifies.  It *has* to get through armor to work.
      - offset: 4
        code: |
          if gt to_transform 0;
            if eq to_health 0;
              set to_transform 0;
            end;
          end;
          return;

Offline Ethereal

  • Commander
  • *****
  • Posts: 684
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #38 on: October 12, 2020, 05:33:50 pm »
Pasting a sample script here, just in case people are still interested.

I'm weak in scripts ... If set "if eq to_health 10" in this script, then the damage for transformation will have to be more than 10 points?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #39 on: October 12, 2020, 06:28:44 pm »
I'm weak in scripts ... If set "if eq to_health 10" in this script, then the damage for transformation will have to be more than 10 points?

eq stands for "equal"
you can use gt which stands for "greater than" and lt which stands for "less than"

so "if lt to_health 11" is what you're looking for... meaning "if to_health is less than 11, don't transform"

Offline Ethereal

  • Commander
  • *****
  • Posts: 684
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #40 on: October 12, 2020, 08:38:31 pm »
Meridian, does it work at you? Maybe not compatible with the vampirism script?
« Last Edit: October 12, 2020, 08:41:02 pm by Ethereal »

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #41 on: October 12, 2020, 09:16:05 pm »
Pasting a sample script here, just in case people are still interested.

Code: [Select]
extended:
  scripts:
    damageUnit:
    # Global fix to Transformation attacks like Chryssalid zombification
    # Requires at least 1 hit point of damage before zombification triggers
    # This applies to *every* weapon that zombifies.  It *has* to get through armor to work.
      - offset: 4
        code: |
          if gt to_transform 0;
            if eq to_health 0;
              set to_transform 0;
            end;
          end;
          return;
I wanted this, thanks!

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #42 on: October 12, 2020, 09:43:47 pm »
Meridian, does it work at you? Maybe not compatible with the vampirism script?

I just copied it from piratez, I didn't test it... I'll test it later.

Offline Ethereal

  • Commander
  • *****
  • Posts: 684
    • View Profile
Re: How do I make Chryssalids not always succeed?
« Reply #43 on: October 12, 2020, 09:51:19 pm »
I just copied it from piratez, I didn't test it... I'll test it later.

Oh, exactly! Found! I have a file with scripts from there. Thanks, figured it out.