Duke4.net Forums: EVENT_SOUND - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

EVENT_SOUND  "need sprite ID"

User is online   Danukem 

  • Duke Plus Developer

#1

Is there any way to get the ID of the sprite that is playing the sound from within EVENT_SOUND (when applicable)?

RETURN is the sound #, sprite ID would seem like a natural fit for THISACTOR in the event. My apologies if this has already been implemented, I'm not in a position to check right now.

Without any context for the sound, the event is not nearly as useful as it could be.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #2

THISACTOR in EVENT_SOUND is the sprite from which the sound is being played. For sound, that's the sprite that called it. For globalsound, that's the player regardless of which actor called it. For screensound, it is arbitrarily also the player.

Note that EVENT_SOUND must not be used for any game logic.
3

User is online   Danukem 

  • Duke Plus Developer

#3

View PostHendricks266, on 25 July 2018 - 04:20 PM, said:

THISACTOR in EVENT_SOUND is the sprite from which the sound is being played. For sound, that's the sprite that called it. For globalsound, that's the player regardless of which actor called it. For screensound, it is arbitrarily also the player.

Note that EVENT_SOUND must not be used for any game logic.


Thanks, I should have noticed those facts earlier. I'm only using the event to stop sounds and/or play a different sound instead, so no worries about gameplay.
0

User is offline   Mark 

#4

Hey TD. I was going to try using this event to replace a sound only when in the menu, title screen,etc... not while in the game.
Example, during the title screen I want the explosion sound to play something different. How do I detect that the player is at some menu or loading and not in the game so the new sound plays?
0

User is offline   Hendricks266 

  • Weaponized Autism

  #5

Try "ifvarand player[].gm 1", meaning "if the menu is open".
0

User is offline   Mark 

#6

Thanks. Will that include the opening title screen too. To be specific I want to replace the 3 explosion sounds when the Duke Nukem and Atomic logos pop in so its technically before the menu starts.

This post has been edited by Mark.: 25 July 2018 - 06:12 PM

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options