Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get PowerCell energy level
#1
Hello again. This game have some methods for get information about current battery level in bot? I want to automatize battery replace, but can't find anything about thread theme.
#2
item.energyCell.energyLevel (or this.energyCell.energyLevel if you don't need to check other bots)

0-1 for PowerCells, 1-100 for NuclearCells

Example:
Code:
object bot = radar(someotherbot);
if (bot.energyCell.energyLevel == 0)
{
   replacebattery(bot);
}
if(this.energyCell.energyLevel < 0.2)
{
   gochargeyourself();
}
Spoiler :
[Image: unknown.png]
#3
(04-06-2017, 12:47 PM)tomangelo Wrote: 0-1 for PowerCells, 1-100 for NuclearCells
I'm pretty sure that's wrong. .energyLevel is always 0-1. You can use .category to check the type.

The 0-1, 1-100 thing is only for power= in level files.
#4
Is it documented anywhere? I just checked and couldn't find any SatCom pages that describes object's parameters like energyLevel or shieldLevel.
#5
@RaptorParkowsky It's in the documentation for "object" variable type
#6
(04-06-2017, 02:22 PM)krzys_h Wrote:
(04-06-2017, 12:47 PM)tomangelo Wrote: 0-1 for PowerCells, 1-100 for NuclearCells
I'm pretty sure that's wrong. .energyLevel is always 0-1. You can use .category to check the type.

The 0-1, 1-100 thing is only for power= in level files.

Oh, maybe you're right. I had mistake scene syntax with cbot syntax.
Spoiler :
[Image: unknown.png]


Forum Jump:


Users browsing this thread: 2 Guest(s)