T3D 1.1 Beta 3 - repairRate clarification for the documentation
by elvince · in Torque 3D Professional · 12/18/2010 (4:57 pm) · 5 replies
Here is the extract of the repair rate comment:
From what I understand, there are 2 repair rate:
1 - from Datablock, this only restrict how the mRepairReserve is apply. Read: How much per tick you will get from the repair reserve to the damagelevel
2 - from SetRepairRate function - Set a repair rate per tick like a Heal Over Time.
So the datablock definition is not ok. It should be
"Rate at wich the repair reserve is substracted from the damage level. In Unit per ticks"
Does everyone agree? or did I miss something?
Thanks,
addField( "repairRate", TypeF32, Offset(repairRate, ShapeBaseData),
"Rate at which damage is repaired in damage unhttp://www.garagegames.com/its/sec.n"
"This value is subtracted from the damage level until it reaches 0." );From what I understand, there are 2 repair rate:
1 - from Datablock, this only restrict how the mRepairReserve is apply. Read: How much per tick you will get from the repair reserve to the damagelevel
2 - from SetRepairRate function - Set a repair rate per tick like a Heal Over Time.
So the datablock definition is not ok. It should be
"Rate at wich the repair reserve is substracted from the damage level. In Unit per ticks"
Does everyone agree? or did I miss something?
Thanks,
About the author
Recent Threads
#2
04/14/2011 (1:01 pm)
This documentation is still not updated in the preview release.
#3
ShapeBase derived objects also have an applyRepair method to heal the object for a certain amount but for this to work we have before to disable temporary the self repair
then apply the "single shot" heal
then re-enable the self repair
04/15/2011 (5:25 am)
AFAIK the repairRate specified into the datablock is just for having a way to specify a predefined self healing rate property for the object, then we must set the repair rate at that value for example withfunction aSelfHealingObject::onAdd(%DB , %mySelfHealingObject )
{
%mySelfHealingObject.setRepairRate( %DB.repairRate );
}ShapeBase derived objects also have an applyRepair method to heal the object for a certain amount but for this to work we have before to disable temporary the self repair
%mySelfHealingObject.setRepairRate( 0 );
then apply the "single shot" heal
%mySelfHealingObject.applyRepair( %repairAmount );
then re-enable the self repair
%mySelfHealingObject.setRepairRate( %mySelfHealingObject.getDatablock().repairRate );
#4
What I said was based on old docs. It has changed or the old docs were wrong.
Looking at the script reference it say both repairs (repairRate, coming from the applyRepair method, and setRepairRate) can coexist.
I'd be curious to check if that's true or false...
My fault to not check before writing! Sorry :-)
Anyway the script reference say:
So I would say:
04/15/2011 (9:09 am)
Elvince, after further investigation it looks you're pretty right. What I said was based on old docs. It has changed or the old docs were wrong.
Looking at the script reference it say both repairs (repairRate, coming from the applyRepair method, and setRepairRate) can coexist.
I'd be curious to check if that's true or false...
My fault to not check before writing! Sorry :-)
Anyway the script reference say:
- void ShapeBase::applyRepair ( float amount )
- void ShapeBase::setRepairRate ( float rate )
Repair damage by the specified amount.
Note that the damage level is only reduced by repairRate per tick, so it may take several ticks for the total repair to complete.
Set amount to repair damage by each tick.
Note that this value is separate to the repairRate field in ShapeBaseData. This value will be subtracted from the damage level each tick, whereas the ShapeBaseData field limits how much of the applyRepair value is subtracted each tick. Both repair types can be active at the same time.
So I would say:
addField( "repairRate", TypeF32, Offset(repairRate, ShapeBaseData),
"When the applyRepair ShapeBase method is applied this is the value will be subtracted from the damage level every tick until all the amount of applyRepair has been subtracted.n"
"This heal over time can coexist with that setted from setRepairRate" );
#5
04/21/2011 (4:05 pm)
Logged as an improvement request in TDOC-251.
Associate Steve Acaster
[YorkshireRifles.com]