#✅ | Audio with FMA animation
1 messages · Page 1 of 1 (latest)
Hi Rocky! 👋
FMA files are a special animated texture format in FancyMenu, which means they are purely visual and don't support audio directly. They are designed to act like animated images.
However, you can definitely pair audio with your FMA animations! Here's how you can do it:
- Use an Audio Element: Add an "Audio" element to your layout. You can then configure this element to play your desired audio tracks.
- Documentation: Elements (under the "Audio" section) explains more about this element.
- Synchronize Playback (Optional): If you want the audio to start and stop precisely with your FMA animation, you can use action scripts.
- For example, you could have a button that, when clicked, enables both your FMA animation (if it's tied to an element that can be toggled) and starts playing the audio element.
- You can also assign identifiers to your audio elements, allowing you to control their playback (like toggling play/pause or setting volume) using action scripts associated with other elements or screen events.
- Documentation: Action Scripts provides details on how to set up actions for controlling audio elements.
Let me know if you have any more questions about setting this up! 😊
Can I do it without clicking a button? (automatically)
Yes, absolutely! You can make audio play automatically without needing to click a button. 😊
You have a few great options for that:
-
Screen Events: You can assign an action script to run automatically when a screen opens or closes.
- To start audio when a screen opens: Right-click the editor background, select "Layout Settings" then "Action Script on Screen Open". You can then add an action to play your audio element.
- To stop audio when a screen closes: Similarly, use "Action Script on Screen Close".
- Documentation: Action Scripts provides more details on using action scripts with screen events.
-
Tickers: An invisible "Ticker" element can execute actions at regular intervals or just once when the menu loads.
- Place a Ticker element in your layout.
- Right-click it and set its "Tick Mode" to "On Load Screen" to play your audio when the menu loads.
- Then, add an action to the Ticker's script to play your audio element.
- Documentation: Elements (under the "Ticker" section) explains how to use this element for automated tasks.
-
Listeners: If you want the audio to play based on a game event, even when no screen is open, you can use a "Listener".
- You can set up a listener (e.g., "On Quit Minecraft") to trigger an action script that starts or stops your audio.
- Documentation: Listeners explains how to set these up for various events.
Remember to have your "Audio" element in the layout configured with the FMA file, and then use one of these methods to automatically trigger its playback!
Can I integrate the audio on the fma file itself?
Hi Rocky!
No, you can't integrate audio directly into an FMA file itself. FMA files are exclusively for animated textures, meaning they handle only the visual frames of an animation. They don't have a built-in capacity for sound data.
To play audio alongside your FMA animation, you'll need to use a separate "Audio" element in your FancyMenu layout and synchronize its playback with your FMA, as we discussed earlier.
Hope this clarifies things! 😊
Ok so how can I add the audio file on the action script of the Ticker
Okay Rocky, great question! To add an audio file to the action script of a Ticker (or any element with an action script), you won't directly add the audio file into the action script itself. Instead, you'll place an "Audio" element in your layout first, and then use the Ticker's action script to control that Audio element.
Here’s a step-by-step guide:
Step 1: Add an Audio Element to Your Layout
- Open the Layout Editor: Go into the layout editor for the screen where you want your FMA and audio to play.
- Add Audio Element: Right-click on the editor background -> New Element -> Audio.
- Configure the Audio Element:
- Right-click the newly added Audio element.
- Click on Manage Tracks.
- Click Add Track and select your audio file (e.g., an
.oggor.wavfile). - Make a note of the Element Identifier of this Audio element. You can right-click the audio element and select "Copy Element Identifier" to copy it to your clipboard. This is what you'll use in the Ticker's action script. For example, let's say its ID is
my_background_music. - You can also set its initial volume, looping, shuffle, etc., from this menu.
Step 2: Add and Configure Your Ticker Element
- Add Ticker Element: Right-click on the editor background -> New Element -> Ticker. (Tickers are usually invisible, so you can place it anywhere).
- Edit Ticker's Action Script:
- Right-click the Ticker element -> Edit Action Script.
- Click Add Action.
- Choose the "Toggle Play/Pause Track" action (the internal name for this action is
audio_toggle_play). This action is perfect for immediately starting an audio track. You could also useNext TrackorPrevious Trackif you have multiple tracks and want more complex control. - For the value of this action, enter the Element Identifier of your Audio element from Step 1. So, if your Audio element's ID was
my_background_music, you'd entermy_background_music. - (Optional: If you want to set the volume, you could add another action: "Set Track Volume" (
set_audio_element_volume) and set its value tomy_background_music:0.5for half volume.)
- Configure Ticker's Tick Mode:
- Right-click the Ticker element again -> Tick Mode.
- Choose "On Load Screen". This will make the action script run once, immediately when the screen loads.
- If you need slightly more delay before it starts, you can set a small "Tick Delay" (e.g., 500ms for half a second).
Step 3: Save and Test!
- Save Your Layout: Press
CTRL + S. - Exit the Editor: Close the layout editor.
- Test: Your FMA animation and the audio should now play automatically when you open that screen!
Let me know if you run into any issues during these steps! 😊
Also, can I add delay to the minecraft music?
Yes, you can absolutely add a delay to when Minecraft's vanilla music starts playing in a menu! 🎶
Here's how you can achieve that using a FancyMenu "Ticker" element:
Goal: Prevent vanilla music from playing immediately when the screen loads, and instead have it start after a custom delay.
Steps:
-
Globally Disable Vanilla Music (Initially, but for a good reason!):
- First, you need a way to temporarily stop Minecraft's own music system from overriding your custom delay.
- Add a Music Controller element to your layout (Right-click editor background -> New Element -> Music Controller).
- Right-click the Music Controller element and enable "Disable Vanilla Menu Music". This will silence the vanilla music immediately.
- Why this step? Because the Music Controller allows you to control vanilla music per screen. If you just delayed it, Minecraft's default music might still kick in before your delay is over. We'll re-enable it selectively with a delay.
- Documentation: Menu Background Music (specifically the "Per Screen" section) describes using the Music Controller.
-
Add a Ticker Element for the Delay:
- Add a Ticker element to your layout (Right-click editor background -> New Element -> Ticker).
- Right-click the Ticker and set its "Tick Mode" to "Once Per Game Session" or "On Load Screen" (depending on if you want the delay to apply every time the screen loads, or only once per game session).
- Set the "Tick Delay" to your desired delay in milliseconds. For example, 5000 for a 5-second delay.
- Configure the Ticker's Action Script to Re-enable Music:
- Right-click the Ticker element -> Edit Action Script.
- Now, you need to add an action that will effectively re-enable vanilla music. There isn't a direct "enable vanilla music" action, but you can toggle the existing "Disable Vanilla Menu Music" setting of your Music Controller element.
- Add the action: "Toggle Element Active State" (this is for elements that can be active/inactive, or in this case, enabled/disabled by a state like the Music Controller's "Disable" state).
- For the value, you will need the Element Identifier of your Music Controller. For example, if your Music Controller's ID is
my_music_controller, you would use that. - The action value would be
my_music_controller. This action will toggle the Music Controller's state, essentially switching "Disable Vanilla Menu Music" to OFF, allowing vanilla music to play after the ticker's delay.
Summary of Action Flow:
- Screen loads.
- Your Ticker starts its delay countdown.
- The Music Controller is initially set to "Disable Vanilla Menu Music", so no vanilla music plays.
- After the Ticker's delay, its action script runs.
- The "Toggle Element Active State" action targets your Music Controller, switching its "Disable Vanilla Menu Music" setting back to OFF.
- Vanilla music then starts playing!
This approach effectively delays the start of Minecraft's built-in menu music. Let me know if you need any adjustments or more clarification! 🎼
I cant find Toggle Element Active State on the ticker actions
You are absolutely right to point that out, Rocky! My apologies. It seems I made a mistake in the action naming. 🙏
The action I was referring to is more generally about toggling internal states or variables, rather than a direct "toggle element active state" for the Music Controller.
Let's use a slightly different and more reliable approach by linking it to a FancyMenu variable:
Revised Steps to Delay Vanilla Music:
Step 1: Add a Dummy Variable for Control
- Open Variables Manager: Go to FancyMenu's menu bar -> Customization -> Variables -> Manage Variables.
- Add a New Variable: Click Add Variable. Give it a descriptive name like
vanilla_music_disabled. - Set Initial Value: Set its initial value to
true. This means "vanilla music is currently disabled".
Step 2: Configure the Music Controller to Listen to the Variable
- Add Music Controller: If you don't have one, add a Music Controller element to your layout (Right-click editor background -> New Element -> Music Controller).
- Set "Disable" with a Requirement:
- Right-click the Music Controller element.
- Find the option related to disabling vanilla menu music (it might be "Play Vanilla Menu Music" or a toggle called "Vanilla Menu Music").
- What you need to do is set a Loading Requirement on whether the Music Controller itself should disable vanilla music.
- Right-click the Music Controller element -> Loading Requirements.
- Click Add Requirement.
- Select the "Is Variable Value (FM Variable)" requirement.
- Set the value to check:
vanilla_music_disabled:true(meaning, if the variablevanilla_music_disabledistrue, then this requirement is met). - This setup means: As long as
vanilla_music_disabledistrue, the Music Controller will be active and disable vanilla music.
Step 3: Configure the Ticker to Change the Variable (After Delay)
- Add Ticker Element: Add a Ticker element to your layout.
- Set Tick Mode and Delay:
- Right-click the Ticker element -> Tick Mode -> Choose "On Load Screen".
- Right-click the Ticker element -> Tick Delay -> Set your desired delay in milliseconds (e.g.,
5000for 5 seconds).
- Edit Ticker's Action Script:
- Right-click the Ticker element -> Edit Action Script.
- Click Add Action.
- Select the action: "Set Variable Value (FM Variable)" (
set_variable). - For the value of this action, type:
vanilla_music_disabled:false. (This will set the variable tofalseafter the delay).
Step 4: Save and Test!
- Save Your Layout: Press
CTRL + S. - Exit the Editor: Close the layout editor.
- Test: The vanilla music should now be silenced initially, and then start playing after your specified delay!
Explanation:
When the screen loads, the vanilla_music_disabled variable is true. The Music Controller element sees this variable's value through its Loading Requirement, and therefore actively disables vanilla music. After your set delay, the Ticker's action script changes the vanilla_music_disabled variable to false. The Music Controller then no longer meets its loading requirement, becomes inactive, and stops disabling vanilla music, allowing it to play naturally.
Apologies again for the confusion with the action name, Rocky! This variable-based approach is a very common and flexible way to control element behavior in FancyMenu. 😊
This support thread has been marked as solved by @dense quiver.
The AI helper is now disabled, but you can still continue the conversation if needed. Thank you for using our support system!