View previous topic :: View next topic |
Author |
Message |
Batman!]ZFA[
Joined: 20 Nov 2008 Posts: 32 Location: Pennsylvania
|
Posted: Tue Jul 14, 2009 7:42 am Post subject: Problem with thunderwalker cloak rune and vweps |
|
|
With the addition of vweps to Thunderwalker 6 it has broken on of the 6 runes we use in the game.
Cloak rune is like the ring of shadows except when the owner shots or is shot they are seen.
vweps and ring of shadows work fine together, but with cloak rune the owner should become hidden (with eyes.mdl) instead you see this below
which seems to be using the default quakeworld skin instead of the eyes.mdl
the current vweps.c for tw 6 is here
currently the cloak rune code in combat.c is:
Code: | // ThunderWalker: De-cloak if hurt
if (targ.twrune & Cloaking_Rune)
{
if (targ.floyd == 1)
{
sound (targ, CHAN_ITEM, "tw/twcloak2.wav", 1, ATTN_NORM);
targ.floyd = 2;
}
setmodel (targ, "progs/player.mdl");
targ.bippy = time + 4.5;
targ.gene = time + 6.5;
targ.jimmy = 2;
}
// react to the damage
oldself = self;
self = targ;
if (self.th_pain)
{
self.th_pain (attacker, take);
}
self = oldself; |
And the cloak rune code from weapons.c here:
Code: | // ThunderWalker: Handles whether you should be visible or not with cloaking rune
if (self.twrune & Cloaking_Rune)
{
if (time > self.bippy)
{
if (time < self.gene)
{
stuffcmd (self, "bf\n");
}
if (self.jimmy == 2)
{
sound (self, CHAN_ITEM, "tw/twcloak.wav", 1, ATTN_NORM);
self.jimmy = 1;
}
setmodel (self, "progs/eyes.mdl");
self.floyd = 1;
} |
Doc one of our coders tried adding two different codes to fix this but both were not able to correct the problem.
First try: This one removed the weapon models but you still saw the player with the base skin
Code: | if (self.model == "progs/eyes.mdl");
{
self.vw_index = 0;
return;
} |
2nd one broke the viewable weapons so they did not work at all
Code: |
if (self.floyd == 1)
{
self.vw_index = 0;
return;
} |
Anyone have idea where we went wrong with what we added to vweps.c?
All the latest TW 6 code is available here |
|
Back to top |
|
 |
r00k
Joined: 13 Nov 2004 Posts: 483
|
Posted: Tue Jul 14, 2009 8:50 am Post subject: |
|
|
Okay I found the bug in the client-side vwep code
in ezQuake: in cl_ents.c, CL_LinkPlayers....
Code: |
if ((cl.vwep_enabled && r_drawvweps.value && state->vw_index)&& (state->modelindex != cl_modelindices[mi_eyes]))
{
qbool vwep;
vwep = CL_AddVWepModel (&ent, state->vw_index, cent->old_vw_frame);
|
it wasnt checking against the eyes model  |
|
Back to top |
|
 |
FrikaC Site Admin

Joined: 08 Oct 2004 Posts: 947
|
Posted: Wed Jul 15, 2009 1:48 pm Post subject: |
|
|
.jimmy .bippy .gene and .floyd? These variable names are sillier than mine. |
|
Back to top |
|
 |
Batman!]ZFA[
Joined: 20 Nov 2008 Posts: 32 Location: Pennsylvania
|
|
Back to top |
|
 |
Batman!]ZFA[
Joined: 20 Nov 2008 Posts: 32 Location: Pennsylvania
|
Posted: Thu Jul 23, 2009 5:05 am Post subject: |
|
|
To really fix this we need to be able to control it from the server though.
I added a couple calls to VWEPS_SetModel();
Quote: | Doc wrote: one when your model is set to eyes.mdl and also when your model is changed
back to player.mdl
I doubt this will fix it but thought it was worth a try. |
This is what I get from that try. |
|
Back to top |
|
 |
Tonik
Joined: 19 Oct 2006 Posts: 3 Location: Moscow, Russia
|
Posted: Thu Jul 23, 2009 9:16 am Post subject: |
|
|
The client patch is redundant. The client doesn't have to worry about eyes or not, the logic there is most straightforward:
Code: | if (self.vw_index == 0) then
draw whatever model self.modelindex is set to
else
draw vwplayer.mdl and the vwep |
Don't tell it to draw the vwep, and it won't! If the original Doc's patch is not working, that's because something in your code is setting self.vw_index again later!
If you don't wanna bother figuring out what exactly is happening and just want a quick fix, you can just put the lines
Code: | if (self.modelindex == modelindex_eyes)
self.vw_index = 0; |
at the very end of PlayerPostThink()
(no, you can't check self.model because it doesn't change when you go into eyes mode; only self.modelindex does) |
|
Back to top |
|
 |
r00k
Joined: 13 Nov 2004 Posts: 483
|
Posted: Sun Jul 26, 2009 4:15 am Post subject: |
|
|
this is correct, the 'eyes mode'l for me was the bandaide not the reason. I was sure that someone would correct this it was late nigth and Batman called me, and i just pooped and if != statement so we could play. so it was a fix to be fixed. 
Last edited by r00k on Sun Jul 26, 2009 4:25 am; edited 1 time in total |
|
Back to top |
|
 |
Batman!]ZFA[
Joined: 20 Nov 2008 Posts: 32 Location: Pennsylvania
|
Posted: Sun Jul 26, 2009 4:16 am Post subject: |
|
|
Quote: | Doc wrote: I added the self.modelindex check to PlayerPostThink() maybe this one will
work.
|
Quote: | Doc wrote: It looks like it's half working since it's removing the weapon model with the cloak rune.
I wonder if now there is something messed up with the player.mdl
or if maybe it has something to do with the 24 bit team and enemy skins |
|
|
Back to top |
|
 |
r00k
Joined: 13 Nov 2004 Posts: 483
|
Posted: Sun Jul 26, 2009 4:27 am Post subject: |
|
|
When I tested it with Zquake .17 it worked for me and in ezQuake that I modified with said code. I've slept since then so I could be wrong. |
|
Back to top |
|
 |
Batman!]ZFA[
Joined: 20 Nov 2008 Posts: 32 Location: Pennsylvania
|
Posted: Sun Jul 26, 2009 8:14 am Post subject: |
|
|
Rook: your client update worked
This is server side, we are trying to change in the qwprogs.dat |
|
Back to top |
|
 |
Batman!]ZFA[
Joined: 20 Nov 2008 Posts: 32 Location: Pennsylvania
|
Posted: Sun Aug 02, 2009 8:10 am Post subject: |
|
|
now we have it fixed server side as well:
Quote: | Doc wrote: I moved |
Code: | if (!stof(infokey(world, "vwep")))
return;
from Precache_VWEP(); to VWEPS_SetModel();
I added this to VWEPS_SetModel();
if (self.model == "progs/eyes.mdl" && self.invisible_time != 0)
{
vw_model = 0;
} |
Quote: | And here is where I think the problem was
In CheckPowerups();
I replaced this bit of code |
Code: | // use the eyes
self.frame = 0;
self.modelindex = modelindex_eyes;
VWEPS_SetModel(); // Viewable Player Weapons
}
else
{
self.modelindex = modelindex_player; // don't use eyes
} |
Code: | // use the eyes
self.frame = 0;
self.modelindex = modelindex_eyes;
self.vw_index = 0; // Doc remove weapon models
}
else
{
self.modelindex = modelindex_player; // don't use eyes
VWEPS_SetModel(); // Doc set player weapon model
} |
thanks again everyone for all the help on this!! |
|
Back to top |
|
 |
|