Continue playing music throughout game...

butterbeanbutterbean Member Posts: 4,315
edited November -1 in Working with GS (Mac)
I have an actor within a scene in level 1 where it says play music...

Is there a way to get this track to continuously play even after the player dies, and restarts that level?

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Or instead of destroying actors just try this.
    Make a game attribute: musicLevel (Integer type) Since game attributes are not reset with a reset scene, this data will be preserved.

    Have a Rule:
    When Attribute: game.musicLevel ≠ 1
    ---Play Music (The music you want)
    ---Change Attribute: game.musicLevel = 1

    This way when you start a level it starts the music you want, and if the scene is reset it won't restart the music. And if you have different music for different levels, just change the 1's in the rule to the appropriate level and have that actor in that level.
  • butterbeanbutterbean Member Posts: 4,315
    I put that rule into each scene, and created the game attribute (integer) set at zero, the music plays and is looped, but once the player is hit, and the level reset, the music doesn't play, does this rule need to go into the reset scene data?
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Sorry. Thought that would work. I'll see if that would be a bug or if its meant to do that. I guess for now you can only have the Play Music restart it as you had before.
  • butterbeanbutterbean Member Posts: 4,315
    It's okay, under reset scene, I also put change attribute game.musiclevel to zero, so that way when the player loses, the music will at least restart whereas with the other rule, it didn't restart upon the player losing a life
Sign In or Register to comment.