Author Topic: [SOLVED][Suggestion]Random alien stats.  (Read 8195 times)

Offline peirceg

  • Captain
  • ***
  • Posts: 72
    • View Profile
Re: [Suggestion]Random alien stats.
« Reply #15 on: November 22, 2020, 01:56:04 am »
Right, here's a sample script to randomly increase sectoid HP by 0-10:

Code: [Select]
armors:
  - type: SECTOID_ARMOR0
    scripts:
      createUnit: |
        var int rngValue;
        var int newValue;
        battle_game.randomRange rngValue 0 10;
        unit.getHealth newValue;
        add newValue rngValue;
        unit.Stats.setHealth newValue;
        unit.setHealth newValue;
        return;

How would this work if i also wanted to add a line for TUs. stamina, str etc?

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3349
    • View Profile
Re: [SOLVED][Suggestion]Random alien stats.
« Reply #16 on: November 22, 2020, 03:04:35 am »
Code: [Select]
        battle_game.randomRange rngValue 0 10;
        unit.getHealth newValue;
        add newValue rngValue;
        unit.Stats.setHealth newValue;
        unit.setHealth newValue;
this part need be repeated but part `Health` replaced by `TimeUnits`. Some stats live only in `unit.Stats.*` and do not need all operations to change.
To final all stats that are editable look to log with verbose logging enabled, it will dump all function that scripts can use (aka `unit.Stats.setHealth` and other similar).

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: [SOLVED][Suggestion]Random alien stats.
« Reply #17 on: November 22, 2020, 12:59:41 pm »
Attached is a sample mod changing all stats.
« Last Edit: November 22, 2020, 01:23:27 pm by Meridian »

Offline Valmont

  • Sergeant
  • **
  • Posts: 16
    • View Profile
Re: [SOLVED][Suggestion]Random alien stats.
« Reply #18 on: November 23, 2020, 03:51:38 am »
Attached is a sample mod changing all stats.

Can this be added as a optional sub mod for the next OXCE version?

I feel that just like the range based accuracy submod, random stats for aliens will make the game a lot more unpredictable, the key trademark of UFO and TFTD.