[Fixed] Railgun - no decal

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Railgun - no decal

Postby Enjay » Sat Jan 19, 2019 5:30 am

3.7.1 Official and gzdoom-g3.8pre-232-g395d61391

I *think* this is a bug rather than merely a scripting error.

If I use a railgun and give its puff a decal, the decal does not appear when shooting a wall. However, if I use the same puff on a different style of hitscan weapon, the decal will appear.

e.g. with this puff:

Code: Select allExpand view
class NJTestPuff : BulletPuff
{
   Default
   {
      DamageType "Extreme";
      RenderStyle "None";
      Decal "BFGScorch";
   }
}


A railgun like this
Code: Select allExpand view
A_RailAttack(100,0,1,"68 B1 CC","FF FF FF",0,0,"NJTestPuff");

does not leave a decal but this gun

Code: Select allExpand view
A_FireBullets(4,1,14,4,"NJTestPuff",1,3200);


does.

Test file attached.

Use the console to give njtestgun1 (railgun-plasmagun) and fire at a wall. Should be no decal.

Use the console to give njtestgun2 (shotgun-plasmagun thing) and fire at a wall. BFG scorches everywhere.
Attachments
njtestguns.pk3
(640 Bytes) Downloaded 4 times
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Railgun - no decal

Postby Graf Zahl » Sat Jan 19, 2019 6:11 am

This bug's on your side. To work with the railgun attack the puff needs the FORCEDECAL flag, otherwise it will pick the attack source's decal, i.e. the attacking monster or weapon's.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Railgun - no decal

Postby Enjay » Sat Jan 19, 2019 6:18 am

Like this?

Code: Select allExpand view
class NJTestPuff : BulletPuff
{
   Default
   {
      +FORCEDECAL
      DamageType "Extreme";
      RenderStyle "None";
      Decal "BFGScorch";
   }
}


Still no decal from the railgun. I also tried adding +FORCEDECAL to the weapon and still no decal (although putting the decal on the weapon rather than the puff does allow the weapon to leave a decal).
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Railgun - no decal

Postby Graf Zahl » Sat Jan 19, 2019 6:58 am

Well...

The code wasn't quite right here, it was all copied over from P_LineAttack but missed one crucial difference: Unlike a normal hitscan, the rail attack only spawns the actual puff if the ALWAYSPUFF flag is set - and then took the decal info from the puff actor instead of the class defaults. So specifying a puff that wasn't spawned also ignored the decal attached to it - which was clearly unintended.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Railgun - no decal

Postby Enjay » Sat Jan 19, 2019 7:17 am

Thanks for the explanation. With the rail having that different puff handling, I can easily see how the decal situation was missed.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest