I tested this method with couple entity types and find that it does not trigger dying sound and does not spawn corpse for unit type.
I though it might have been forgotten, since dying_explosion for spawners and turrets work.
Ps. oh I forgot. Based on wiki there should be sethealth, but it is missing in game.
[Resolved 0.4.0] [minor imperfection] die() method
[Resolved 0.4.0] [minor imperfection] die() method
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Re: [minor imperfection] die() method
Hi thank you for the report.
You are right with the die, it was inconsistency in our code, fixed for 0.4.
The health has been changed, now the access is through the operator =, I will update the wiki after the 0.4 is released.
Edit: PS: testing this ingame with command
Feels like finger of death 
You are right with the die, it was inconsistency in our code, fixed for 0.4.
The health has been changed, now the access is through the operator =, I will update the wiki after the 0.4 is released.
Code: Select all
unit.health = 5 -- set unit health
print(unit.health) -- read unit health
Code: Select all
game.player.character.getselected().die()

Re: [minor imperfection] die() method
Cool. Could make better god game than black & white 

Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Re: [minor imperfection] die() method
rk84 wrote:Cool. Could make better god game than black & white



Now if only I could find/win/earn a million dollars and make sure it happens

<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me
Or drop into #factorio on irc.esper.net
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me

Or drop into #factorio on irc.esper.net