Forum

Problem with "seminvisible" wall

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Problem with "seminvisible" wall

Postby Nahuel » Wed Jun 08, 2011 12:24 am

I have tried to create a function in that a brush is invisible and when it is activated be visible and then be invisible again (in this case it disappears).
For this I have used the resource of "alpha".
The function works well being visible but the "self.wait" sometimes fails. The time so that the brush disappears changes too much, the self wait is never precise!
And I do not know why this happens!!!!!!!!!!!!
does an alternative occur to you for a similar function?


Code: Select all
void() removesemiwall =
{
self.model = string_null;
   self.solid = SOLID_NOT;
   self.movetype = MOVETYPE_NONE;
};
void() semiwall =
{
               self.alpha = self.count;

self.nextthink = time + self.wait ;
self.think = removesemiwall;
};
void() func_semiwall =
{   
if (!self.count)
self.count = 1;
if (!self.wait)
self.wait = 0.1;
self.angles = '0 0 0';
   self.movetype = MOVETYPE_PUSH;
   self.solid = SOLID_BSP;
   setmodel (self, self.model);
self.use = semiwall;
 self.alpha = -1;
};
:D :D Thanks in advance!!!!!!!!!!
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Postby metlslime » Wed Jun 08, 2011 2:26 am

i vaguely remember that self.think is unreliable on SOLID_BSP entities. If that's true it could your problem.
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Postby r00k » Wed Jun 08, 2011 5:01 am

instead of using .think use .blocked as the function.
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby Spike » Wed Jun 08, 2011 10:24 am

self.think is fully reliable on solid_bsp objects...
except on movetype_push objects, it works slightly differently, using self.ltime instead of time.

void() semiwall =
{
self.alpha = self.count;
self.nextthink = self.ltime + self.wait;
self.think = removesemiwall;
};

as a general rule of thumb, you should avoid using alpha < 1/255.0 as engines might consider that to be fully visible.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Nahuel » Wed Jun 08, 2011 1:36 pm

thank you Spike!
Now the function works very fine!!!!!
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest