Vehicle Energy
by Neil Marshall · in Torque Game Engine · 07/07/2003 (7:25 pm) · 6 replies
Are there any existing functions that will reduce the energy on the vehicle or is that something I'm going to have to program?
I see a setEnergyLevel function and it appears to work, but I can't find any functions that would reduce it.
I see a setEnergyLevel function and it appears to work, but I can't find any functions that would reduce it.
#2
07/07/2003 (7:35 pm)
Well, I was looking in the script, but I'm probably going to have to adjust it in C++ for what I want to do (eventually).
#3
07/08/2003 (1:56 am)
The vehicle script I'm using has a setting of 'maxEnergy = 100;'.
#4
07/08/2003 (7:15 am)
Yes, that sets the max energy, and then I can setEnergyLevel( 50 ); and it will fill the meter 50%, but I can't seem to find any functions which drain the energy. Are there any?
#5
07/08/2003 (7:23 am)
function reduceEnergy(%object, %amount) {
%currentLevel = %object.getEnergyLevel();
%newLevel = %currentLevel - %amount;
%object.setEnergyLevel(%newLevel);
}
#6
07/08/2003 (7:25 am)
Well, I walked right into that one :) So there are no existing functions. Gotchya. Thanks for the code.
Associate Kyle Carter