Author Topic: Error at Sound Replay and Init  (Read 4478 times)

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Error at Sound Replay and Init
« on: 2008-02-09, 01:02:51 PM »
When "replay sound" is activated, my game terminates itself. How do I fix this? Oh,and also when I well, import the sample game's SHFL sprite an error comes up that says something like:  "error: init has no definition"

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: Error at Sound Replay and Init
« Reply #1 on: 2008-02-09, 01:43:41 PM »
for that sound problem:
some options, like replay sound, should be handled carefully. if you put this rule somewhere, it will start your sound EVERY frame...
you need to make some rule construct, which activates the "replay sound" only once. maybe you can set a map flag. for example you could write something like this:
if map flag 1 is false (false is default)
  - play sound
  - set flag 1 true


second question:
i think this comes because the samples could be better described. for every template you import, you will have to look what things the template additionally needs in your project. some templates bring in a "ladder" tile category and work with it, but usually you will not have this category when you start your project. the solution would be to simply create a ladder category.
in this case (without looking, forgive me please), it could be some sprite parameter you need to set in the map editor.
some times you will have to look into the sprites codes. there could be rules which deal with counters that not exist in your project.
usually, the error messages at compiling will give you a very good hint. weren't there more text before your posted error message?

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: Error at Sound Replay and Init
« Reply #2 on: 2008-02-10, 06:37:51 PM »
Yeah, but I got it to work now. Thanks for the valuable information.
                   
Quote
(without looking, forgive me please),
                     


                I forgive you man.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Error at Sound Replay and Init
« Reply #3 on: 2008-02-10, 08:01:27 PM »
You should usually use the "continue" option to play a sound unless you really need the sound to re-start if it's already playing.  Continue makes sure that only one copy of the sound is playing, and starts it playing if it's not.