Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Bauul

Disable player sprites in-game (GZDoom)?

Question

Posted (edited)

As anyone who has used Linedef Portals in GZDoom knows it's possible to view your own back briefly as you pass through them (this is because the sprites for the player are not absolutely perfectly synced to the player position).

 

It's a bit of a hacky fix, but one option to address this would be to "turn off" player sprites using a script just before a portal, and turn them back on on the other side (it'd look weird in third-person view, but who really cares about that?)

 

Anyone any ideas on how you could achieve this?

 

Whatever the solution I want to be able to return the player sprites to normal afterwards, so nothing like permanently changing the sprites or the player's Decorate file.  I tried changing the RenderStyle and Alpha values for the player, but that affects the on-screen weapon as well (which I don't want).  Is there a way to change the sprite a given frame calls in a Decorate file dynamically?  Any and all ideas welcome!

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 0

I worked out an approach that works (with a lot of help from DoomKrakken)!  For anyone who finds this thread, the method is:

 

1) Create a new default Player Class, I called mine "PortalPlayer".  It should be identical to the normal Doom player in every way, except in each State you need to surround each current line with the following (one above, one below):

TNT1 A 0 A_JumpIfInventory("PowerNoSprite", 1, 2)
"####" A -1

This basically means that whenever the player pawn enters a state it checks to see if the player is carrying a custom powerup called "PowerNoSprite".  If the player is, the state jumps passed the usual sprite to the "####" line that mimics the previous sprite.  Which in this case is TNT1, the invisible sprite.

 

2) Create a new Powerup that does absolutely nothing except sit in the player inventory for a long time:

ACTOR PowerNoSprite : Powerup
{
    Powerup.Duration -7200
}

3) Finally, give that Powerup to the player at the start of the map using GiveInventory.

 

Et voila: the presence of the PowerUp makes the player invisible but not the on-screen guns!

Share this post


Link to post
  • 0
Posted (edited)

You noted that you changed the RenderStyle and Alpha already, so this answer is probably a poor one, but a thought:

A script which executes just before entering the portal causing the activator (preferably players only so monsters aren't affected) to have an alpha of 0 for one or two tics using APROP_ALPHA 0.0 before restoring it to 1.0.

Also, as an addendum to the above answer, you could use APROP_RENDERSTYLE STYLE_NONE, then back to STYLE_NORMAL, of course, which would achieve the same effect, but look equally strange.

Like this:

script "Terrible Answer" (void)
{
 SetActorProperty (0, APROP_ALPHA, 0.0); //Render the activator's alpha as zero
 Delay (1); //One tic, about 28 milliseconds. Very short timeframe, but noticeable to the human eye.
 SetActorProperty (0, APROP_ALPHA, 1.0); //Restore the activator's alpha to its proper state
}

script "Terrible Answer 2 Electric Boogaloo" (void)
{
 SetActorProperty (0, APROP_RENDERSTYLE, STYLE_NONE); //Do not render the activator
 Delay (1);
 SetActorProperty (0, APROP_RENDERSTYLE, STYLE_NORMAL); //Render the activator again
}

As for DECORATE, beyond editing the states of the PlayerPawn derivative actors directly, I don't believe there's a way to "switch out" an actor's sprites in a specific frame, A_SetRenderStyle excepted.

Of course, using A_SetRenderStyle would require altering the given PlayerPawn actor directly, which you don't want to do. And would probably make it look ridiculous from the outside.

Looking through the ZDoom Wiki brings up the (slim) possibility of using A_PlayerSkinCheck, but that function is used to determine proper death states for a skin from Heretic (if in Doom) or Doom (if in Heretic), and I don't think it could be used in real-time, since skins alter a player's appearance anyway and so you would likely suffer the same problem.

 

Beyond that, I can't find anything that might solve this.

The problem is small enough, I wouldn't try to fix it myself if the solutions looked more problematic than the problem (which, to me, they do), that I honestly feel I should suggest just leaving it.

 

Edit: I just discovered A_HideThing, though I think it might have the same issue as A_SetRenderStyle.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×