My "Play Music" behaviour doesn't work on Ad Hoc, but works in Creator and iOS Viewer

HymloeHymloe Member Posts: 1,653
I'm creating a Free version of my old game Rad Skater Apocalypse, and I'm having trouble with the Play Music behaviour.

When my player dies, it switches to a new track (using an attribute) and then does a Play Music.

I am also popping up a banner ad at this time (when the player dies).

Works fine in Creator, works fine in the iOS Viewer. But when I make an Ad Hoc build... when the player dies, the music stops. SFX keep playing, the ad works, but no music.

When I die again, the music often starts again.

Any idea what is going on there?

I've tried offsetting the banner ad by about two seconds, using a timer, in case it was "getting in the way". But that doesn't seem to help.

Very frustrating, as it really doesn't make sense.

Has this happened to anyone else?

Comments

  • HymloeHymloe Member Posts: 1,653
    I moved my Play Music behaviours into a Timer (After 0.2), with Run To Completion ticked, hoping that would force the behaviour to run. But it didn't help.

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    if something works in the creator/viewer and not on the device is it 99% of the time a result of bad code. the creator/viewer is very forgiving, the adhoc version is not.

    You said that if you die a second time the music starts again, that sounds like it could be something wrong in the code. Look at the code that switches the attribute, that's where I'd start.
  • HymloeHymloe Member Posts: 1,653
    Thanks, I'll look into it. I am eyeing it off suspiciously (even though it's the exact code that in my older shipped version of the game, that's been out for over a year).

    There must be something in the newer version of Game Salad that doesn't like the logic.

    I'm going like this...

    Group: Go to next music track
    If CurrentMusic =1
    PlayMusic "Music2"
    CurrentMusic =2

    OTHERWISE
    If CurrentMusic =2
    PlayMusic "Music3"
    CurrentMusic =3

    OTHERWISE
    If CurrentMusic =3
    PlayMusic "Music1"
    CurrentMusic =1



    And what seems to be happening, is that Music1 works, but the other two don't.

    What's weird is that, every time you die, it does increment the attribute CurrentMusic, so it's obviously passing through the rules properly. But the PlayMusic behaviours don't seem to trigger at the same time.


    Maybe I'll just try deleting and re-adding those PlayMusic behaviours. Maybe it's just being weird because it's an old project or something.



  • HymloeHymloe Member Posts: 1,653
    Been mucking around with this for about 3 - 4 hours and to be honest, it just seems like another intrepid Game Salad glitch.

    It's pretty frustrating spending hours late at night fixing something that really doesn't seem to be broken.

    So. Annoying.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    - putting in log statements before and after play music on each rule
    - try pulling the play music and put in something like spawn actor
    - try getting rid of the nested rules
  • HymloeHymloe Member Posts: 1,653
    I've separated it out into about 4 different ways of doing it.

    I've moved it from one actor to another.

    I've added two more attributes that work as switches, just to really simplify and level out the behaviours (I un-nested them).

    All work the same. Fine on the Creator and iOS Viewer, but on the AdHoc build, only Music track 1 works.

    I just... I'm at a loose end. Why? WHY is this how it is? OH well...
  • HymloeHymloe Member Posts: 1,653
    I'll try your other suggestions, as they are good ones.

    Constantly uploading and downloading the build to the Game Salad servers just stretches out this process x 100.
  • HymloeHymloe Member Posts: 1,653
    I don't know how I'm going to go to sleep now, with such a useless and frustrating bug just sitting there, unable to resolve it. Ridiculous.

    Absolutely ridiculous.
  • HymloeHymloe Member Posts: 1,653
    Seriously, this stuff is not rocket science.

    I'm trying to PLAY MUSIC.

    It works 100% in the Viewer, exactly as it has ALWAYS WORKED in the game I shipped a year ago.

    It just doesn't make sense that this wouldn't work in the Ad Hoc builds. But I've made about 15 builds tonight, and I'm getting nowhere.

  • HymloeHymloe Member Posts: 1,653
    Are all the Music tracks loaded into memory when a game starts?

    Are the track not playing because they're not loaded the same in an Ad Hoc build or something?

    I've re-saved the files out as M4As, and reimported them a few times.

    I've redone the behaviours for it.

    I'm using Game Salad Daily 00.52. Is that a problem?

    I've been doing AdHocs for my latest game, and all the music and everything is working fine in that.

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    try it in the real application, nightly projects are for testing, I wouldn't trust anything that I wanted to publish with it yet. plus, you are more than a few versions behind on the nightlys.
  • HymloeHymloe Member Posts: 1,653
    Good morning!

    Woke up, still thinking about it. Figured it must just be something glitchy in the system.

    Renamed source music files. Re-imported as new names. Deleted old ones.

    Made a new attribute to use.

    Rebuilt the logic from scratch throughout.

    Works.

    Must have ben something lingering around about a music ID getting lost, or something. I have no idea. The only solution seemed to be to just backtrack to the start, and build the system again.

    Thanks for your patience and help @jonmulcahy.

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    I can't tell you how many impossible issues I solved after a nights rest!
  • iKandyiKandy Imagineer of Crazy Shit New York CityMember Posts: 310

    I'm experiencing the same issue here. Tried deleting and re-installing etc.... no luck.

  • iKandyiKandy Imagineer of Crazy Shit New York CityMember Posts: 310

    Found the answer--- change your MP3 to WAV.

  • JodyMitomaJodyMitoma Member Posts: 307

    Or, convert your WAV's and MP3's to .M4A.

Sign In or Register to comment.