that last post was by me by the way.
Fps
HitBoxes and multipul attributes Pickels we need your help.
I'm not sure where you can download Cell Division, but that is where I demoed the perbone collision. The enemies in the game will only feel pain when shot in the 'chest'. I have to log in to post files. I'll do that in a bit and post the monster script.
Anyways, the common mistake you are making here is that you are using GetLastBoneHIt() as a High level command when it is actually a low level command.
Low level pain handling uses a command called. self.in_pain. This variable is true, if the enemies has just had its health attribute damaged. The vaiable resets itself to false after it has been checked.
if(self.in_pain)
{
BONE=GetLastBoneHit();
switch(BONE)
{
case "HEAD"
{
HighLevel("HeadDie");
}
case "LEG"
{
HighLevel("LegHit");
}
}
}
This snippet simply checks which bone was hit when the pawn has suffered pain and switches to a high level order accordingly.
Anyways, the common mistake you are making here is that you are using GetLastBoneHIt() as a High level command when it is actually a low level command.
Low level pain handling uses a command called. self.in_pain. This variable is true, if the enemies has just had its health attribute damaged. The vaiable resets itself to false after it has been checked.
if(self.in_pain)
{
BONE=GetLastBoneHit();
switch(BONE)
{
case "HEAD"
{
HighLevel("HeadDie");
}
case "LEG"
{
HighLevel("LegHit");
}
}
}
This snippet simply checks which bone was hit when the pawn has suffered pain and switches to a high level order accordingly.
here it is in cellmonster.s of Cell Division
http://terrymorgan.net/download.htm
{
if(self.in_pain)
{
HITS = HITS - 5;
if(HITS < 1){return true;}//check if dead
SetTargetPoint(random(1,128)-64,-64,random(1,128)-64);
FireProjectile("blooddrop","joint1",0,0,0,"none",0);
GB=GetLastBoneHit();
AddExplosion("BloodSpray",GB,0,0,0);
if(GB = "joint3")
{
HITS=HITS-10;
//ForceBackward(30);
if(random(1,200)>100)
{
ForceLeft(10);
}
else
{
ForceRight(10);
}
PlaySound("growler3.wav");
TM = self.time;
return true;
}
}
return false;
}]
http://terrymorgan.net/download.htm
{
if(self.in_pain)
{
HITS = HITS - 5;
if(HITS < 1){return true;}//check if dead
SetTargetPoint(random(1,128)-64,-64,random(1,128)-64);
FireProjectile("blooddrop","joint1",0,0,0,"none",0);
GB=GetLastBoneHit();
AddExplosion("BloodSpray",GB,0,0,0);
if(GB = "joint3")
{
HITS=HITS-10;
//ForceBackward(30);
if(random(1,200)>100)
{
ForceLeft(10);
}
else
{
ForceRight(10);
}
PlaySound("growler3.wav");
TM = self.time;
return true;
}
}
return false;
}]
- fps
- Posts: 504
- Joined: Mon Sep 26, 2005 9:54 pm
- Location: in a magical land devoid of hope, happiness, and sanity.
what is the HITS part of code?
What does this part of the code do?
SetTargetPoint(random(1,128)-64,-64,random(1,128)-64);
and what do i need to add to get it to check for another bone?
I think its like this.
{
if(self.in_pain)
{
HITS = HITS - 5;
if(HITS < 1){return true;}//check if dead
SetTargetPoint(random(1,128)-64,-64,random(1,128)-64);
FireProjectile("blooddrop","joint1",0,0,0,"none",0);
GB=GetLastBoneHit();
AddExplosion("BloodSpray",GB,0,0,0);
if(GB = "chest")
{
HITS=HITS-10;
//ForceBackward(30);
if(random(1,200)>100)
{
ForceLeft(10);
}
else
{
ForceRight(10);
}
PlaySound("ouch.wav");
TM = self.time;
HighLevel("ChestHit");
return true;
}
if(GB = "head")
{
HITS=HITS-10;
PlaySound("crunch.wav");
TM = self.time;
HighLevel("HEADSHOT");
return true;
}
}
return false;
}]
Did i get that right?
Thanks,
Fps
What does this part of the code do?
SetTargetPoint(random(1,128)-64,-64,random(1,128)-64);
and what do i need to add to get it to check for another bone?
I think its like this.
{
if(self.in_pain)
{
HITS = HITS - 5;
if(HITS < 1){return true;}//check if dead
SetTargetPoint(random(1,128)-64,-64,random(1,128)-64);
FireProjectile("blooddrop","joint1",0,0,0,"none",0);
GB=GetLastBoneHit();
AddExplosion("BloodSpray",GB,0,0,0);
if(GB = "chest")
{
HITS=HITS-10;
//ForceBackward(30);
if(random(1,200)>100)
{
ForceLeft(10);
}
else
{
ForceRight(10);
}
PlaySound("ouch.wav");
TM = self.time;
HighLevel("ChestHit");
return true;
}
if(GB = "head")
{
HITS=HITS-10;
PlaySound("crunch.wav");
TM = self.time;
HighLevel("HEADSHOT");
return true;
}
}
return false;
}]
Did i get that right?
Thanks,
Fps
what is the HITS part of code?
Looks like a variable, if you hit the monster 5 times in game he dies.
What does this part of the code do?
SetTargetPoint(random(1,128)-64,-64,random(1,128)-64);
Sets a random target point on the monster? Many of the
scripting commands were never documented, but you can check
http://dhost.info/realityfactory/docs
Looks like a variable, if you hit the monster 5 times in game he dies.
What does this part of the code do?
SetTargetPoint(random(1,128)-64,-64,random(1,128)-64);
Sets a random target point on the monster? Many of the
scripting commands were never documented, but you can check
http://dhost.info/realityfactory/docs
SetTargetPoint(random(1,128)-64,-64,random(1,128)-64);
FireProjectile("blooddrop","joint1",0,0,0,"none",0);
This is how to easily add blood drops in RF. I used this in Sacred Druid and Cell Division. Basically it fires a (harmless) projectile at a random location and the projectile is attached to a Decal Entity. Instant blood drop.
Yeah that looks right.
The HITS thing is to manage health attributes within the script. Basicallly hits is the mosters health.
Thanks for putting that onine hike1. I hope to be back soon with a couple of ports. A new version of Cell Division will be one of them.
FireProjectile("blooddrop","joint1",0,0,0,"none",0);
This is how to easily add blood drops in RF. I used this in Sacred Druid and Cell Division. Basically it fires a (harmless) projectile at a random location and the projectile is attached to a Decal Entity. Instant blood drop.
Yeah that looks right.
The HITS thing is to manage health attributes within the script. Basicallly hits is the mosters health.
Thanks for putting that onine hike1. I hope to be back soon with a couple of ports. A new version of Cell Division will be one of them.
- fps
- Posts: 504
- Joined: Mon Sep 26, 2005 9:54 pm
- Location: in a magical land devoid of hope, happiness, and sanity.
Can i disable the 5 hits = kill thing?
is there a way to fire multipul "harmless" projectiles from a pawn when it dies?
Is there a way to fire multipul projectiles from a player weapon and spread them out randomly? (shot gun)
Is there a way to make a bullet explosion fire multiple projectiles in random directions? (slag grenade)
How do you do bullet inaccuracy?
Will i ever run out of questions?
Thanks,
FPS
is there a way to fire multipul "harmless" projectiles from a pawn when it dies?
Is there a way to fire multipul projectiles from a player weapon and spread them out randomly? (shot gun)
Is there a way to make a bullet explosion fire multiple projectiles in random directions? (slag grenade)
How do you do bullet inaccuracy?
Will i ever run out of questions?
Thanks,
FPS