aliens

Author Topic: [SCRIPT] Lucky Rabbit's Foot  (Read 4790 times)

Offline peirceg

  • Captain
  • ***
  • Posts: 72
    • View Profile
[SCRIPT] Lucky Rabbit's Foot
« on: May 19, 2020, 11:12:01 am »
I would love to see some soldiers having a very small chance of not dying after being killed as long as their corpse was not destroyed. Is this possible with the current engine?

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: [SCRIPT] Lucky Rabbit's Foot
« Reply #1 on: May 19, 2020, 12:05:53 pm »
I would love to see some soldiers having a very small chance of not dying after being killed as long as their corpse was not destroyed. Is this possible with the current engine?

what does it mean "not dying after being killed" ?

Offline vadracas

  • Colonel
  • ****
  • Posts: 285
  • Just another player/modder combo.
    • View Profile
Re: [SCRIPT] Lucky Rabbit's Foot
« Reply #2 on: May 19, 2020, 12:17:29 pm »
I'm assuming he means that even after a soldier reaches zero hp and dies they have a small chance to stand up again?!

I don't get why-soldiers can already fall unconscious and stand up again.

Offline JustTheDude/CABSHEP

  • Colonel
  • ****
  • Posts: 372
    • View Profile
Re: [SCRIPT] Lucky Rabbit's Foot
« Reply #3 on: May 19, 2020, 01:14:55 pm »
I'm assuming he means that even after a soldier reaches zero hp and dies they have a small chance to stand up again?!

I don't get why-soldiers can already fall unconscious and stand up again.

They fall unconscious if their stun damage exceeds their HP. In some rare cases soldier might get enough stun damage and HP damage, so that he barerly falls unconscious. Every soldier passively regenerates stun damage, it might happen that during next turn he just stands up.

Offline vadracas

  • Colonel
  • ****
  • Posts: 285
  • Just another player/modder combo.
    • View Profile
Re: [SCRIPT] Lucky Rabbit's Foot
« Reply #4 on: May 19, 2020, 02:08:21 pm »
They fall unconscious if their stun damage exceeds their HP. In some rare cases soldier might get enough stun damage and HP damage, so that he barerly falls unconscious. Every soldier passively regenerates stun damage, it might happen that during next turn he just stands up.


Errr.... I understand how unconsciousness works. I was saying that I didn't get why this wasn't good enough for whoever suggested that dead soldiers could turn out to be unconscious.

Offline JustTheDude/CABSHEP

  • Colonel
  • ****
  • Posts: 372
    • View Profile
Re: [SCRIPT] Lucky Rabbit's Foot
« Reply #5 on: May 19, 2020, 02:13:37 pm »

Errr.... I understand how unconsciousness works. I was saying that I didn't get why this wasn't good enough for whoever suggested that dead soldiers could turn out to be unconscious.

Because he most likely wants another mechanic to help him in game, while save-scumming exist.

Edit by Meridian: forgot to move these two posts from the original thread:

Post by sanyaskillpro:

Because he most likely wants another mechanic to help him in game, while save-scumming exist.
Xenonauts has this mechanic and it's not that bad. IIRC it's 50% base chance to get revived, but -1% for every point of overdamage. Basically it helps when someone dies from chip damage through armor stripping, but if you take a burst from heavy weapon at close range you're 100% dead, no rng involved. Also you'd need to protect the body from explosions or grab it(if you're retreating), when the revive is not even guaranteed. Sure it's a pure buff for the player, but nothing too gamebreaking.

Post by peirceg:

Because he most likely wants another mechanic to help him in game, while save-scumming exist.

tbh I play ironman, and this adds to the ongoing story of a lucky lucky survival instead of just a straight 100% dead person. The whole point is that I dont want to save scum, and that soldiers being dead should not always be a foregone conclusion. Finally, what is wrong in playing a single player game the way I want to?

Xenonauts has this mechanic and it's not that bad. IIRC it's 50% base chance to get revived, but -1% for every point of overdamage. Basically it helps when someone dies from chip damage through armor stripping, but if you take a burst from heavy weapon at close range you're 100% dead, no rng involved. Also you'd need to protect the body from explosions or grab it(if you're retreating), when the revive is not even guaranteed. Sure it's a pure buff for the player, but nothing too gamebreaking.

Ahh Yes now I remember where this mechanic came from. I bounced off this game when I realized that aliens do not panic.
« Last Edit: May 24, 2020, 11:59:02 am by Meridian »

Offline peirceg

  • Captain
  • ***
  • Posts: 72
    • View Profile
Re: [SCRIPT] Lucky Rabbit's Foot
« Reply #6 on: May 19, 2020, 04:30:56 pm »
Should have checked my logical grammar there lol. I mean killed on the battlescape only to have a chance of just being severely wounded.

Offline vadracas

  • Colonel
  • ****
  • Posts: 285
  • Just another player/modder combo.
    • View Profile
Re: [SCRIPT] Lucky Rabbit's Foot
« Reply #7 on: May 19, 2020, 04:50:10 pm »
We understand what you mean! But that is literally the same as falling unconscious from natural stun damage taken while being injured and bleeding but surviving through the battle.


There is no difference except one makes sense.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: [SCRIPT] Lucky Rabbit's Foot
« Reply #8 on: May 19, 2020, 04:58:38 pm »
We understand what you mean! But that is literally the same as falling unconscious from natural stun damage taken while being injured and bleeding but surviving through the battle.

I did NOT understand what he meant.
That's why I asked!

Should have checked my logical grammar there lol. I mean killed on the battlescape only to have a chance of just being severely wounded.

Yes, this should be possible via Yankes scripts.
"damageUnit" script hook.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: [SCRIPT] Lucky Rabbit's Foot
« Reply #9 on: May 23, 2020, 11:05:37 pm »
Should have checked my logical grammar there lol. I mean killed on the battlescape only to have a chance of just being severely wounded.

Mod attached.

When a soldier is hit and about to be killed, he has a 5% chance to just be stunned (and turned invulnerable) instead.
Cannot be revived.
At the end of the mission, the soldier will suffer wound recovery time proportional to his entire hp.

PS: killing and reviving the soldier later is not possible currently (as far as I can say), so I had to keep the soldier alive (but ignored).
PS2: a link to a similar mechanic from xenonauts for reference: https://xenonauts.fandom.com/wiki/Soldier_Recovery
« Last Edit: November 19, 2020, 12:35:07 am by Meridian »

Offline peirceg

  • Captain
  • ***
  • Posts: 72
    • View Profile
Re: [SCRIPT] Lucky Rabbit's Foot
« Reply #10 on: May 24, 2020, 01:08:29 am »
Thank you ill test it later today. Just a quick confirmation this is the line that sets chance to be not killed right?

set temp 5

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: [SCRIPT] Lucky Rabbit's Foot
« Reply #11 on: May 24, 2020, 01:12:16 am »
Thank you ill test it later today. Just a quick confirmation this is the line that sets chance to be not killed right?

set temp 5

yes

Offline Ashghan

  • Colonel
  • ****
  • Posts: 169
    • View Profile
Re: [SCRIPT] Lucky Rabbit's Foot
« Reply #12 on: May 24, 2020, 01:33:27 pm »
I'm courious - how does this script handle being on fire?

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: [SCRIPT] Lucky Rabbit's Foot
« Reply #13 on: May 24, 2020, 04:33:01 pm »
I'm courious - how does this script handle being on fire?

It doesn't handle it.
The unit's hp is reset to max every turn, the fire will just go away at some point...