Coder Social home page Coder Social logo

sharpwow / chocobo Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 1.0 11.82 MB

AddOn for WoW that plays the Chocobo theme when you mount a hawkstrider!

License: GNU General Public License v3.0

Lua 100.00%
hacktoberfest wow world-of-warcraft addon music

chocobo's Introduction

Chocobo!

A friend wanted me to make an addon that plays the chocobo theme when he mounts. Didn't see any of them around so I decided to make one myself!
The Chocobo addon will play a random (4 possible) chocobo theme song when you mount on a hawkstrider of any type.
You can also change it to play the song on any mount if you want or add specific mounts that it should play on (more about that further down).

The broker plugin made by Lothaer mysteriously disappeared from Curse, it is now included with Chocobo instead.

If you have the old Broker_Chocobo plugin installed, please uninstall/disable it or it might conflict with the built-in plugin.

Available commands:

Some commands have more details about them in the sections below.

  • /chocobo - Shows a list of available commands.
  • /chocobo options - Shows the GUI to change settings.
  • /chocobo allmounts - Play song on any mount.
  • /chocobo hawkstrider - Only play song when on a hawkstrider.
  • /chocobo toggle - Toggle the AddOn on or off, will stop music if it's currently playing.
  • /chocobo debug [enable|disable] - Enable or disable debugging, calling with no argument shows current debug status.
  • /chocobo add <name of song> - Add a song.
  • /chocobo remove <name of song> - Remove a song.
  • /chocobo list - List songs.
  • /chocobo reset - Reset song list to default.
  • /chocobo addmount <name or ID of mount> - Add a mount.
  • /chocobo removemount <name or ID of mount> - Remove a mount.
  • /chocobo listmounts - List all mounts.
  • /chocobo resetmounts - Reset mount list to default.
  • /chocobo soundcontrol - Show help for soundcontrol.
  • /chocobo soundcontrol gui - Show the Sound Control GUI for changing settings.
  • /chocobo soundcontrol toggle - Toggle sound control on and off.
  • /chocobo soundcontrol default - Toggle default mode on and off (more info about that below).
  • /chocobo soundcontrol music|sfx|ambience toggle|mount|nomount - Toggle various options for music, sfx or ambience sound control.

Version 3.0

Version 3.0 of Chocobo has been released and brings a few major features with it.

The most obvious is the new Sound Control, it now allows for a lot more customization than just "Play music on mount, stop when not on mount".
You can access the new sound control options in the subcategory of "Chocobo" in Game Menu (Escape key) -> Interface -> AddOns.

In there you will find two checkboxes at the top and three tabbed panels below them.

The checkboxes are fairly straightforward:

  • Enable sound control - This is a global setting that will override any other sound control settings. If it's checked, sound control is in effect, otherwise it's not.
  • Enable default mode - When this is checked, sound control will behave like it used to, enabling music playback when you mount and disabling it when you dismount. This setting overrides any settings in the three panels.

The three available panels below allow for more customization.
All of these three panels have the same options available, the difference is that they affect three different "sound areas" in the game; Music, SFX and Ambience.

Below is a description of what the three different options mean:

  • Enable music/SFX/ambience control - Controls whether the AddOn should control the playback of music, SFX or ambienc.
  • Music/SFX/Ambience enabled when mounted - If this is checked, the respective sound will be enabled when you are mounted.
  • Music/SFX/Ambience enabled when not mounted - This works like the former option, except backwards! The respective sound will be enabled when you are not mounted.

Other changes include:

  • Complete rewrite of the slash command system, nothing that normal users should be affected by.

Customizing the AddOn

When adding a song, the file extension must be included when you add it. E.g: "mySong .mp3" instead of "mySong".

You can add your own songs to be played when mounting. To do this, simply type /chocobo add <name of song> where <name of song> is the name of the music file you want to add. The file must be located in *WoW\Interface\AddOns\Chocobo\music* and It can be of any filetype WoW supports.

To remove a song, type /chocobo remove <name of song>
To see a list of all songs, type /chocobo list
To reset the list to default, type /chocobo reset

Note that <name of song> should not contain the "Interface\AddOns\Chocobo\music" part, only the name of the file, i.e "mySong.mp3" without quotes.

Adding your own mounts

New in v2.14!

Feel like you want the addon to play on some additional mounts but not every single one? Well in Chocobo 2.14 it's possible!
When the AddOn is in "Hawkstrider Only" mode, in addition to the Hawkstriders, it will also play music if you mount on any of the mounts added in the list of user-defined mounts.

To add a mount to the list, type /chocobo addmount <name or ID of mount>.
To remove it, type /chocobo removemount <name or ID of mount>.
To list all mounts in the list, type /chocobo listmounts.
To reset the list to default (empty), type /chocobo resetmounts.

If supplying the name of a mount, you need to supply the full name of it.

You can get the ID of a mount by going to the mount spell on WoWHead and copying it into WoW.
The ID is the number after the "spell=" part in the URL: "wowhead.com/spell=1234".

It's also possible to do this through the GUI, just enter the same details in the second text field and use the corresponding buttons below it.

Controlling in-game sounds

New in v2.17!

Some users have expressed a wish for all sounds to be disabled and for music to only be enabled when actually mounting something.
This feature has been added in v2.17!
To enable this, use the command /chocobo soundcontrol (Aliases: sc, sndctrl), this will toggle the addon between controlling in-game sounds or leaving them as they are.

When sound control is enabled, all sounds (including music) will be disabled. When you mount on any of the currently enabled mounts, music will be enabled and a random song will play just like it does in its normal mode.

Please note that if your music volume is set to 0 when mounting with sound control enabled, the AddOn will automatically set the music volume to maximum (1.0, or 100%). If the music volume is at anything other than 0, it will be left unmodified.

If you're not the guy who likes typing long slash commands all day long, you can also bring up a GUI with a simple button to toggle it.
Bring up the normal options window by typing /chocobo options or by using the Broker plugin and then go to "Sound Control". When you're done, exit the options and everything will be saved.

Custom songs per-mount

New in v3.7!

Do you have special mounts, that should also have special songs associated with them, as opposed to the normal songs used for all your other mounts? This is possible to do in v3.7!

Say that you want "HorseAwesomeness.mp3" to play when you mount the Brown Horse, you can do this in one of two ways:

Using Commands

/chocobo addcustom <MountName> <SongName>
Where <MountName> is the name of the mount you want to add music to, and <SongName> is the song file.
In our example, the result would be:
/chocobo addcustom "Brown Horse" "HorseAwesomeness.mp3"

Note that %lt;MountName> and <SongName> MUST be enclosed in quotation marks.

Using Interface Options

The other option is to use the interface options, simply navigate to Chocobo -> Custom Songs and use the two textboxes to specify song and mount name, then use the buttons to add, remove or list songs.

Localization

Localization support has been added in v2.6-beta, if you want to help with localizing, please visit the localization page on CurseForge.

I found a bug!

Report any bugs you find on the issues page!

Thanks to...

Thanks to Flurdy for giving me the idea to make this AddOn (he's the "friend" I talk about at the top there), hi Flur!

Thanks to the following people for providing code suggestions:

  • ITSBTH
  • Tinyash (Ashik)

chocobo's People

Contributors

sharparam avatar

Watchers

 avatar James Cloos avatar Sharparam CI avatar

Forkers

webberjo

chocobo's Issues

Command "/chocobo options" not working and addon not showing up under "Esc - Options - AddOns" or on minimap

Describe the bug

Addon itself works but neither the minimap icon, the "Esc - Options - AddOns" option nor the "/chocobo options" or "/chocobo gui" command work, infact: you didnt list the "gui" command but the game actively hinders me on sending either command in chat, I can press enter all I want but the prompt isnt send from the "type your chat message" line. All others are fine, but "/chocobo options" or "/chocobo gui" dont work

To Reproduce

download the addon and try to use it ?
I dunno -

  1. Went on Curseforge Desktop App
  2. Downloaded the addon
  3. Opened WoW
  4. Activated it in the character screen
  5. Saw nothing ingame until I used commands

I also tried disabling all other addons and restarting the game but to no avail

Expected behavior

I expect to have a GUI, as described and shown, I guess?

Screenshots

maybe this helps, I dunno https://i.gyazo.com/e850df9e15aa37b02eccc722b5e989ce.jpg
shows that the addon is loaded but not showing up for me

Environment (please complete the following information)

  • OS: Win 10
  • WoW version/patch: 10.2
  • WoW branch: retail
  • AddOn version: v4.10.4
  • Are you using a nolibs download of the AddOn? No, I downloaded this addon via Curseforge launcher and havent seen anything hinting on it being nolibs (https://www.curseforge.com/wow/addons/chocobo) also libs folder contains 22.7kb of data

Additional context

My best guess is that the addon might still rely on the "interface" menu which is gone now since everything was merged into "options". I only suspect this since your own guide on the addon site still refers to "Esc - Interface - AddOns", little nit picky and most likely not the case but the only thing I could think of rn cuz I stopped playing 6 years ago and just picked it up again and dont know at which point the Interface and Options menu have been merged.

Addon also has no icon under "Esc - AddOns". Shows the default red "?" - should it have an icon or does this already hint towards problems?

I've only tested 2 songs so far with "/chocobo addcustom" and they both worked. They dont leave an entry in "/chocobo listmounts" but "/chocobo list" works to make them visible, but I made a typo and cant seem to delete that custom list entry. I entered "Winged Slitherdrake" instead of the actual name "Winding Slitherdrake" - its just cosmetical at this point but still wanted to mention it. Tried the "remove" and "removemount" command, since it mentioned user added mounts (but so does the "listmounts" command, yet they dont show up) and the "addcustom" command also isnt listed, I read that on the curseforge page.

Aside from that it still seems to work properly via chat commands

If something has gone wrong on my end somewhere, please do let me know and I'll try again, but thats my experience so far. Hope I dont have gone too far off track ^^'

Will you be working to fix this problem yourself in a PR?

lol

Custom Songs Not Playing?

I cannot get the Custom songs to work. I believe I am adding correctly but please correct me if not.

I am trying to add the chocobo theme for FF6 into this. I have the song in an MP3 format and have tried 2 file names that are saved inside of the music folder for the Chocobo addon - "chocobo_ffvi" and "chocobo_ffvi.mp3". I can add either file name in-game to the list and it shows up but nothing plays. Debug mode says it is playing the song but nothing happens?

To Reproduce

Steps to reproduce the behavior:

  1. Select an MP3 song to upload into Chocobo
  2. Rename the file to "chocobo_ffvi" or "chocobo_ffvi.mp3", without quotes.
  3. Add the file into the "music" folder for the Chocobo addon.
  4. Launch WoW Classic TBC
  5. Use the Chocobo addon command or the options page to add the song to the list
  6. Ensure the addon is playing music on all mounts
  7. Mount

Expected behavior

I expected the song to play when mounting.

Environment (please complete the following information)

  • OS: Windows 10
  • WoW TBC Classic - Version 2.5.1 (38835) (Release x64) May 27 2021
  • AddOn version: v4.10.0
  • Are you using a nolibs download of the AddOn? No

Will you be working to fix this problem yourself in a PR?

No.

Error when default music list is empty and no custom song defined

Describe the bug

After entering the world, when I try to mount on anything other than the mounts I assigned a custom song to (didn't try the OG bird mounts that are supposed to work by default like riding cranes and such), Chocobo will have this lua error and won't work until I reload and it remount on only mounts that I assigned.

Lua Error:

Message: Interface/AddOns/Chocobo/Chocobo.lua:359: bad argument #1 to 'random' (interval is empty)
Time: Mon Sep  2 04:20:39 2024
Count: 1
Stack: Interface/AddOns/Chocobo/Chocobo.lua:359: bad argument #1 to 'random' (interval is empty)
[string "@Interface/AddOns/Chocobo/Chocobo.lua"]:359: in function PlayRandomMusic'
[string "@Interface/AddOns/Chocobo/Chocobo.lua"]:224: in function CheckMount'
[string "@Interface/AddOns/Chocobo/Chocobo.lua"]:187: in function <Interface/AddOns/Chocobo/Chocobo.lua:187>

Locals: self = <table> {
 Mounted = true
 Loaded = true
 Events = <table> {
 }
 Frame = Frame {
 }
 Songs = <table> {
 }
 SoundControl = <table> {
 }
 CustomSongPanel = <table> {
 }
 Options = <table> {
 }
 Command = <table> {
 }
 Version = "v4.10.9"
 Global = <table> {
 }
 MusicDir = "Interface\AddOns\Chocobo\music\"
 Mounts = <table> {
 }
 Name = "Chocobo"
 Running = true
}
mount = nil
nowPlaying = nil

To Reproduce

Steps to reproduce the behavior:

  1. Try mounting on anything that doesn't have a song defined I guess? Otherwise I wouldn't know

Expected behavior

Shouldn't "crash" the addon

Screenshots

If applicable, add screenshots to help explain your problem.

Environment (please complete the following information)

  • OS: Win 10
  • WoW version/patch: 11.0.2
  • WoW branch: retail
  • AddOn version: v4.10.9
  • Are you using a nolibs download of the AddOn? No, I downloaded this addon via Curseforge launcher and havent seen anything hinting on it being nolibs (https://www.curseforge.com/wow/addons/chocobo) also libs folder contains 22.7kb of data

Additional context

I again don't assume its all the addons fault and something might be faulty on my end as well but I couldn't find anything even after reinstalling chocobo and only having it run by itself. I also think that when it results in an error, that something happens with the background music - dunno if its playing the actual zone song or something random but I do notice it starting primarily after crash - might be me tripping tho, because I am anticipating something to happen

Will you be working to fix this problem yourself in a PR?

I asked ChatGPT to help me out to at least have an error thrown to show what went wrong and to also handle the error in a way that would allow the addon to still be running - it added this snippet:


function C:PlayRandomMusic(mount)
    if mount then
        self:PlayMusic(mount, true)
    else
        -- Check if the music table is empty
        if #self.Global["MUSIC"] == 0 then
            self:ErrorMsg("Music list is empty, cannot play random music.")
            return
        end

        local id = math.random(1, #self.Global["MUSIC"])
        
        if self.Global["PREVENTDUPE"] and #self.Global["MUSIC"] > 1 then
            local name = self.Global["MUSIC"][id]
            while name == nowPlaying do
                id = math.random(1, #self.Global["MUSIC"])
                name = self.Global["MUSIC"][id]
            end
        end
        
        self:PlayMusic(id)
    end
end

or as explained by itself:

The main issue was the potential for an empty music list leading to an invalid call to 'math.random'. By adding a check to ensure that the list is not empty before trying to select a random song, the error should be resolved.

Which works for now but I don't want to rely on a band aid that I don't fully understand. Hope this is somewhat of help and I'm looking forward to (hopefully) your next patch :D

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.