Setting the Boss health to 1000
by Andy Hawkins · in Torque Game Engine · 04/26/2007 (5:57 pm) · 9 replies
I don't really 'get' the damage / energy system. I want my Boss to have 1000 points of health, so it takes 1000 points of damage to take him down. When I set maxDamage to 1000 and damageLevel to 0, it still only takes about 3 shots of my 25 damage bullets to kill him.
How do I make my boss have 1000 points of health?
Also, do energyPerDamagePoint do anything?
How do I make my boss have 1000 points of health?
Also, do energyPerDamagePoint do anything?
#2
And what does damageLevel of 0 mean then? It's pretty confusing. Does the energy level have anything to do with damage?
04/26/2007 (10:13 pm)
So maxDamage means "the amount of damage a player can take before he dies"????And what does damageLevel of 0 mean then? It's pretty confusing. Does the energy level have anything to do with damage?
#3
When talking about "damageLevel", are you referring to the "getDamageLevel()" function?
If so, this function can be called to obtain the damage level of a player. For example, if a player had a "maxDamage" of 100, and was shot a few times taking 20 points of damage, the function would return 20. If you wanted to obtain how much health the player had, you would have to subtract maxDamage from damageLevel. So in this case the player would have 80 points of health left.
If this isn't what you're referring to, I have no idea what you're talking about. Where are you getting this damageLevel variable from?
04/26/2007 (10:28 pm)
Quote:Yes, and the player's "damageLevel" is how much damage a player has suffered. So a player at full health would have a "damageLevel" of 0. Get it?
So maxDamage means "the amount of damage a player can take before he dies"
When talking about "damageLevel", are you referring to the "getDamageLevel()" function?
If so, this function can be called to obtain the damage level of a player. For example, if a player had a "maxDamage" of 100, and was shot a few times taking 20 points of damage, the function would return 20. If you wanted to obtain how much health the player had, you would have to subtract maxDamage from damageLevel. So in this case the player would have 80 points of health left.
%maxDamage = %obj.getDatablock().maxDamage; %DamageLevel = %obj.getDamageLevel(); %curHealth = %maxDamage - %DamageLevel; %curHealth = getSubStr(%curHealth, 0, 2); %curHealth = mceil(%curHealth);
If this isn't what you're referring to, I have no idea what you're talking about. Where are you getting this damageLevel variable from?
Quote:No.
Does the energy level have anything to do with damage?
#4
then I override it with...
projectile ...
04/27/2007 (2:44 am)
Well here's my code and the boss dies just as easily as the other bad guys. It looks like it should work, but it doesn't - projectile strength at bottom...datablock PlayerData(PlayerSkeletonWithMp5)
{
renderFirstPerson = false;
emap = false;
className = Armor3;
shapeFile = "~/data/shapes/creatures/skeleton/skeleton_with_gun/skeleton_DTS_holdgun.dts";
cameraMaxDist = 1;
computeCRC = true;
...
maxDamage = 100;
maxEnergy = 60;
...then I override it with...
%player.setMaxDamage(1000); %player.setDamageLevel(0);
projectile ...
datablock ProjectileData(MP5Projectile)
{
projectileShapeName = "~/data/shapes/weapons/mp5/Mp5_Projectile_DTS.dts";
directDamage = 20;
radiusDamage = 20;
damageRadius = 1.5;
areaImpulse = 200;
explosion = MP5Explosion;
particleEmitter = mp5SmokeEmitter;
splash = MP5Splash;
muzzleVelocity = 100;
velInheritFactor = 0.3;
armingDelay = 0;
lifetime = 5000;
fadeDelay = 5000;
bounceElasticity = 0;
bounceFriction = 0;
isBallistic = false;
gravityMod = 0.80;
hasLight = true;
lightRadius = 4;
lightColor = "0.5 0.5 0.25";
hasWaterLight = true;
waterLightColor = "0 0.5 0.5";
};
#5
Is the "PlayerSkeletonWithMp5" datablock being used by the main user controlled player?
Is the "PlayerSkeletonWithMp5" datablock what the boss AI is using?
Try using some echos to see if your values are being set.
Also, there's no need for this line:
04/27/2007 (3:35 am)
Quote:That looks like your problem. When and where are you doing this?
then I override it with...
Is the "PlayerSkeletonWithMp5" datablock being used by the main user controlled player?
Is the "PlayerSkeletonWithMp5" datablock what the boss AI is using?
Try using some echos to see if your values are being set.
echo(%player.getDatablock().maxDamage;);
Also, there's no need for this line:
%player.setDamageLevel(0);
#6
04/27/2007 (5:37 am)
Yes both the player and the boss are of type PlayerSkeletonWithMp5. Am I overriding the values because of this? The boss however is a new instance of type PlayerSkeletonWithMp5. I use this code to make a new instancedatablock PlayerData(DemoPlayer2 : PlayerSkeletonWithMp5 )
{
shootingDelay = 3000;
};the boss is spawned with this // Create the demo player object
%player = new AIPlayer() {
dataBlock = DemoPlayer2;
//This value is set to true for AIPlayers, it is referenced in player.cs
//to help handle respawning bots properly.
isbot=true;
...
...
%player.setMaxDamage(1000);
%player.setDamageLevel(0);
...I create the player this way.// Create the player object
%player = new Player() {
dataBlock = PlayerSkeletonWithMp5;
client = %this;
};
#7
04/27/2007 (6:10 am)
Could you not do something like this?datablock PlayerData(DemoPlayer2)
{
..........
maxDamage = 1000;
..........
};Then inherit everything but health and shooting delay.datablock PlayerData(DemoPlayer2 : PlayerSkeletonWithMp5 )
{
shootingDelay = 3000;
maxDamage = 100;
};Just wondering.
#8
So the user controlled player datablock might look like this:
And for the AI skeleton:
04/27/2007 (6:33 am)
As I showed you in my second post and as Caleb mentions, just set your maxDamage value using inheritance.So the user controlled player datablock might look like this:
datablock PlayerData(PlayerSkeletonWithMp5)
{
renderFirstPerson = false;
emap = false;
className = Armor3;
shapeFile = "~/data/shapes/creatures/skeleton/skeleton_with_gun/skeleton_DTS_holdgun.dts";
cameraMaxDist = 1;
computeCRC = true;
...
maxDamage = 100;
maxEnergy = 60;
...And for the AI skeleton:
datablock PlayerData([b]AISkeletonWithMp5[/b] : PlayerBody)
{
maxDamage = 1000;
}Create the player in the normal way and your boss like this:// Create the demo player object
%player = new AIPlayer() {
dataBlock = [b]AISkeletonWithMp5[/b];
//This value is set to true for AIPlayers, it is referenced in player.cs
//to help handle respawning bots properly.
isbot=true;
#9
04/27/2007 (8:42 am)
Alrighty got it sussed. Thanks for your help :)
Torque Owner Tim Heldna
datablock PlayerData(Boss : PlayerBody) { maxDamage = 1000; }And you will have to adjust the amount of damage your projectile inflicts:
datablock ProjectileData(yourWeaponsProjectile) { ... directDamage = 1; ... }