Page 2 of 2
Posted: Sun Nov 20, 2005 7:56 pm
by fps
that last post was by me by the way.
Fps
Posted: Wed Nov 23, 2005 2:44 pm
by Guest
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.
Posted: Fri Nov 25, 2005 3:32 pm
by hike1
Posted: Wed Nov 30, 2005 9:05 pm
by fps
this is great, i think that the if(self.in_pain) thing is also in the low level script of my pawns and i will see if i can add it in.
It may take me a while to test this though.
Thanks,
FPS
Posted: Wed Nov 30, 2005 10:44 pm
by hike1
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;
}]
Posted: Thu Dec 01, 2005 4:32 pm
by fps
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
Posted: Tue Dec 06, 2005 2:18 am
by hike1
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
Posted: Wed Dec 07, 2005 8:58 am
by Guest
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.
Posted: Wed Dec 07, 2005 4:44 pm
by fps
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