TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    XML code that only plays an mp3 file

    Scheduled Pinned Locked Moved Map Making
    8 Posts 3 Posters 1.4k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • FrostionF Offline
      Frostion Admin
      last edited by

      I am trying to make is so, that a sound is played for all players if a special unit (belonging to whatever player) called “loot” appears on the map. If unit loot appears --> play sound.
      I have many times made notifications that had a sound being played alongside the windows popup, but now I would like to make a notification consisting only of a sound being played. Is this possible?

      I have tried experimenting with the following, but I don’t hear the sound/loot.mp3 being played:

      <!-- Start Loot drop sound -->
              <attachment name="conditionAttachment_Loot" attachTo="Nature" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                  <option name="directPresenceTerritories" value="map" count="1"/>
                  <option name="unitPresence" value="Loot" count="1"/>
                  <option name="players" value="$AllPlayers$"/>
              </attachment>
              <attachment name="triggerAttachment_Loot_is_dropped_on_the_map" attachTo="Nature" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                  <option name="conditions" value="conditionAttachment_Loot"/>
                  <option name="notification" value="loot"/>
                  <option name="players" value="$AllPlayers$"/>
              </attachment>
      <!-- End Loot drop sound -->
      

      In my sounds.properties:

      notification_loot=loot.mp3
      

      In my notification.properties

      loot_sounds=loot
      

      Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

      redrumR 1 Reply Last reply Reply Quote 0
      • redrumR Offline
        redrum Admin @Frostion
        last edited by

        @Frostion If you add a windows popup to it then does it play? And are you sure the trigger is activating?

        TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

        C 1 Reply Last reply Reply Quote 0
        • C Offline
          Cernel Moderators @redrum
          last edited by

          @redrum Right the first thing to know is if the trigger is firing (not really activating, that is another thing) at all. I'm not sure if having multiple players for a same direct presence means that each one of those players must verify it.

          1 Reply Last reply Reply Quote 0
          • FrostionF Offline
            Frostion Admin
            last edited by Frostion

            Well, I got the sound to work. This is the code I used:

            <!-- Start Loot drop sound -->
                    <attachment name="conditionAttachment_Loot" attachTo="Nature" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                        <option name="directPresenceTerritories" value="map" count="1"/>
                        <option name="unitPresence" value="Loot" count="1"/>
                        <option name="players" value="$AllPlayers$"/>
                    </attachment>
                    <attachment name="triggerAttachment_Loot_is_dropped_on_the_map" attachTo="Nature" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                        <option name="conditions" value="conditionAttachment_Loot"/>
                        <option name="notification" value="loot"/>
                        <option name="players" value="$AllPlayers$"/>
                        <option name="when" value="after:HumansBattle"/>
                        <option name="when" value="after:DwarvesBattle"/>
                        <option name="when" value="after:GnomesBattle"/>
                        <option name="when" value="after:Night-ElvesBattle"/>
                        <option name="when" value="after:OrcsBattle"/>
                        <option name="when" value="after:TaurenBattle"/>
                        <option name="when" value="after:UndeadBattle"/>
                        <option name="when" value="after:TrollsBattle"/>
                    </attachment>
            <!-- End Loot drop sound -->
            

            Seems that I am required to give “whens” in this case, even though I do not seem to need it when triggering notifications that are accompanied with window popups. This is a bit annoying, but I can live with it 🙂 If I do not give when, then the sound does not play.


            New problem: Now I get an error related to the images of units. The “Outlaws” unit is changing into a “Loot" unit when dying. Loot is a 1 round unit that is trigger removed from the map after endTurn.

                    <attachment name="unitAttachment" attachTo="Outlaws" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                        <option name="defense" value="3"/>
                        <option name="whenHitPointsDamagedChangesInto" value="1:false:Loot"/>
                    </attachment>
            
                    <attachment name="unitAttachment" attachTo="Loot" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                        <option name="isInfrastructure" value="true"/>
                        <option name="createsResourcesList" value="10:XP"/>
                        <option name="createsResourcesList" value="1:Gold"/>
                    </attachment>
            

            But I guess this is a topic for another discussion. Generally I see a lot of image + territory ownership related errors on my map or in the pre-release, that I cannot explain. I cant wait to go into beta and hopefully get som help to fix the errors.

            error.png

            Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

            1 Reply Last reply Reply Quote 0
            • FrostionF Offline
              Frostion Admin
              last edited by

              just updated post. Gave wrong code info 😛

              Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

              redrumR 1 Reply Last reply Reply Quote 0
              • redrumR Offline
                redrum Admin @Frostion
                last edited by redrum

                @Frostion Umm, the error seems to indicate that you are missing a unit image for the Outlaws unit owned by Bandits?

                PS. My general advice is to always specify the "when" as otherwise you are relying on some engine defaults that vary per type of trigger and make it very unclear when it can/will fire.

                TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                FrostionF 1 Reply Last reply Reply Quote 1
                • FrostionF Offline
                  Frostion Admin @redrum
                  last edited by

                  @redrum said in XML code that only plays an mp3 file:

                  @Frostion Umm, the error seems to indicate that you are missing a unit image for the Outlaws unit owned by Bandits?

                  But that does not make sense since the Outlaws unit is a Bandit owned unit and just fought a battle defending their territory. This situation is what my posted picture was a screenshot of.

                  Maybe it will all be easier to investigate when my map goes into beta mode ☺

                  Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

                  redrumR 1 Reply Last reply Reply Quote 0
                  • redrumR Offline
                    redrum Admin @Frostion
                    last edited by

                    @Frostion Ah I see. I'd need to see the error details to see why that's happening. Not sure if you have those but if so please post them.

                    TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                    1 Reply Last reply Reply Quote 0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • 1 / 1
                    • First post
                      Last post
                    Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums