#how to make a difficulty menu wjhenever you create a new world

1 messages Β· Page 1 of 1 (latest)

brazen turtle
#

continuation

pine jungleBOT
# brazen turtle continuation

Hello Jmynii! πŸ‘‹

To integrate a custom difficulty menu into the world creation process, you'll generally be working outside of the world creation screen itself, as it's quite complex and difficult to customize directly with FancyMenu.

The best approach would be to create a custom GUI screen for your difficulty selection and then link into it.

Here's how you can approach this:

  1. Create a Custom GUI for your Difficulty Menu:

    • Go to FancyMenu's menu bar: Customization -> Custom GUIs -> Manage Custom GUIs.
    • Click on New GUI and give it a unique identifier (e.g., difficulty_menu). This will be your custom difficulty selection screen.
    • You can then design this custom GUI with buttons for Easy, Normal, Hard, etc., and other decorative elements.
    • For more details on creating Custom GUIs, you can check out the documentation here: Custom GUIs
  2. Use Buttons with Actions to Set Difficulty:

    • On your custom difficulty GUI, add Button elements for each difficulty option (e.g., "Easy", "Normal", "Hard").
    • For each button, configure an Action Script to set the Minecraft difficulty option.
      • Right-click a button -> Edit Action Script -> Add Action -> Set Minecraft Option (edit_minecraft_option).
      • For the value, you'd use something like difficulty:easy for the easy button, difficulty:normal for normal, and so on.
    • For more on setting Minecraft options, see: Set/Get Minecraft Options
    • After setting the difficulty, you might want to add another action to the button to close your custom difficulty GUI and return to the previous screen or the world creation screen. You can use the closegui action for this.
#
  1. Opening Your Custom Difficulty Menu:
    This is the tricky part, as interacting with the default "Create New World" button to replace its action isn't straightforward. FancyMenu primarily allows you to customize existing elements or add new interactive ones.

    A potential workaround could be:

    • Hide the original "Create New World" button: In the layout editor for the default world creation screen, right-click the "Create New World" button and select "Delete". You can show it again later if needed via menu bar -> Element -> Deleted Vanilla Elements.
    • Add your own "Create New World" button: Create a new Custom Button in the same location.
    • Configure your custom button:
      • Make its Action Script open your new custom difficulty GUI using the opengui action, with your custom GUI's identifier (e.g., opengui:difficulty_menu).
      • On your custom difficulty menu, after selecting a difficulty, you would need a button that performs the actual "Create New World" action. This might involve mimicking the original vanilla button's action if possible, or using a command if one exists.
      • For mimicking a button, check the mimicbutton action described here: Action Scripts (search for "Mimic Vanilla/Mod Button").
      • However, please note that mimicking core world creation logic can be very difficult. The documentation states that opengui may not work for all mod screens due to complexity, and the same might apply to mimicking intricate vanilla screen logic.

Unfortunately, directly injecting a custom step into Minecraft's world creation flow is beyond what FancyMenu is designed to do seamlessly. The "World Creation Screen" is also noted as being particularly complex to customize. You can read more about this limitation here: World Creation Screen

#

I hope this gives you a good starting point for your custom difficulty menu! Let me know if you have any more questions. 😊

brazen turtle
#

i have buttons for the difficulty system which scroll from left to rigjht or wahtever. but for some reason they dont appear?

pine jungleBOT
# brazen turtle i have buttons for the difficulty system which scroll from left to rigjht or wah...

Oh no, that's frustrating when elements don't appear as expected! πŸ˜₯ Let's try to figure out why your difficulty buttons aren't showing up.

Since your buttons are set to scroll from left to right, it sounds like they might be part of an animated element or perhaps you've set some advanced positioning.

Here are a few common reasons why elements might not appear and what you can check:

  1. Layout Enabled and Active Screen Customization:

    • Make sure the layout where your buttons are located is enabled for the screen you're viewing.
    • Also, ensure that "Current Screen Customization" is enabled for that specific screen.
    • If you're using a universal layout, check its whitelist/blacklist settings.
  2. Element Visibility:

    • Right-click on each button in the layout editor and check its "Visibility" option. Is it set to "Enabled"?
    • Sometimes elements can be accidentally set to invisible.
  3. Loading Requirements:

    • Do your buttons have any "Loading Requirements" set? If so, those requirements might not be met, causing the buttons to remain hidden.
    • Right-click each button -> Loading Requirements. Check if there are any, and if their conditions are currently true.
    • For more on requirements: Conditions (Requirements)
  4. Positioning - Are they Off-Screen?:

    • If you've used advanced positioning or set them to move, they might be appearing off-screen.
    • In the layout editor, try zooming out or moving elements around to see if they're just far away.
    • If you've disabled "Stay On Screen" for them, they might have moved completely out of view.
    • More on positioning: Positioning Elements
#
  1. Scaling Issues:

    • If the GUI scale or auto-scaling is active, the buttons might be scaled down to an unnoticeable size.
    • Check Layout -> Properties or right-click the editor background for GUI Scale and Auto-Scaling settings.
  2. Layering Issues:

    • Are your buttons perhaps behind another element that's fully opaque?
    • Check the Layers widget (Window -> Widgets -> Layers from the menu bar) to see the stacking order of your elements. You can drag them up or down to change their render order.
    • Check if "Render Custom Elements Behind Vanilla" is toggled on (right-click editor background).
  3. Element Animator/Dependencies:

    • If their "scrolling" effect is being handled by an Element Animator, ensure the animator itself is configured correctly and targeting your buttons.
    • More on animating: Element Animator

Could you tell me a little more about how you've set up the "scrolling from left to right" part? Is it an animation, or is it related to the button type or text element itself? That might give me a better clue! 😊

brazen turtle
#

okay so they are visible, auto scaling is disabled, they are above the other things for the layers, they are on screen, they dont haveany loading requirements and the layout is enabled

pine jungleBOT
# brazen turtle okay so they are visible, auto scaling is disabled, they are above the other thi...

Okay, that's great that we've narrowed down the possibilities! It sounds like the basic visibility and loading conditions are all met. πŸ‘

Since you mentioned they are "scrolling from left to right or whatever" and that's usually done with animation, let's explore that area more deeply.

If they're visible in the editor but not in-game, and you've confirmed all the points you listed, here are some other things that might be preventing them from appearing or behaving correctly when the game actually runs:

  1. Animation/Ticker Configuration (if used for scrolling):
    • Is an Animator targeting them? If you're using an Element Animator to create the "scrolling" effect, check that the Animator element itself is correctly set up.
      • Right-click the Animator element -> Manage Targets. Are your buttons listed there?
      • Is the Animator playing? What are its loop settings, delay, etc.?
      • Are the keyframes correct and covering the entire animation duration you expect?
    • Is a Ticker updating their position/visibility? If you're using a Ticker element with set_variable actions to move them, check the Ticker's settings:
      • Tick Mode: Is it set to "Normal" (always ticking) or "On Load Screen" (only once per screen load)? If "On Load Screen", is the animation already completed by then?
      • Tick Delay: Is the delay too long, making the animation appear not to start?
      • Review the Action Script of the Ticker. Are the set_variable or set_element_position actions correctly incrementing/decrementing position over time?
    • Check the documentation for these elements:
#
  1. Parent Element Issues (if elements are anchored to another moving element):

    • Are these buttons anchored to another element that might be off-screen or invisible? When elements are anchored to each other, they move together.
    • Right-click on one of your buttons -> check its Anchor Point. If it's anchored to a specific custom element, check that element.
    • More on anchoring: Positioning Elements
  2. Performance Overload/Resource Issues:

    • Are there many animated elements or very high-resolution textures involved in your scrolling mechanism? Sometimes, if there's a heavy load, elements might not render correctly.
    • If using FMA animations, ensure you're within recommended frame/resolution limits: Animations (FMA)
    • If using web resources, check your internet connection and if the resources are loading correctly.
  3. Conflicts with other Mods:

    • Although less likely if they show in the editor, sometimes other mods can interfere with rendering elements, especially dynamic ones.
    • While you've confirmed they're visible in the editor, try running Minecraft with only FancyMenu and see if they appear. This is a common debugging step for mod conflicts.
    • You can refer to the Incompatibility List for known mod interactions.
  4. Corrupted Layout File / FancyMenu Cache:

    • Rarely, a layout file can become corrupted, or FancyMenu's internal cache might be acting up.
    • Try saving the layout, then using CTRL + ALT + R in-game to force a full FancyMenu reload.
    • As a last resort, you could try duplicating the layout (Layout -> Save As), then deleting the original to see if a fresh copy works.
#

Could you elaborate on how you "make them scroll"? Knowing if it's an Animation, a Ticker, or something else entirely will help zero in on the problem! 😊

brazen turtle
#

so pretty much by "Scroll" it just means change the difficulty. like if i press the right arrow when the difficulty is set to normal, it will change to hard. etc etc

pine jungleBOT
# brazen turtle so pretty much by "Scroll" it just means change the difficulty. like if i press ...

Ah, I understand now! My apologies for misunderstanding "scroll"! You mean cycling through the difficulty options, not a visual scrolling animation. My bad! πŸ˜…

Okay, if your "scrolling" implies changing the difficulty (e.g., from Easy to Normal, Normal to Hard, Hard to Easy again, etc.) using arrow buttons, then the key setup is an Action Script on those arrow buttons interacting with a FancyMenu Variable.

Let's re-evaluate based on this! Since you confirmed:

  • The buttons are visible in the editor and in-game.
  • Auto-scaling is disabled.
  • They are above other elements in layers.
  • They are on-screen.
  • They have no loading requirements.
  • The layout is enabled.

Then the issue is likely within the Action Script of your arrow buttons, or how the variable is being set/read.

Here’s what to check:

  1. Variable Initialization:

    • Go to Customization -> Variables -> Manage Variables.
    • Do you have a variable specifically for tracking the current difficulty (e.g., current_difficulty)?
    • Is it initialized with a starting value (e.g., easy, normal, or hard)? If it's empty, your logic relying on getvariable might fail.
  2. Action Script for the "Right Arrow" Button (to increase difficulty):

    • Right-click your "Right Arrow" button in the editor -> Edit Action Script.
    • You'll likely need a chain of IF, ELSE-IF, ELSE statements to cycle through the options correctly.

    Here’s an example structure for a variable named difficulty_state:

#
    β–Ά Action Script (on "Right Arrow" button click)
    β”‚
    β”œβ”€β–Ά IF (Is Variable Value | name: difficulty_state, value: easy)
    β”‚  └─■ Set Variable Value: difficulty_state:normal
    β”‚     └─■ (Optional: Set Minecraft Option: difficulty:normal)
    β”‚
    β”œβ”€β–Ά ELSE-IF (Is Variable Value | name: difficulty_state, value: normal)
    β”‚  └─■ Set Variable Value: difficulty_state:hard
    β”‚     └─■ (Optional: Set Minecraft Option: difficulty:hard)
    β”‚
    └─▢ ELSE (meaning: current_difficulty is 'hard' or something else, cycle back)
       └─■ Set Variable Value: difficulty_state:easy
          └─■ (Optional: Set Minecraft Option: difficulty:easy)
    ```

    *   **Crucially, are the `Set Variable Value` actions within each `IF`/`ELSE-IF`/`ELSE` block correctly setting the variable to the *next* state?**

3.  **Action Script for the "Left Arrow" Button (to decrease difficulty)**:
    *   This button would have a similar `IF`, `ELSE-IF`, `ELSE` structure, but with the logic reversed.
    *   Example: If `difficulty_state` is `easy`, set to `hard`. If `difficulty_state` is `normal`, set to `easy`. If `difficulty_state` is `hard`, set to `normal`.

4.  **Displaying the Current Difficulty**:
    *   How are you showing the currently selected difficulty (e.g., "Normal", "Hard")?
    *   Are you using a **Text** element with the `getvariable` placeholder like this?
        ```
        Difficulty: {"placeholder":"getvariable","values":{"name":"difficulty_state"}}
        ```
    *   If this Text element updates, but the actual difficulty isn't changing in-game, then the issue is likely in the "Optional: Set Minecraft Option" step.
#
  1. Setting the Actual Minecraft Option:
    • It's important to know that setting a FancyMenu variable like difficulty_state only changes the variable within FancyMenu. It doesn't automatically change Minecraft's game settings.

    • You need to explicitly use the Set Minecraft Option Value action (type edit_minecraft_option) to change the actual game difficulty.

    • This action must also be in your button's Action Script, right after you set your FancyMenu variable.

    • For more on setting Minecraft options: Set/Get Minecraft Options

Can you share the exact action script you have configured on one of your arrow buttons? That would help a lot in diagnosing the problem. If it's related to the "Set Variable" and "Is Variable Value" logic, I can spot it more easily! 😊

brazen turtle
pine jungleBOT
# brazen turtle

Thank you for sharing the screenshot, Jmynii! This is very helpful. 😊

From the image, I can see you have an Action Script that looks like it's trying to cycle a variable called current_difficulty between values. That's a great start!

However, the issue with this specific setup is that the IF and ELSE-IF statements are both using (Is Number). This is the requirement that needs to be met for that block of actions to execute.

Currently, your script basically reads as:

  • IF (Is Number): If some number condition is true... (then set difficulty to 2)
  • ELSE-IF (Is Number): Else, if some other number condition is true... (then set difficulty to 3)
  • ELSE: Else (if neither of the above were true)... (then set difficulty to 1)

The problem is that the (Is Number) requirement on its own doesn't specify which number it's checking or comparing against. It's a general requirement type. You need to configure the Is Number requirement itself to check the current value of current_difficulty.

Here's how you need to refine the setup:

For your IF (Is Number) block:

  1. Right-click on the IF (Is Number) statement in the editor.
  2. Select Edit Requirement.
  3. You'll likely see the "Is Number" requirement. Select it and click Edit Value (or something similar to define its parameters).
  4. You need to specify what number to check and what to compare it against. For example, if this IF block is meant to run when current_difficulty is 1:
    • Mode: equals
    • Number: {"placeholder":"getvariable","values":{"name":"current_difficulty"}}
    • Compare With: 1
    • This makes the IF statement trigger if current_difficulty is currently 1.
#

For your ELSE-IF (Is Number) block:

  1. Repeat the steps above for the ELSE-IF (Is Number) statement.
  2. If this condition is meant to run when current_difficulty is 2:
    • Mode: equals
    • Number: {"placeholder":"getvariable","values":{"name":"current_difficulty"}}
    • Compare With: 2
    • This makes the ELSE-IF statement trigger if current_difficulty was 2 (and the IF condition wasn't met).

What your entire button action script should look like (for a "cycle forward" button):

Let's assume your difficulty values are 1 (Easy), 2 (Normal), 3 (Hard).

β–Ά Action Script (on "Cycle Forward" button click)
β”‚
β”œβ”€β–Ά IF (Is Number | Checks if current_difficulty == 1) // So current_difficulty is Easy
β”‚  └─■ Set Variable Value: current_difficulty:2       // Change to Normal
β”‚     └─■ Set Minecraft Option: difficulty:normal     // (Optional, change actual MC difficulty)
β”‚
β”œβ”€β–Ά ELSE-IF (Is Number | Checks if current_difficulty == 2) // So current_difficulty is Normal
β”‚  └─■ Set Variable Value: current_difficulty:3         // Change to Hard
β”‚     └─■ Set Minecraft Option: difficulty:hard        // (Optional, change actual MC difficulty)
β”‚
└─▢ ELSE (meaning current_difficulty is 3, or anything else like empty/invalid)
   └─■ Set Variable Value: current_difficulty:1         // Cycle back to Easy
      └─■ Set Minecraft Option: difficulty:easy         // (Optional, change actual MC difficulty)

Key Steps to Fix:

#
  1. Edit the Is Number requirements: For both your IF and ELSE-IF blocks, you MUST explicitly tell the Is Number requirement to check the value of your current_difficulty variable and compare it to a specific number. You'll use the {"placeholder":"getvariable","values":{"name":"current_difficulty"}} in the "Number" field of the requirement.
  2. Add Set Minecraft Option actions: Don't forget that after changing the current_difficulty variable, you need to add a Set Minecraft Option Value (edit_minecraft_option) action within each block to actually set the game's difficulty. (e.g., difficulty:easy, difficulty:normal, difficulty:hard)

Once you've adjusted those requirements, your button should start cycling the variable values, and with the added Set Minecraft Option action, also the game's difficulty!

Let me know if you need more help with editing those Is Number requirement values. I'm here to help! 😊

brazen turtle
#

this is the compare thing for the first IF statement.
Number = {"placeholder":"getvariable","values":{"name":"difficulty"}}

Compare to number: 1

pine jungleBOT
#
Thread Message Limit Reached

This support thread has reached the maximum limit of 20 messages. To continue getting support, please start a new thread by asking your question in the #fancymenu-help channel.

Creating a new thread will help keep conversations organized and ensure you get the best support possible.