Forum rules - please read before posting.

Platform spesific hotspots

Hi AC coomunity,

My game is going multi platform. I want to know is when the player hover over a hotspot it will show by default to press E, but if the player is playing on PlayStation that press E must be replaced with Press Square. How do I get to do that in AC?

Thanks in advance.

Comments

  • Is your "E" currently shown on a Graphic element in a Menu?

    You can use the Engine: Check platform Action to check the current platform, and show/hide different elements when the Menu turns on.

    Currently this Action doesn't let you check for Playstation, but I'll look into this. In the meantime, you can check if it's not Desktop.

  • Thanks Chris but I do have two more questions regarding this.
    1. What is the best approach? In the menus must I create a Hotspot menu for every platform or can I use the ActionList when turn on and run a actionlist to check the platform?
    2. Lastly I currently to have the Nintendo Switch module installed on Unity, but I can only see a limited amount of platforms in AC. Is there another way to see all of the required platforms?

  • What is the best approach? In the menus must I create a Hotspot menu for every platform or can I use the ActionList when turn on and run a actionlist to check the platform?

    No need for separate Menus - just modify the existing Menu when it turns on.

    Lastly I currently to have the Nintendo Switch module installed on Unity, but I can only see a limited amount of platforms in AC. Is there another way to see all of the required platforms?

    The issue is that Unity no longer lists the Switch / Playstation platform directives on their symbol reference page. I'm not sure what the scripting define symbols are for these platforms now.

    Here's a custom Action that will let you check between Desktop, Switch and Playstation:

    #if UNITY_EDITOR
    using UnityEditor;
    #endif
    
    namespace AC
    {
    
        [System.Serializable]
        public class ActionPlatformCheckNew : ActionCheck
        {
    
            public enum PlatformTypeNew { Desktop, Switch, Playstation};
            public PlatformTypeNew platformType;
    
    
            public override ActionCategory Category { get { return ActionCategory.Engine; } }
            public override string Title { get { return "Check platform (new)"; }}
    
    
            public override bool CheckCondition ()
            {
                switch (platformType)
                {
    
                    case PlatformTypeNew.Desktop:
                        #if UNITY_STANDALONE
                        return true;
                        #endif
                        break;
    
                    case PlatformTypeNew.Switch:
                        #if UNITY_SWITCH
                        return true;
                        #endif
                        break;
    
                    case PlatformTypeNew.Playstation:
                        #if UNITY_PLAYSTATION
                        return true;
                        #endif
                        break;
    
                    default:
                        break;
                }
    
                return false;
            }
    
    
            #if UNITY_EDITOR
    
            public override void ShowGUI ()
            {
                platformType = (PlatformTypeNew) EditorGUILayout.EnumPopup ("Platform is:", platformType);
            }
    
    
            public override string SetLabel ()
            {
                return platformType.ToString ();
            }
    
            #endif
    
        }
    
    }
    

    For it to work, you'll need to have the correct Scripting Define Symbol defined for each platform. In the script, this is UNITY_SWITCH for the Switch, and UNITY_PLAYSTATION for Playstation. If your Player settings already has these set automatically, modify the code above to match. Otherwise, you can add these symbols manually in the Player Settings.

  • Thanks Chirs, I have added the XBox platform to the code. I am struggeling though to update the art of each for each platform during runtime. Please see the hotspot actionlist below.
    (https://imgur.com/a/ijPPigb)

  • What is the result? The logic looks fine.

  • edited June 24

    It is currently not displaying the image, and this action script is running on the On Start of the Hotspot

  • Have you added the scripting define symbols for each platform?

  • Hi Chris yes I did.

  • Share screens of it all - the symbols, the Menu, the element.

    If you add an ActionList: Comment Action to the end of the chain (run if no conditions are met), does its text appear in the Console?

  • edited June 25

    Hi Chris, so I added the Actionlist: Comment but nothing is displaying in my console.

    Here are the screenshots you require.

    The Symbols - https://imgur.com/a/mu3kGIb
    The menu setup of Hotspot - https://imgur.com/a/HDZvKx4
    The ActionList - https://imgur.com/a/iNihYJq

    So just an update of how it is currently setup.

    • The symbols are defined
    • I have created a actionlist that is assinged in the Actionlist when turn on field of the Hotspot menu
    • I am currently using the script you provided above.
    • One last thing, is that in this project I am using AC v1.79.3 and Unity 2022.2.10f1. I did an update previously but got so much errors.

    I hope this helps.

  • Looks like there's a couple of factors.

    The Graphic element is set to "Automatic" size, so it'll be based on the texture supplied. It's based on its default value, though, so an empty texture is likely causing it to show but with zero size. Try assigning a default texture of the same size as the others.

    Also: you've defined all of your symbols together. What you need is for one symbol be present for each platform - i.e. on Switch, UNITY_SWITCH is present, but not the others.

  • Hi Chris, no this is also not working. For now I think I will just change the graphic manually for each platfrom.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.