[C++] Weapon reload time

[C++] Weapon reload time

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

[C++] Weapon reload time

Post by lamer »

How to get weapon's reload percentage?
Consider armbanth in ZK. It has manually fired weapon, UnitDef::CanManualFire == true, WeaponDef::GetReload == 30. But i didn't find any Unit's or WeaponMount's state call to get current reload percents.

As a workaround i saved the frame in which weapon fired and did next fire check only after constant number of reload frames. But logic breaks if unit was paralyzed or disarmed.

BTW, side question: There is Unit::IsParalyzed for stunned units, but how can i access disarmed state (e.g. unit can move but can't fire)?
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: [C++] Weapon reload time

Post by lamer »

About disarmed: it appears to be a specific ZK's feature and should be found in UnitRulesParam "disarmed".

And of course there is no weapon state functions like in lua. Should implement something similar to that.
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: [C++] Weapon reload time

Post by lamer »

Post Reply

Return to “AI”