Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

2 Simple Questions Goto page Previous 1, 2, 3 Next

| Inside3d Forums Forum Index -> QuakeC Programming

View previous topic :: View next topic
Author | Message
--- | ---
ceriux Joined: 06 Sep 2008 Posts: 969 Location: Florida, USA |

Posted: Sun Feb 07, 2010 11:53 pm Post subject: |

i believe thats what he said. _________________ QuakeDB - Quake ModDB Group

Back to top |

Ghost_Fang Joined: 12 Nov 2009 Posts: 162 |

Posted: Mon Feb 08, 2010 1:24 am Post subject: |

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?

Back to top |

ceriux Joined: 06 Sep 2008 Posts: 969 Location: Florida, USA |

Posted: Mon Feb 08, 2010 1:54 am Post subject: |

i wasnt being a smart ass. im not 100% sure myself so i said "i believe" _________________ QuakeDB - Quake ModDB Group

Back to top |

Ghost_Fang Joined: 12 Nov 2009 Posts: 162 |

Posted: Mon Feb 08, 2010 2:28 am Post subject: |

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?

Back to top |

ceriux Joined: 06 Sep 2008 Posts: 969 Location: Florida, USA |

Posted: Mon Feb 08, 2010 2:40 am Post subject: |

post up your function here so i can see. _________________ QuakeDB - Quake ModDB Group

Back to top |

Ghost_Fang Joined: 12 Nov 2009 Posts: 162 |

Posted: Mon Feb 08, 2010 2:47 am Post subject: |

Code:
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.

Back to top |

Dr. Shadowborg Inside3D Staff Joined: 16 Oct 2004 Posts: 726 |

Posted: Mon Feb 08, 2010 4:42 am Post subject: |

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) _________________
"Roboto suggests Plasma Bazooka."

Back to top |

ceriux Joined: 06 Sep 2008 Posts: 969 Location: Florida, USA |

Posted: Mon Feb 08, 2010 4:46 am Post subject: |

yeah lol, thats why in my sloppy ass post earlier, i mentioned making self.health 250 or w.e u wanted it. _________________ QuakeDB - Quake ModDB Group

Back to top |

Ghost_Fang Joined: 12 Nov 2009 Posts: 162 |

Posted: Mon Feb 08, 2010 6:57 am Post subject: |

Here is what it evolved into:

Code:
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?

Back to top |

ceriux Joined: 06 Sep 2008 Posts: 969 Location: Florida, USA |

Posted: Mon Feb 08, 2010 3:52 pm Post subject: |

maybe the players dead state is still DEAD_DEAD or DEAD_DYING something? _________________ QuakeDB - Quake ModDB Group

Back to top |

Dr. Shadowborg Inside3D Staff Joined: 16 Oct 2004 Posts: 726 |

Posted: Mon Feb 08, 2010 4:27 pm Post subject: |

Your problem is here:

Code:
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:
if (self.captimer == 4) { PlayerDie(); return; }
if (self.capenabled == 1)
{
if (self.health <= 0)
PlayerDie();
return;
}

This should fix your problem.
_________________
"Roboto suggests Plasma Bazooka."

Back to top |

Ghost_Fang Joined: 12 Nov 2009 Posts: 162 |

Posted: Mon Feb 08, 2010 11:41 pm Post subject: |

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:
/* =========== 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
}
};

Back to top |

Dr. Shadowborg Inside3D Staff Joined: 16 Oct 2004 Posts: 726 |

Posted: Tue Feb 09, 2010 12:07 am Post subject: |

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:
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:
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.
_________________
"Roboto suggests Plasma Bazooka."

Back to top |

Ghost_Fang Joined: 12 Nov 2009 Posts: 162 |

Posted: Tue Feb 09, 2010 2:01 am Post subject: |

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

Back to top |

ceriux Joined: 06 Sep 2008 Posts: 969 Location: Florida, USA |

Posted: Tue Feb 09, 2010 5:02 am Post subject: |

you should make a video to show us how cool this looks. it sounds cool. _________________ QuakeDB - Quake ModDB Group

Back to top |

Display posts from previous:

| Inside3d Forums Forum Index -> QuakeC Programming | All times are GMT Goto page Previous 1, 2, 3 Next
Page 2 of 3

Jump to:

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2004 phpBB Group