[Fixed] DECALDEF bug...

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Nash
 
 
Posts: 17468
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

DECALDEF bug...

Post by Nash »

Hello, last night while I was creating some new decals, I encountered this problem.

(I would post the problem wad but I don't have a copy of it right now. I'm using a local computer at a cybercafe)

I'll try to post a makeshift DECALDEF.

Code: Select all


decal Flare // this is supposed to be a yellow thingy that fades away slowly
{
blabla
animator GoAway // i have the "flare" use the built-in GoAway animator.
LowerDecal BulletChip
}

decal BulletChip1
{
blabla
}

// ... (all the way to BulletChip5)

// (and then the decalgroup BulletChip which should randomize between the five bullet decals)

// THEN at the bottom, under generators, I set the hitscan weapons' decals to Flare.

Logically, this is what I think is supposed to happen...

When a bullet hits the wall, the flare decal (it's just a single decal, not grouped or whatever) would be drawn... and then it'll call the BulletChip group so that one of the five bullet chips will be drawn randomly under the flare. Right?

But what happens is this: it draws the flare, and it does call the bulletchip to be drawn under it, but it doesn't randomize the chip decals. The same bullet chip will ALWAYS appear no matter how many times you shoot. :(

I will try to somehow post the file here but in the meantime, can anyone sort of reproduce this and investigate the problem?
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm

Post by randi »

Two months later, and you haven't added anything. Does that mean you figured it out?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49188
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

I only read this now but I have to say I had the same feeling with the BFG decal. I always saw the same one but I really didn't think much about the fact that there are actually 2 of them. I just did a little debugging myself and I think I found the cause.
To set the lower decal this function is called:

Code: Select all

const FDecal *FDecalLib::GetDecalByName (const char *name) const
{
	if (name == NULL)
	{
		return NULL;
	}
	FDecalBase *base = ScanTreeForName (name, Root);
	if (base != NULL)
	{
		return base->GetDecal ();
	}
	return NULL;
}
The call to base->GetDecal() actually chooses one of the decals in the group so the group never gets set as lower decal.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm

Post by randi »

Fixed.

Return to “Closed Bugs [GZDoom]”