View previous topic :: View next topic |
Author |
Message |
ceriux

Joined: 06 Sep 2008 Posts: 969 Location: Florida, USA
|
Posted: Sun Oct 18, 2009 2:54 am Post subject: Issue with Class and NEW weapon type... |
|
|
anyways guys i think iv been trying to fix this on my own for well over an hour... iv asked on irc and it seems like i might have been ignored (although the people who would have helped might have been idle...) So im posting this here.
basically iv added in a new sniper weapon... the weapon works fine accept for when its applied to my class. all other vanilla quake weapons work fine even after being edited. iv made a video explaining everything and a pastebin post. so as you can tell i really need help fixing this i cannot figure it out... iv put a good amount of effort in just getting up enough data to really show the problems im having so hopefully you can see that im really having an issue and not just asking people to do things for me. anyways ....
here's the links
Pastebin ( functions in which i think the problems are ) : http://pastebin.com/m72170ec8
youtube video with commentary on whats happening : http://www.youtube.com/watch?v=uCGQEIbY_7g _________________ QuakeDB - Quake ModDB Group |
|
Back to top |
|
 |
Downsider

Joined: 16 Sep 2008 Posts: 478
|
Posted: Sun Oct 18, 2009 3:14 am Post subject: |
|
|
Try setting parm8 to IT_SNIPER or IT_AXE, if I'm not mistaken that's probably what's causing it. If not, then I need to see more, but somebody else might not have to  |
|
Back to top |
|
 |
ceriux

Joined: 06 Sep 2008 Posts: 969 Location: Florida, USA
|
Posted: Sun Oct 18, 2009 3:43 am Post subject: |
|
|
ahh thanks that fixed my weapon spawning issue =)
but now i made my own weapon cycle code and once again it works for ALL weapons but the sniper , actually the sniper crashes the game/server.
here's my cycle wep code :
Code: | /*
============
CycleWeaponCommand
Go to the next weapon with ammo
============
*/
void() CycleWeaponCommand =
{
local float it, am;
it = self.items;
self.impulse = 0;
while (1)
{
am = 0;
if (self.pclass == 1 && self.weapon == IT_AXE)
{
self.weapon == IT_NAILGUN;
am = 1;
}
else if (self.pclass == 1 && self.weapon == IT_NAILGUN)
{
self.weapon == IT_AXE;
}
if (self.pclass == 2 && self.weapon == IT_AXE)
{
self.weapon == IT_SNIPER;
am = 1;
}
else if (self.pclass == 2 && self.weapon == IT_SNIPER)
{
self.weapon == IT_AXE;
}
if (self.pclass == 3 && self.weapon == IT_AXE)
{
self.weapon == IT_SHOTGUN;
am = 1;
}
else if (self.pclass == 3 && self.weapon == IT_SHOTGUN)
{
self.weapon == IT_AXE;
}
if (self.pclass == 4 && self.weapon == IT_AXE)
{
self.weapon == IT_ROCKET_LAUNCHER;
am = 1;
}
else if (self.pclass == 4 && self.weapon == IT_ROCKET_LAUNCHER)
{
self.weapon == IT_AXE;
}
if ( (it & self.weapon) && am == 0)
{
W_SetCurrentAmmo ();
return;
}
}
};
/*
============
CycleWeaponReverseCommand
Go to the prev weapon with ammo
============
*/
void() CycleWeaponReverseCommand =
{
local float it, am;
it = self.items;
self.impulse = 0;
while (1)
{
am = 0;
if (self.pclass == 1 && self.weapon == IT_AXE)
{
self.weapon == IT_NAILGUN;
am = 1;
}
else if (self.pclass == 1 && self.weapon == IT_NAILGUN)
{
self.weapon == IT_AXE;
}
if (self.pclass == 2 && self.weapon == IT_AXE)
{
self.weapon == IT_SNIPER;
am = 1;
}
else if (self.pclass == 2 && self.weapon == IT_SNIPER)
{
self.weapon == IT_AXE;
}
if (self.pclass == 3 && self.weapon == IT_AXE)
{
self.weapon == IT_SHOTGUN;
am = 1;
}
else if (self.pclass == 3 && self.weapon == IT_SHOTGUN)
{
self.weapon == IT_AXE;
}
if (self.pclass == 4 && self.weapon == IT_AXE)
{
self.weapon == IT_ROCKET_LAUNCHER;
am = 1;
}
else if (self.pclass == 4 && self.weapon == IT_ROCKET_LAUNCHER)
{
self.weapon == IT_AXE;
}
if ( (it & self.weapon) && am == 0)
{
W_SetCurrentAmmo ();
return;
}
}
};
|
EDIT: Im pretty sure parm 8 has to remain self.weapon. my weapon cycle code causes all classes to crash since i applied it to them. _________________ QuakeDB - Quake ModDB Group |
|
Back to top |
|
 |
Downsider

Joined: 16 Sep 2008 Posts: 478
|
Posted: Sun Oct 18, 2009 4:11 am Post subject: |
|
|
parm8 should remain self.weapon on level exit, only IT_AXE or IT_SNIPER when first created.. Though your new problem, I don't have time to look at it, but you're probably creating an infinite loop with the while (1). I dunno if Quake can escape an infinite loop in QC or not. |
|
Back to top |
|
 |
ceriux

Joined: 06 Sep 2008 Posts: 969 Location: Florida, USA
|
Posted: Sun Oct 18, 2009 4:46 am Post subject: |
|
|
its ok i got the scroll fixed and the spawn fixed minus still with the sniper class.... for some reason the sniper still spawns with the shotgun i have an idea on what it might be so im going to check it out before i post anything else. thanks again Downsider!
No... not fixed... Downsider if i sent you my source. could you take a look at it? everythings been working perfectly till i decide to do the easiest thing around "add a new weapon" -.- _________________ QuakeDB - Quake ModDB Group |
|
Back to top |
|
 |
Downsider

Joined: 16 Sep 2008 Posts: 478
|
Posted: Sun Oct 18, 2009 12:04 pm Post subject: |
|
|
Of course. You helped me with getting my model into Quake, so I can surely help you  |
|
Back to top |
|
 |
|