Page 1 of 1

Determine unit's explosion type

Posted: 14 Dec 2014, 22:39
by lamer
Is it possible to determine unit's explosion type (C++ native AI)?
Particularly explosion radius is of interest to me.
I see "explodeAs" in lua unit files, but can't find anything related in springai::UnitDef.
Am i missing something or there is no such thing in C++ interface and should i add it?

Re: Determine unit's explosion type

Posted: 15 Dec 2014, 23:47
by knorke
"explodeAs" refers to a weapon, so you will find it not in unitDef but must look in a weaponDef.
In java there is http://spring.abma.de/doc-Interface-Jav ... onDef.html
"getAreaOfEffect()"
(For C++ do not know where to look.)

Re: Determine unit's explosion type

Posted: 16 Dec 2014, 01:10
by lamer
Thats right, C++ has WeaponDef::GetAreaOfEffect too. But how can i get value of "explodeAs" in C++/Java? Parse lua files?
Does lua's AI can get "explodeAs" from UnitDef (then i'll add similar API to C++/Java interface)?

Re: Determine unit's explosion type

Posted: 16 Dec 2014, 11:10
by lamer
UnitDef::GetDeathExplosion and GetSelfDExplosion returns
$$deprecated$$
Why they were deprecated when there is no substitution for them?

Edit: http://springrts.com/mantis/view.php?id=4633