How to specify damage type with entity.damage()?

Place to get help with not working mods / modding interface.
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

How to specify damage type with entity.damage()?

Post by FreeER »

The wiki says that damage can take an optional "damage type"...anyone know how to actually give it? I've tried entity.damage(1, game.forces.player, explosion) and "explosion". Console simply gives me "bad arg #2 to 'damage' (string expected, got table)", I've tried swapping the force and damage type and get the expected "table expected, got string". Tried even giving it a couple tables but no luck (i didn't really expect any with that lol)

so...help?
<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
kovarex
Factorio Staff
Factorio Staff
Posts: 8293
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: How to specify damage type with entity.damage()?

Post by kovarex »

So ... this is a bug :)
It tries to parse the second argument as damage type instead the third one :)

All I can say is, that it will get fixed in 0.8.0
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: How to specify damage type with entity.damage()?

Post by FreeER »

kovarex wrote:So ... this is a bug :)
It tries to parse the second argument as damage type instead the third one :)
Ok, wasn't sure if I was missing something :) I'd noticed the #2 and thought it should have been 3 but I wasn't entirely sure :D
<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
Post Reply

Return to “Modding help”