Page 1 of 1

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

Posted: Thu Nov 07, 2013 5:34 pm
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?

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

Posted: Thu Nov 07, 2013 11:43 pm
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

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

Posted: Fri Nov 08, 2013 12:01 am
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