Forum

Problem with thunderwalker cloak rune and vweps

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Problem with thunderwalker cloak rune and vweps

Postby Batman!]ZFA[ » Tue Jul 14, 2009 7:42 am

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

Image

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
incombat.cis:
Code: Select all
// 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: Select all
// 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: Select all
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: Select all
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
Batman!]ZFA[
 
Posts: 32
Joined: Thu Nov 20, 2008 12:51 am
Location: Pennsylvania

Postby r00k » Tue Jul 14, 2009 8:50 am

Okay I found the bug in the client-side vwep code

in ezQuake: in cl_ents.c, CL_LinkPlayers....

Code: Select all
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 :(
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby FrikaC » Wed Jul 15, 2009 1:48 pm

.jimmy .bippy .gene and .floyd? These variable names are sillier than mine.
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby Batman!]ZFA[ » Sun Jul 19, 2009 6:19 pm

Batman!]ZFA[
 
Posts: 32
Joined: Thu Nov 20, 2008 12:51 am
Location: Pennsylvania

Postby Batman!]ZFA[ » Thu Jul 23, 2009 5:05 am

To really fix this we need to be able to control it from the server though.

I added a couple calls to VWEPS_SetModel();

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.


Image

This is what I get from that try.
Batman!]ZFA[
 
Posts: 32
Joined: Thu Nov 20, 2008 12:51 am
Location: Pennsylvania

Postby Tonik » Thu Jul 23, 2009 9:16 am

The client patch is redundant. The client doesn't have to worry about eyes or not, the logic there is most straightforward:

Code: Select all
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: Select all
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)
Tonik
 
Posts: 3
Joined: Thu Oct 19, 2006 4:57 pm
Location: Moscow, Russia

Postby r00k » Sun Jul 26, 2009 4:15 am

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. :P
Last edited by r00k on Sun Jul 26, 2009 4:25 am, edited 1 time in total.
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby Batman!]ZFA[ » Sun Jul 26, 2009 4:16 am

Doc wrote: I added the self.modelindex check to PlayerPostThink() maybe this one will
work.


Image

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
Batman!]ZFA[
 
Posts: 32
Joined: Thu Nov 20, 2008 12:51 am
Location: Pennsylvania

Postby r00k » Sun Jul 26, 2009 4:27 am

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.
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby Batman!]ZFA[ » Sun Jul 26, 2009 8:14 am

Rook: your client update worked

This is server side, we are trying to change in the qwprogs.dat
Batman!]ZFA[
 
Posts: 32
Joined: Thu Nov 20, 2008 12:51 am
Location: Pennsylvania

Postby Batman!]ZFA[ » Sun Aug 02, 2009 8:10 am

now we have it fixed server side as well:

Doc wrote: I moved

Code: Select all
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;
}


And here is where I think the problem was

In CheckPowerups();
I replaced this bit of code

Code: Select all
// use the eyes
self.frame = 0;
self.modelindex = modelindex_eyes;
VWEPS_SetModel(); // Viewable Player Weapons
}
else
{
self.modelindex = modelindex_player; // don't use eyes
}


NEW CODE

Code: Select all
// 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!!
Batman!]ZFA[
 
Posts: 32
Joined: Thu Nov 20, 2008 12:51 am
Location: Pennsylvania


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest