OpenXcom Forum

Modding => OpenXcom Extended => Topic started by: bulletdesigner on December 10, 2019, 11:41:54 pm

Title: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: bulletdesigner on December 10, 2019, 11:41:54 pm
Dunno if is talked already, but i´m in a need  :P

is there a way to make "a death tile". So if you step on a tile your unit or Ai units die automatically , i Know there´s a way around like placing prox granades or making a fire , but that way will be simple and without gimmicks, something like:
      - name: DESERT10
        width: 10
        length: 10
                deathtile:
            - [7, 7, 0]
            - [7, 8, 0]

Also is it possible to have gravitic fall damage?


To translate to the game i want to give a new angle on map environment

Title: Re: [Suggestion] Death Tile/ Gravitic death
Post by: The Martian on December 11, 2019, 04:44:30 am
is there a way to make "a death tile". So if you step on a tile your unit or Ai units die automatically

If the tile was instead linked to an item which was setup like a weapon the effect could be further customized allowing other outcomes than instant death, examples:
- Walking on tile builds up stun.
- Increase fatal wounds when stepped on.
- Decrease morale when stepped on.
- The effect could be resisted by configuring units armor to be immune to the damage type being inflicted by the tile.
-- Useful if aliens need to cross the tile during their patrol but you don't want the player units to do so.
-- Or if technology can be researched to allow crossing that obstacle safely.
- Sounds FX could trigger on effect hit.
- Visual effects can be triggered when the tile is stepped on using the hitAnimation: images.
- Basically anything that could be configured on an items: weapon could occur when the tile was crossed by the player's unit or alien units.

So for instance in Bulletdesigner's example the unit could fall through the ice onto the effect linked tile triggering the item STR_WATER_DEATH which plays a visual splash animation while a related sound FX triggers and the unit is hit with a lethal amount of damage.
Code: [Select]
      - name: DESERT10
        width: 10
        length: 10
                deathtile: STR_WATER_DEATH
            - [7, 7, 0]
            - [7, 8, 0]

Also is it possible to have gravitic fall damage?

I'm not against the idea of taking damage when falling, but wouldn't the current pathfinding potentially walk your unit off roofs/etc if that was the fastest way to the ground thus killing that unit unintentionally?
Title: Re: [Suggestion] Death Tile/ Gravitic death
Post by: Nord on December 11, 2019, 09:52:38 am
For now you can place an invisible mine to that tile, but this is one-time solution. :(
Title: Re: [Suggestion] Death Tile/ Gravitic death
Post by: The Martian on December 11, 2019, 02:21:34 pm
For now you can place an invisible mine to that tile, but this is one-time solution. :(

... in that case would the solution be granting the Proximity Grenade type equipment an items: variable that configures if the item is consumed when it is activated / exploded?
(I can think of several additional uses for such a feature.)

I'm not sure if a Proximity Grenade detects when a unit falls directly onto it though, or if it just activates when they step onto a tile near it at the same elevation?
(It would be weird to fall through the ice and then have to take an extra step for the unit to die.)

i Know there´s a way around like placing prox granades or making a fire , but that way will be simple and without gimmicks

I believe Bulletdesigner is looking for a way to quickly select sections of the map to have a death tile without placing each individual prox grenade, so the above wouldn't remove that setup process.

Unless there is a way to place large fields of Proximity Grenade type items and not just set the coordinates of each individual mine?
Title: Re: [Suggestion] Death Tile/ Gravitic death
Post by: davide on January 06, 2020, 11:27:54 am
+10 :P
Title: Re: [Suggestion] Death Tile/ Gravitic death
Post by: Meridian on October 14, 2020, 08:38:31 pm
To translate to the game i want to give a new angle on map environment

This is very vague, I don't understand what you want to do.
Please explain this example better.

Also is it possible to have gravitic fall damage?

What would it be used for?
Is it just to make pathfinding harder (to avoid all falls) or does it actually have a different purpose?
Title: Re: [Suggestion] Death Tile/ Gravitic death
Post by: Yankes on October 14, 2020, 10:07:11 pm
With bit of hacking this could be possible today, scripts can access to `SpecialTileType` of floor or object type. You can set some big value there, that is not used by engine for other things, and then check on next turn script to apply damage to unit if it on this tile.
Title: Re: [Suggestion] Death Tile/ Gravitic death
Post by: bulletdesigner on October 15, 2020, 12:35:50 pm
This is very vague, I don't understand what you want to do.
Please explain this example better.

What would it be used for?
Is it just to make pathfinding harder (to avoid all falls) or does it actually have a different purpose?


well makes player takes a decision to hit the ice or some bridge/platform  with lava below adding a new way to kill enemy units, also player will think twice before crossing on ice or unsteady bridge/platform for example.
Units can not cross this tiles since the tile is 255 to movement, the issue is they getting killed when drooping from above
Title: Re: [Suggestion] Death Tile/ Gravitic death
Post by: Meridian on October 17, 2020, 10:29:08 am
Added.

You can use the "Target_Type/SpecialType" MCD attribute (byte #59) to mark a tile part as a death trap.
Any value between 200 and 254 will work.
255 will also work, but please don't use it.
See attached screenshots from MCDView1 and MCDView2.

The tile part must be used as a FLOOR part in the map editor.
Walls and objects don't do anything.

If a unit walks into a tile with death trap floor, or if a unit falls into such a tile, the game will generate a death trap and activate it.
The death trap is an item with type "STR_DEATH_TRAP_XXX", where XXX is the number you have used as "SpecialType" in the MCD.

For 2x2 units, all 4 tiles are checked for death traps, but only 1 will trigger.

There are two types of death traps:
1. proximity grenades: work as classic proxy grenades, create AOE damage
2. melee items: highly experimental, create non-AOE damage

Examples:

1. proxy (battle type = 5)

Code: [Select]
items:
  - type: STR_DEATH_TRAP_250
    battleType: 5           # proxy
    damageType: 3
    power: 50
    damageAlter:
      FixRadius: 1          # minimum for nice explosion animation
      RandomType: 3
      ArmorEffectiveness: 0.0
      ToHealth: 20.0
      ToTile: 0.0
    weight: 3
    bigSprite: 21
    floorSprite: 21
    size: 0.1
    costSell: 400

2. melee (battle type = 3)

Code: [Select]
items:
  - type: STR_DEATH_TRAP_251
    battleType: 3           # melee
    damageType: 7
    power: 50
    damageAlter:
      RandomType: 3
      ArmorEffectiveness: 0.0
      ToHealth: 10.0
      ToTile: 0.0
    invWidth: 0             # hidden
    invHeight: 0            # hidden
    recover: false          # don't recover!
    hiddenOnMinimap: true   # hidden
    weight: 6
    bigSprite: 26
    floorSprite: 26         # use a blank sprite here
    handSprite: 80
    meleeSound: 54
    accuracyMelee: 100
    tuMelee: 30
    clipSize: -1
    size: 0.1
    costSell: 945
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: bulletdesigner on October 17, 2020, 03:01:35 pm
wow very nice, cant w8 to try it out
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: Nord on October 17, 2020, 10:52:57 pm
It is outstanding!
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: thePaleone on October 18, 2020, 12:02:37 pm
Can true gravity be also simulated? I have seen extreme explosion that wipe out the first level of a building, then left the other floors floating or hanging above the mission map. If there are no supporting walls, the floating floors should fall onto the ground.
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: Meridian on October 18, 2020, 12:31:49 pm
Can true gravity be also simulated? I have seen extreme explosion that wipe out the first level of a building, then left the other floors floating or hanging above the mission map. If there are no supporting walls, the floating floors should fall onto the ground.

No.
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: Kato on October 19, 2020, 12:09:07 pm
Hmmm...

1. Modder made an alien base with death tiles to trap x-com soldiers.
2. Hidden Movement phase.
3. MANY aliens stepped at death tiles and died without even being spotted by x-com.

How to avoid this situation? Can AI be tweaked by some boolean in alienDeployments? True - aliens know about death tiles and not stepping at 'em. False - both player and AI are not informed what tiles are traps.
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: Meridian on October 19, 2020, 01:14:56 pm
Death traps are death traps, for xcom, aliens and civilians alike.

Works exactly according to the original request/specification.
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: bulletdesigner on October 19, 2020, 02:29:54 pm

How to avoid this situation? Can AI be tweaked by some boolean in alienDeployments? True - aliens know about death tiles and not stepping at 'em. False - both player and AI are not informed what tiles are traps.

Why not make a map part that has no route connection that way alien wont go that route
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: The Martian on October 19, 2020, 02:48:26 pm
Hmmm...

1. Modder made an alien base with death tiles to trap x-com soldiers.
2. Hidden Movement phase.
3. MANY aliens stepped at death tiles and died without even being spotted by x-com.

How to avoid this situation? Can AI be tweaked by some boolean in alienDeployments? True - aliens know about death tiles and not stepping at 'em. False - both player and AI are not informed what tiles are traps.

Perhaps you could make the damageType: that these death tiles are dealing not effect the alien units?
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: Solarius Scorch on October 19, 2020, 02:59:07 pm
Perhaps you could make the damageType: that these death tiles are dealing not effect the alien units?

This one sounds like the saniest oprion, and most in line with how X-Com operates.

(AI additions are always nice though.)
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: Meridian on October 19, 2020, 03:01:27 pm
This one sounds like the saniest oprion, and most in line with how X-Com operates.

The death traps will still trigger and stop the alien movement, even with zero damage.
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: Solarius Scorch on October 19, 2020, 03:04:04 pm
The death traps will still trigger and stop the alien movement, even with zero damage.

OK, but it feels rather fine to me. Rough terrain is rough.
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: JustTheDude/CABSHEP on October 19, 2020, 08:17:22 pm
Would it be possible for certain kind of such death tiles to be destroyable via explosives and projectiles? Something simillar to wheat field tiles. If yes, then it sounds like it would have big potential.
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: Meridian on October 19, 2020, 08:34:12 pm
Yes they can be destroyed like any other tile.
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: ValeriusPaipikus on October 21, 2020, 08:02:48 am
AWESOME.
Title: Re: [DONE][Suggestion] Death Tile/ Gravitic death
Post by: Meridian on October 21, 2020, 10:13:38 pm
Death traps can now be transformed into no death traps, per faction.

Code: [Select]
items:
  - type: STR_DEATH_TRAP_250
    targetMatrix: 7           # death trap to everyone, default

Options:
0 = death trap for no one
1 = for xcom
2 = for aliens
3 = for xcom and aliens
4 = for civilians
5 = for xcom and civilians
6 = for aliens and civilians
7 = for everyone

OXCE v6.7.1+ needed
Test build: https://lxnt.wtf/oxem/builds//Extended/Extended-6.7.1-a49e8a205-2020-10-21-win64.7z