Page 1 of 1
Bubbles
Posted: Tue Sep 01, 2009 12:39 pm
by Rawing
Got a problem. My bubbles can't be prevented from moving through walls :/ Anyone can tell me what I've to do to make 'em solid? There are no contents or such for localents, bounceFactor= 0 didn't do anything, the bloodtrail isn't even moving so I can't copy that
Second thing is: can I make them disappear if they move out of the water?
Re: Bubbles
Posted: Tue Sep 08, 2009 7:47 pm
by Silicone_Milk
Like machinegun/shotgun bubbles and such?
Are you using a single brush for the water?
Re: Bubbles
Posted: Wed Sep 09, 2009 2:45 pm
by Rawing
yup, those bubbles =)
and well, I don't think it'll be possible to use a single water brush in maps that are more like... complex (=
Re: Bubbles
Posted: Wed Sep 09, 2009 5:12 pm
by Silicone_Milk
I was actually going to suggest using multiple brushes if you were just using one.
The bubbles are actually hopping across several brushes?
Re: Bubbles
Posted: Thu Sep 10, 2009 12:31 pm
by Rawing
Well, they got a random movement like 5*crandom() and an upwards movement like 30+5*crandom(), so yes, they could move from one brush into another.
Re: Bubbles
Posted: Sat Sep 12, 2009 11:32 pm
by Silicone_Milk
I don't remember the code at all. Do they spawn as a centity or something? I thought they were constrained to the dimensions of the liquid brush they spawned in.
Re: Bubbles
Posted: Sun Sep 13, 2009 3:00 am
by Rawing
Nah, they aren't centities, they're local ents...
Code: Select all
localEntity_t *le;
refEntity_t *re;
le = CG_AllocLocalEntity();
le->leFlags = LEF_PUFF_DONT_SCALE;
le->leType = LE_MOVE_SCALE_FADE;
le->startTime = cg.time;
le->endTime = cg.time + 100000;
le->lifeRate = 1.0 / ( le->endTime - le->startTime );
re = &le->refEntity;
re->shaderTime = cg.time / 1000.0f;
re->reType = RT_SPRITE;
re->rotation = 0;
re->radius = 4-(int)(3*crandom());
re->customShader = cgs.media.waterBubbleShader;
re->shaderRGBA[0] = 0xff;
re->shaderRGBA[1] = 0xff;
re->shaderRGBA[2] = 0xff;
re->shaderRGBA[3] = 0xff;
le->color[3] = 1.0;
le->pos.trType = TR_LINEAR;
le->pos.trTime = cg.time;
VectorCopy( move, le->pos.trBase );
le->pos.trDelta[0] = crandom()*5;
le->pos.trDelta[1] = crandom()*5;
le->pos.trDelta[2] = crandom()*5 + 30;
VectorAdd (move, vec, move);
and there's nothing like contentmask/ contents for localents :/
EDIT: just realized that bouncefactor and bouncesound are used with LE_FRAGMENTs only... I'll check it out.
Re: Bubbles
Posted: Tue Sep 15, 2009 1:15 am
by Silicone_Milk
Ah I see. Any progress so far?
Re: Bubbles
Posted: Wed Sep 16, 2009 11:02 am
by Rawing
Nope, been busy with school (: I'll look into it today or tomorrow.
Re: Bubbles
Posted: Thu Sep 17, 2009 2:17 pm
by Rawing
Here we go.
changing the leType to LE_FRAGMENT resulted in invisible/no bubbles
It seems to need a model like the body parts when you're gibbed :/ (?)
If nothing else works, I'll try making a CG_AddBubble func, but I'm hoping I won't have to
