Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Actors can't use skin sprites. #2716

Open
1 task done
inkoalawetrust opened this issue Sep 17, 2024 · 1 comment
Open
1 task done

[BUG] Actors can't use skin sprites. #2716

inkoalawetrust opened this issue Sep 17, 2024 · 1 comment
Labels

Comments

@inkoalawetrust
Copy link
Contributor

GZDoom version

g4.12pre-480-g14a57b8de-m

Which game are you running with GZDoom?

Doom 2

What Operating System are you using?

None

Please describe your specific OS version

No response

Relevant hardware info

No response

Have you checked that no other similar issue already exists?

  • I have searched and not found similar issues.

A clear and concise description of what the bug is.

The sprites of player skins cannot be applied to actors.

For example, if you make a morph class that when morphed into, spawns an fake actor that takes the See: state sprites of the unmorphed player using State.GetSpriteTexture(). It will take the PLAY sprite and paste it to the fake actor.

But if you also make GetSpriteTexture() take that states' sprite while accounting for the players' skin. It will properly return the skin graphic name (i.e in the example skin I've attached, the sprite name is TRCH).
But trying to then apply that sprite name to the fake actors' curstate.sprite field with GetSpriteIndex() will NOT work, it just makes the fake actor invisible, nor will directly using the spritename in GetSpriteIndex like GetSpriteIndex("TRCH") work. Nor will changing the fake actor to just have TRCH A as its' default sprite work. And if you say, try to make a custom Imp that uses TRCH in his' Spawn: state, the sprite will be invalid and turn the Imp into an unknown actor placeholder.

Steps to reproduce the behaviour.

Explain how to reproduce

  1. Download the attached ZIP file below.
  2. Load both Skin Grab Bag.wad and SkinExample.zip
  3. Open up GZDoom.
  4. Type "morphme SkinSnatcherPlayer"
  5. One of two things will happen, if you kept your skin as the default. The morph should just spawn an actor with the DoomPlayers' See: sprite, and the snatched sprite in the console should be returned as "PLAY". If you changed your skin to "CMBTurret", the fake actor will have successfully snatched "TRCH" and say so in the console, and apply it to itself. But the sprite will be invisible.
    SkinBug.zip

Your configuration

No response

Provide a Log

No response

@inkoalawetrust inkoalawetrust changed the title [BUG] [BUG] Actors can't use skin sprites. Sep 17, 2024
@prof-hastig
Copy link
Contributor

If you look at the setup code you will see that skins are treated as a completely separate kind of resource entity, so it is not surprising they cannot be used as regular sprites.

Just imagine what would happen otherwise if your skin was named BOSS, for example...

inkoalawetrust added a commit to inkoalawetrust/KAI that referenced this issue Sep 19, 2024
Emplacements now use a VisualThinker for the fake operator visual effect, as I originally intended. Thanks to DileepVR helping me get the damn sprite rotation code working finally. Also helps bypass this engine bug (ZDoom/gzdoom#2716) on the placeholder actor version of the effect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants