ApplyRepair() isnt working right
by Snaggz · in Torque Game Engine · 08/10/2007 (10:45 am) · 2 replies
I am trying to use applyRepair() for a potion in my game and my AIPlayer and it wont let me applyrepair
I try:
playerBot.applyDamage(50);
playerBot.setRepairRate(0);
playerBot.applyRepair(50);
in the console and it wont repair still.
I go to playerBot.getRepairRate() and it says 0 and I still cant applyRepair(50).
Is it something with the AI player that the shape dosent repair right? heres my data Block:
datablock PlayerData( PBot : PlayerShape )
I try:
playerBot.applyDamage(50);
playerBot.setRepairRate(0);
playerBot.applyRepair(50);
in the console and it wont repair still.
I go to playerBot.getRepairRate() and it says 0 and I still cant applyRepair(50).
Is it something with the AI player that the shape dosent repair right? heres my data Block:
datablock PlayerData( PBot : PlayerShape )
#2
Hehe the Maurina Torque guide book says something about setting it to 0 first...
anyways thanks a lot Gary
08/10/2007 (4:30 pm)
It works!!! Hehe the Maurina Torque guide book says something about setting it to 0 first...
anyways thanks a lot Gary
Torque Owner Gary Preston
setRepairRate is used to auto repair when it is non zero at the rate it is set to. So you either use setRepairRate with a non-zero value to repair constantly (until you set it back to 0 anyway) over time. Or, you use applyRepair which will repair at the repairRate specified in the dataBlock