Determine unit's explosion type

Determine unit's explosion type

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Determine unit's explosion type

Post 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?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Determine unit's explosion type

Post 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.)
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: Determine unit's explosion type

Post 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)?
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: Determine unit's explosion type

Post 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
Post Reply

Return to “AI”