Author Topic: Mana simulating Fatigue/PTS/Trauma  (Read 5234 times)

Offline SuperCaffeineDude

  • Colonel
  • ****
  • Posts: 108
    • View Profile
    • supercaffeinedude
Mana simulating Fatigue/PTS/Trauma
« on: November 13, 2019, 12:23:25 am »
Hi, I'm looking through the references, and I'm looking for the best way to simulate Fatigue with the current build.

One way of simulating seems to be to have all armors drain Mana, and then there's the commendations that I think are used in Pirates(Freshness) and X-Files(Readiness) I'm not really sure where to start with that  :-[

Would anyone be able to clarify the steps involved in making a mod for just this feature and let me know if I'm barking up the wrong tree?

How to take away mana every mission (edit: see below)
How to make mana effect unit's in-combat stats (i.e. their attributes not the weapon's attributes)

I'll see meanwhile if I can get it working  :-\ :P
Cheers!
« Last Edit: November 19, 2019, 12:57:29 pm by SuperCaffeineDude »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: Mana simulating Fatigue
« Reply #1 on: November 13, 2019, 12:34:58 am »
"freshness" and "readiness" are mana, not commendations

Offline SuperCaffeineDude

  • Colonel
  • ****
  • Posts: 108
    • View Profile
    • supercaffeinedude
Re: Mana simulating Fatigue
« Reply #2 on: November 13, 2019, 01:07:47 am »
"freshness" and "readiness" are mana, not commendations

Understood. I am just wondering how readiness/freshness is being used to simulate the effects of Fatigue

(i.e. do they use a commendation each battle to subtract readiness/freshness? (I'm guessing not now))

Can a Units supply of Mana be deducted in a Debriefing perhaps? Or at the start of mission?

All I want to do is...
Mana Supply effects base stats (i.e less/more mana effects unit's performance)
Mana Supply is "somehow" subtracted each mission (i.e. unit is tired)
Mana Supply is recovered at base over time (i.e. unit has rested)

Perhaps this is not the best way, I'm just trying to find something that works.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Mana simulating Fatigue
« Reply #3 on: November 13, 2019, 11:01:47 am »
Mana is recovered every day by an amount determined by base buildings. (Default: none.)
Mana can also be recovered through equipment, the same way for example energy can.
I am not aware of any other ways to replenish mana. Certainly nothing about commendations.

Offline SuperCaffeineDude

  • Colonel
  • ****
  • Posts: 108
    • View Profile
    • supercaffeinedude
Re: Mana simulating Fatigue
« Reply #4 on: November 14, 2019, 04:12:31 am »
Quote
Mana is recovered every day by an amount determined by base buildings. (Default: none.)

This part is good no worries  :)

Basically I'm not really after other ways to replenish it, just ways to take it away once per mission.

So I have all soldiers start with 10 mana -easy-
I have their base attributes degrade when mana is lost -unsure-
I have their mana degrade once every mission -unsure-
Have mana regained at base -easy-

My thoughts...
Each armor could consume 1 mana, but this is per turn not once per-mission
An explosive goes off in transport consuming 1 mana

Another idea might be that a unit spawns with grenade that takes 1 mana

something like...
isExplodingInHands true
blastRadius 1
Damage ToMorale

Not really sure how to make them spawn with something like that though.

Offline SuperCaffeineDude

  • Colonel
  • ****
  • Posts: 108
    • View Profile
    • supercaffeinedude
Re: Mana simulating Fatigue
« Reply #5 on: November 16, 2019, 09:45:26 am »
Ah I see you use armor recovery, as I kind of thought initally, silly me.

Code: [Select]
    recovery:
      mana:
        flatHundred: -0.01

Not sure what I must of been looking at, sorry for the confusion.

So question: "flatHundred" what does that do?

Also what would occur if the value was -0.0025? would mana decrease by 1 tick per 4 turns?

...

Thoughts... can Xcom armor be made to cause mana damage on death (i.e. explode dealing mana damage)?

If so maybe a large mana explosion 10 squares or so, could be triggered, simulating seeing/hearing a friend die...
An initial mana explosion could be triggered at the start of a battle, just simulating general fatigue...
Each hit of a weapon could also deal mana damage simulating a near death experience maybe...

An armor could reduce this effect by making the user feel "safe" i.e. a jumpsuit makes them feel exposed, a shield makes them feel safer.
High morale and energy could maybe resist the effect.

Idea: Invert it to something that accumulates from 0 to X, label it Trauma. i.e. David Smith starts with 0 Trauma, but ends up with 23 Trauma, he is left to R&R which reduces his Trauma back to 0.
« Last Edit: November 16, 2019, 10:01:35 am by SuperCaffeineDude »

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Mana simulating Fatigue/PTS/Trauma
« Reply #6 on: November 16, 2019, 02:38:16 pm »
`flatHundred` is dummy stat that always equal to 100, similar to `flatOne` that is always equal to 1.
And no, if result of this whole bonus is less than `0.5` then nothing will be changed, because game use round values.

`flatHundred: -0.016` ->  -2
`flatHundred: -0.01` ->  -1
`flatHundred: -0.007` ->  -1
`flatHundred: -0.003` ->  0

Offline SuperCaffeineDude

  • Colonel
  • ****
  • Posts: 108
    • View Profile
    • supercaffeinedude
Re: Mana simulating Fatigue/PTS/Trauma
« Reply #7 on: November 17, 2019, 03:57:42 pm »
`flatHundred` is dummy stat that always equal to 100, similar to `flatOne` that is always equal to 1.
And no, if result of this whole bonus is less than `0.5` then nothing will be changed, because game use round values.

`flatHundred: -0.016` ->  -2
`flatHundred: -0.01` ->  -1
`flatHundred: -0.007` ->  -1
`flatHundred: -0.003` ->  0

Thanks, seems sensible.

Request

I have hit a wall with the concept/practice of having Soldiers come with turn-0 grenades that drain the their own mana, as they (seem) to need to be triggered by the player, and cannot have their fuses primed by the computer.

What may be sensible is to have the LandingZone drop mana explosions instead.

I want to do something like this...
Code: [Select]
  - type: STR_FIRESTORM
    soldiers: 10
    vehicles: 1
    battlescapeTerrainData:
      name: FIRES
      mapDataSets:
        - BLANKS
        - LIGHTNIN
      mapBlocks:
        - name: FIRES
          width: 10
          length: 10
          items:
STR_ONETILEMANABOMB:
     - [5, 3, 1]
     - [5, 4, 1]
     #etc.
          fuseTimers:
STR_ONETILEMANABOMB: [0, 0]
    deployment:
      - [5, 3, 1, 2] # at each axis place bomb
      - [5, 4, 1, 2]
      - [4, 3, 1, 2]
      - [4, 4, 1, 2]
      - [4, 2, 1, 2]
      - [4, 5, 1, 2]
      - [3, 2, 1, 2]
      - [3, 5, 1, 2]
      - [2, 3, 1, 2]
      - [2, 4, 1, 2]

Does anyone have a basic RUL file for the SKYRANGER and other transports? I'd like to see if I can achieve this effect of each mission draining mana, rather than each turn.  :P

Also how does this fuse work, i.e. "STR_TIMEBOMB: [0, 0]" does it cause an explosion before or after the players turn? (Honestly I'm hoping before or this'll be really janky)
« Last Edit: November 17, 2019, 04:26:33 pm by SuperCaffeineDude »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Mana simulating Fatigue/PTS/Trauma
« Reply #8 on: November 17, 2019, 04:26:02 pm »
Rather than using a grenade, you can directly do this via a script - the createUnit hook runs for all your soldiers at the beginning of battle and could be used to subtract <x> mana from each of them right away.

Offline SuperCaffeineDude

  • Colonel
  • ****
  • Posts: 108
    • View Profile
    • supercaffeinedude
Re: Mana simulating Fatigue/PTS/Trauma
« Reply #9 on: November 19, 2019, 12:56:11 pm »
Riiiiiiiiiiiiiiiiiiiiiiiighty so I have blundered my way through this...

Code: [Select]
armors:
  - delete: STR_NONE_UC
  - type: STR_COVERALL_UC
    spriteSheet: XCOM_0.PCK
    spriteInv: MAN_0
    spriteFaceGroup: 6
    spriteFaceColor: [96, 96, 96, 96, 160, 160, 163, 163] #M0 F0 M1 F1 M2 F2 M3 F3
    spriteHairGroup: 9
    spriteHairColor: [144, 144, 164, 164, 245, 245, 166, 166] #M0 F0 M1 F1 M2 F2 M3 F3
    storeItem: STR_NONE
    corpseBattle:
      - STR_CORPSE
    frontArmor: 12
    sideArmor: 8
    rearArmor: 5
    underArmor: 2
    damageModifier:
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.0
      - 1.2
      - 1.6
      - 1.0
    loftempsSet: [ 3 ]
    scripts:
      createUnit: |
        var int rngValue;
        var int newManaValue;
        battle_game.randomRange rngValue 0 10;
        unit.getMana newManaValue;
        sub newManaValue rngValue;
        unit.setMana newManaValue;
        return;


This takes away a random amount of mana between 0-10 at the very start of mission, this may be useful to someone so I'll leave this here

This is obviously very basic, but much better than the grenades thank you ohartenstein23.

What I'd like is...

Change the name of STR_Mana to "Stress"/X
Colour change of Mana bar to black/X (it's not going to be a good thing to have)
Have effect to signify the stat hit

Have effects created by too much mana similar to X-files/Piratez.