2 Simple Questions
Moderator: InsideQC Admins
33 posts
• Page 2 of 3 • 1, 2, 3
Ok, well my real question is set up a new playerdie, or a new th_die?
just forget it, i know. No reason to be a smartass. I'm just making sure completely, no sense doing a lot of work when i started it wrong now is it?
just forget it, i know. No reason to be a smartass. I'm just making sure completely, no sense doing a lot of work when i started it wrong now is it?
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Im sorry, i see what you meant now. I guess im just used to everyone being snotty towards me, i am sorry.
I am running into issues while im here. I made a new function. PlayerIncap(); and changed the th_die in client. But when i "die" it still kinda makes me die. I turn sideways, enemies ignore me, but i still can shoot (without a weapon).
Do i need to edit Killed(); in combat.qc?
I am running into issues while im here. I made a new function. PlayerIncap(); and changed the th_die in client. But when i "die" it still kinda makes me die. I turn sideways, enemies ignore me, but i still can shoot (without a weapon).
Do i need to edit Killed(); in combat.qc?
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
- Code: Select all
void() PlayerIncap =
{
self.view_ofs = '0 0 2';
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_NONE;
if (self.captimer > 2)
{
PlayerDie();
}
};
Its not done, i still gotta add it so you pull out the pistol and can only use pistol. And i gotta add the function for when a player helps you up. But first things first.
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
You're on the right track, you just need to give the player his incap health.
(because the people who coded the engine are evile and made the deathview change dependant upon self.health <= 0 when it should be dependant on .deadflag)
(because the people who coded the engine are evile and made the deathview change dependant upon self.health <= 0 when it should be dependant on .deadflag)
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
Here is what it evolved into:
My player gets incapped, he falls down, health is 250, BUT when he dies while being incapped he "kinda" dies, it does what its suppose to do, camera goes sideways, weapon disappears, but i can still shoot, and when i shoot an enemy, it does this horrendous sound of enemy alert sound looping on top of each other. Any suggestions?
- Code: Select all
void() PlayerIncap =
{
if (self.captimer == 4)
{
return;
PlayerDie();
}
if (self.capenabled == 1)
{
return;
if (self.health <= 0)
PlayerDie();
}
self.health = 250;
self.view_ofs = '0 0 -8';
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_NONE;
self.capenabled = 1;
self.captimer = self.captimer + 1;
};
My player gets incapped, he falls down, health is 250, BUT when he dies while being incapped he "kinda" dies, it does what its suppose to do, camera goes sideways, weapon disappears, but i can still shoot, and when i shoot an enemy, it does this horrendous sound of enemy alert sound looping on top of each other. Any suggestions?
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Your problem is here:
This is a problem because return; is causing you to bail out of the function BEFORE it gets around to calling PlayerDie();
Move the two return; to under the code that needs to be called in those if blocks so that it looks like this:
This should fix your problem.
- Code: Select all
if (self.captimer == 4)
{
return;
PlayerDie();
}
if (self.capenabled == 1)
{
return;
if (self.health <= 0)
PlayerDie();
}
This is a problem because return; is causing you to bail out of the function BEFORE it gets around to calling PlayerDie();
Move the two return; to under the code that needs to be called in those if blocks so that it looks like this:
- Code: Select all
if (self.captimer == 4)
{
PlayerDie();
return;
}
if (self.capenabled == 1)
{
if (self.health <= 0)
PlayerDie();
return;
}
This should fix your problem.
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
Wow.... i honestly should have known that lol. Thanks Dr. It worked.
Now this is what i got, along with 2 issues:
First (look that the last lines of my code, the nextthinks)
After 30 seconds i want the player to get back up but i dont know how to call upon PlayerGetUp(); cause it give me an error when i do it as shown. client.qc:532:type mismatch for = is the error i get, more specifically.
Second
I have the weapon switching done right, but the frames are all screwy. When i shoot, the frames skip a little, and when i reload it doesnt move to a second and does the last few frames super fast. Any ideas on what would be conflicting?
Now this is what i got, along with 2 issues:
First (look that the last lines of my code, the nextthinks)
After 30 seconds i want the player to get back up but i dont know how to call upon PlayerGetUp(); cause it give me an error when i do it as shown. client.qc:532:type mismatch for = is the error i get, more specifically.
Second
I have the weapon switching done right, but the frames are all screwy. When i shoot, the frames skip a little, and when i reload it doesnt move to a second and does the last few frames super fast. Any ideas on what would be conflicting?
- Code: Select all
/*
===========
PlayerGetUp
get up from Incap
===========
*/
void() PlayerGetUp =
{
self.health = self.hurthealth = 50;
self.view_ofs = '0 0 22';
self.takedamage = DAMAGE_AIM;
self.deadflag = DEAD_NO;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_WALK;
self.capenabled = 0;
};
/*
===============
Incapacitation
===============
*/
void() PlayerIncap =
{
if (self.captimer == 4)
{
PlayerDie();
return;
}
if (self.capenabled == 1)
{
PlayerDie();
return;
}
else
{
self.health = self.hurthealth = 250;
self.view_ofs = '0 0 -8';
self.weapon = IT_SHOTGUN; //switch to pistol when you fall down
W_SetCurrentAmmo ();
self.takedamage = DAMAGE_AIM;
self.deadflag = DEAD_NO;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_NONE;
self.capenabled = 1;
self.captimer = self.captimer + 1;
self.nextthink = time + 30;
nextthink = PlayerGetUp(); //for test purposes only
}
};
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Ghost_Fang wrote:Wow.... i honestly should have known that lol. Thanks Dr. It worked.
Now this is what i got, along with 2 issues:
First (look that the last lines of my code, the nextthinks)
After 30 seconds i want the player to get back up but i dont know how to call upon PlayerGetUp(); cause it give me an error when i do it as shown. client.qc:532:type mismatch for = is the error i get, more specifically.
Second
I have the weapon switching done right, but the frames are all screwy. When i shoot, the frames skip a little, and when i reload it doesnt move to a second and does the last few frames super fast. Any ideas on what would be conflicting?
- Code: Select all
self.nextthink = time + 30;
nextthink = PlayerGetUp(); //for test purposes only
Problem 1:
Don't do this. You're basically putting the player into some sort of wierd carbonite freezing in regards to his think functions. This is VERY bad. (Unless your doing things like freeze guns, or whatnot, where it doesn't matter if the player can't do things like shoot, etc.)
Problem 2:
You're not assigning the nextthink properly. nextthink should ONLY be set like the following:
- Code: Select all
self.nextthink = PlayerGetUp;
To get your stuff working right you should do something like this:
1. Create a .float getuptime or some such.
2. set it to self.getuptime = time + 30; in your PlayerIncap() function.
3. Add an if block that checks to see if self.capenabled is true, and checks to see if self.getuptime <= time, and if so, call PlayerGetUp(); Put this in CheckPowerups();
That should get things working.
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
Works perfect! thanks again.
Another issue (sorry lol)
If i have any velocity at all such as walking or push from a rocket when i get incapped my character is down and everything but he bobs up and down like he does when you walk. How can i make it so stops doing that?
EDIT: i got it, a simple self.veloctity_x,y,z = 0; did it. Lol
Another issue (sorry lol)
If i have any velocity at all such as walking or push from a rocket when i get incapped my character is down and everything but he bobs up and down like he does when you walk. How can i make it so stops doing that?
EDIT: i got it, a simple self.veloctity_x,y,z = 0; did it. Lol
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
33 posts
• Page 2 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 1 guest
