Author Topic: [Chat] Scripting basics  (Read 22428 times)

Offline Kzer-Za

  • Colonel
  • ****
  • Posts: 140
    • View Profile
Re: Scripting basics
« Reply #60 on: September 01, 2019, 05:02:24 pm »
Thanks!

Offline N7Kopper

  • Captain
  • ***
  • Posts: 61
    • View Profile
Re: Scripting basics
« Reply #61 on: September 27, 2019, 10:26:21 pm »
After spending a fair bit of time reading through the script variables (a slightly out-of-date list, no references to mana, but I don't need it) I've realised that I still can't figure out how to specifically check for a unit being killed by an attack. Perhaps it's my inexperience with reading scripting languages or me rolling a suite of 1s on Spot, but it looks to be a fair bit harder to check for a unit being killed - or surviving, either works - than to check for taking no damage at all. (if eq to_health 0)

Yes, I'm having a crack at making Chryssalids and Tentaculats only zombify when they reduce the human target's HP to 0, not on any successful hit. (Hell, not even them specifically, a generic script that makes zombification work that way in general would be a nice example script) It'd be a nice learning experience for me to be able to make it.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9077
    • View Profile
Re: Scripting basics
« Reply #62 on: September 27, 2019, 10:36:01 pm »
but it looks to be a fair bit harder to check for a unit being killed - or surviving, either works - than to check for taking no damage at all. (if eq to_health 0)

is checking whether to_health >= currentHealth enough? or are you looking for something more elaborate?

Offline N7Kopper

  • Captain
  • ***
  • Posts: 61
    • View Profile
Re: Scripting basics
« Reply #63 on: September 28, 2019, 05:05:27 pm »
is checking whether to_health >= currentHealth enough? or are you looking for something more elaborate?
Anything that checks for units not dying from that strike (and properly factors in who ought to be infected) is good enough, thanks. I admit, I'm not the best at this sort of thing, but next time I look at this I'll do that check.

It would probably help if I annotated the giant list of script parameters I have. :P

Anyways, if all goes well, I'll be coming back to this topic with a nicely debugged mod.
« Last Edit: September 28, 2019, 05:20:14 pm by N7Kopper »