Export/ZScriptify P_GiveSecret's cosmetic bits

Moderator: GZDoom Developers

Post Reply
User avatar
Kinsie
Posts: 7399
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Export/ZScriptify P_GiveSecret's cosmetic bits

Post by Kinsie »

The feedback given to the player upon discovering a secret (ie. printing $SECRETMESSAGE and playing misc/secret) is hardcoded into p_spec.cpp. While modders can customize this by changing the string and sound effect, I feel like exporting this to ZScript would provide additional options to customize this to better suit their mod's aesthetic and tone.

Some examples of possible uses:
  • Different secret-found sounds/messages for different player classes (Demonsteele and Samsara use a gross "if secrets found this tic > secrets found last tic..." ACS trick to try and do this, but it doesn't work especially well in multiplayer since it triggers for every player simultaneously)
  • Printing the message to a suitable part of the HUD (ex. for a Doom Alpha-style helmet HUD with its own message display)
  • More complex secret rewarding (ex. giving the player points for triggering a secret, telling other players that a specific player has found a secret)
I'm not sure what the best way to handle this would be - Event handler? Void function in PlayerPawn? - or if it's even viable to rewire things to allow for this, but I figure that its worth raising the idea.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Export/ZScriptify P_GiveSecret's cosmetic bits

Post by Marisa the Magician »

If only players can discover secrets, a virtual function in PlayerPawn sounds like an adequate way to add it in.

Edit: wait, it already is an actor and level function, it's just not virtual. OK, that makes it easier.

The way I'm seeing it, it could be easily rewritten into a virtual function of the Actor class, and the levellocals struct version can just go away as it's redundant. There is never a case where P_GiveSecret gets called without an activator actor, from what I'm seeing.
User avatar
Kinsie
Posts: 7399
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: Export/ZScriptify P_GiveSecret's cosmetic bits

Post by Kinsie »

This can be closed now.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”