1 registered members (TipmyPip),
18,388
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
fps decrease when attatching model to player
#342320
09/26/10 15:03
09/26/10 15:03
|
Joined: Jan 2010
Posts: 145
Doc_Savage
OP
Member
|
OP
Member
Joined: Jan 2010
Posts: 145
|
as the title says, it signifigantly decreases when attatching a model, perhaps i should explain, im doing the "KH MOVEMENT" tutorial, and im up to the part with attatching weapons. it decreases fps with any model. this wont be a problem for my gaming rig im guessing, but nonetheless, is there any way to resolve this? i can supply code if its needed.
Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
|
|
|
Re: fps decrease when attatching model to player
[Re: Doc_Savage]
#342321
09/26/10 15:11
09/26/10 15:11
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
Did you set the attached model to passable?
If not, the models are permanently colliding and that costs computing time of the collision system.
Last edited by Pappenheimer; 09/26/10 15:13. Reason: explanation added
|
|
|
Re: fps decrease when attatching model to player
[Re: Pappenheimer]
#342322
09/26/10 15:12
09/26/10 15:12
|
Joined: Jan 2010
Posts: 145
Doc_Savage
OP
Member
|
OP
Member
Joined: Jan 2010
Posts: 145
|
ah, yes i did. and thank you for responding 
Last edited by Doc_Savage; 09/26/10 15:13.
Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
|
|
|
Re: fps decrease when attatching model to player
[Re: Pappenheimer]
#342326
09/26/10 15:24
09/26/10 15:24
|
Joined: Jan 2010
Posts: 145
Doc_Savage
OP
Member
|
OP
Member
Joined: Jan 2010
Posts: 145
|
ok lets say its created every frame again, how do i fix? it looks like that could be the problem
Last edited by Doc_Savage; 09/26/10 15:33.
Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
|
|
|
Re: fps decrease when attatching model to player
[Re: Pappenheimer]
#342330
09/26/10 15:38
09/26/10 15:38
|
Joined: Jan 2010
Posts: 145
Doc_Savage
OP
Member
|
OP
Member
Joined: Jan 2010
Posts: 145
|
var temp2[6];
ACTION attach_weapon {
my.passable = on;
proc_late();
WHILE (you != null) {
vec_for_vertex(temp.x,you,125); //hand palm base
vec_for_vertex(temp2.x,you,130); //hand palm tip
vec_set(my.x,temp.x);
vec_diff(temp.x,temp2.x,temp.x);
vec_to_angle(temp.pan,temp.x);
vec_set(my.pan,temp.pan);
wait(1);
}
}
action player_()
{
player = my; // I'm player
my.invisible = off; // player is invisible or not
my.narrow = on;
my.hp = 100; // sets health to 100 at the beggining
while(my.hp > 0) // while I'm alive
{
ent_create("sword.mdl",my.x,attach_weapon);
wait(1);
yea heres the relevant stuff
Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
|
|
|
Re: fps decrease when attatching model to player
[Re: Doc_Savage]
#342331
09/26/10 15:42
09/26/10 15:42
|
Joined: Feb 2009
Posts: 2,154
Damocles_
Expert
|
Expert
Joined: Feb 2009
Posts: 2,154
|
while(my.hp > 0) // while I'm alive { ent_create("sword.mdl",my.x,attach_weapon); wait(1);
well, you create a weapon every frame. Only create it once, and delete it when the player is dead just call the ent_create("sword.mdl",my.x,attach_weapon); before the while loop
|
|
|
Re: fps decrease when attatching model to player
[Re: Damocles_]
#342332
09/26/10 15:44
09/26/10 15:44
|
Joined: Jan 2010
Posts: 145
Doc_Savage
OP
Member
|
OP
Member
Joined: Jan 2010
Posts: 145
|
aaah ok. i was going along the lines of, you cant hold a weapon while youre dead HAHA well that works! i took your advice and its perfetly smooth now! thank you all for such a quick response! XD i love this place haha
Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|