Changing the skin of a weapon?
Moderator: InsideQC Admins
6 posts
• Page 1 of 1
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
*
========================
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
-

Mexicouger - Posts: 514
- Joined: Sat May 01, 2010 10:12 pm
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)
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)
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
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...
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...
-

Mexicouger - Posts: 514
- Joined: Sat May 01, 2010 10:12 pm
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...
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest

