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

Changing the skin of a weapon?

| Inside3d Forums Forum Index -> QuakeC Programming

View previous topic :: View next topic
Author | Message
--- | ---
Mexicouger Joined: 01 May 2010 Posts: 129 |

Posted: Sun Jun 13, 2010 11:43 pm Post subject: Changing the skin of a weapon? |

Well, Instead of Having a weapon have some crazy animation when Changing, I thought a nice texture change would be nice. So here is My code * ======================== Blaster sniper add-on ========================
*/
void() W_FireSniper =
{
local entity missile, mpuff;
self.currentammo = self.ammo_sniper = self.ammo_sniper -= 1;
sound (self, CHAN_WEAPON, "weapons/sniper.wav", 1, ATTN_NORM);
self.skin = 1;
self.punchangle_x = -3;
missile = spawn ();
missile.owner = self;
missile.movetype = MOVETYPE_FLYMISSILE;
missile.solid = SOLID_BBOX;
missile.classname = "Sniper";
// set missile speed
makevectors (self.v_angle);
missile.velocity = aim(self, 1000);
missile.velocity = missile.velocity * 10000;
missile.angles = vectoangles(missile.velocity);
missile.touch = BulletTouch;
// set missile duration
missile.nextthink = time + 5;
missile.think = SUB_Remove;
missile.frame += 1;
setmodel (missile, "progs/sniper.mdl");
setsize (missile, '0 0 0', '0 0 0');
setorigin (missile, self.origin + v_forward*8 + '0 0 16');
};
It is for My mod Prime, And I know I set up the texture to change when Shot(I will change it to change when you change weapons).
But basically, I want it to Change from skin 0, To skin 1.
So I tried
self.skin = 1;
Yes, I know I mixed up entities, And It did change my player color. But What is an entity for the weapon itself? It wouldn't be missile or mpuff would it?
Thanks alot,
Mexicouger

Back to top |

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

Posted: Sun Jun 13, 2010 11:56 pm Post subject: |

No, missile refers to the actual projectile, mpuff is an unused entity handle. There is no way to change a weapon skin within the framework of normal quake, outside of switching the weapon model for a duplicate of the model your using with the alternate skin as the primary. (the other method requires using darkplaces or another engine with the required extensions to spawn the weapon model as a separate entity)
This does of course, suck. (/me want .weaponskin so badly)
_________________
"Roboto suggests Plasma Bazooka."

Back to top |

Mexicouger Joined: 01 May 2010 Posts: 129 |

Posted: Mon Jun 14, 2010 12:50 am Post subject: |

Dang... I feared this.... Well, Even if there does become A solution, I am using psp Kurok engine. And changing models Screws up alot. Isn't Changing models rather than Changing skin Bad? I mean, It has to precache Another model and Load it, When It could just load another skin..
Sigh...

Back to top |

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

Posted: Mon Jun 14, 2010 1:32 am Post subject: |

Mexicouger wrote:
Isn't Changing models rather than Changing skin Bad? I mean, It has to precache Another model and Load it, When It could just load another skin..

If it's a weapon model, then it should already be precached by the QuakeC code when you start a game. (or rather, you should be precaching it in your code.)
As for changing the model, it shouldn't be all that bad...I do it in Hellsmash for the blaster...
_________________
"Roboto suggests Plasma Bazooka."

Back to top |

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

Posted: Mon Jun 14, 2010 1:55 am Post subject: |

yeah... .weaponskin is needed =( _________________ QuakeDB - Quake ModDB Group

Back to top |

gnounc Joined: 06 Apr 2009 Posts: 120 |

Posted: Mon Jun 14, 2010 7:38 am Post subject: |

I agree...I currently just keep a different .mdl handy : (

Back to top |

Display posts from previous:

| Inside3d Forums Forum Index -> QuakeC Programming | All times are GMT
Page 1 of 1

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