Forum rules - please read before posting.

errors while Build & Run

For the first time I have tried to Build & Run one of my projects but I have compiler errors that are both related to AC and it doesn't go through. They are both the same kind:.

Assets/AdventureGame/Action List/ActionGravities.cs(81,38): error CS0115: `AC.ActionGravities.ShowGUI()' is marked as an override but no suitable method found to override

and also this

Assets/AdventureGame/OtherActions/ChangeHotspotMethod.cs(34,38): error CS0115: `AC.ChangeHotspotMethod.ShowGUI()' is marked as an override but no suitable method found to override

The last one is mine but its construction is the same as the first one and follows one of your examples.



    
override public void ShowGUI () 

        {

            //     Action-specific Inspector to show tha Action as the other AC Actiuons GUI code here

            mouseOver = EditorGUILayout.Toggle("enabled? ", mouseOver );

        //    mouseOver = EditorGUILayout.IntField ("1=Mouse, 0 = Vicinity",mouseOver );



            AfterRunningOption ();

I am sure this is well known item but as I say it's the first time in my almost 2 years working with AC that I have tried the Build & Run

«1

Comments

  • edited September 2016
    Both of the issues are in custom scripts.  All ShowGUI and SetLabel functions used by Actions must be placed in the UNITY_EDITOR define directive, i.e.:

    #if UNITY_EDITOR

    // ShowGUI and SetLabel functions

    #endif

    These are pre-done for you if you rely on the ActionTemplate template file, but I add an emphasis about this in the custom Action tutorial.
  • The ActionGravities   is the action template from you downloaded directly and it  has



    #if
     UNITY_EDITOR

    using UnityEditor;

    #endif

    I don't know how to write your statement // ShowGUI and SetLabel functions  everything else in this script is exactly from your files and yet it gives the same error I mention above. Please elaborate





  • Write:

    #if UNITY_EDITOR

    above your ShowGUI function, and write:

    beneath it.
  • Thanks. There is a lot to learn to try to build a game. I DO NOT want nor do I need to go commercially it is just to build an executable game and pass it over to my grand children perhaps. But for starters I would like to create something more impressive than the insipid one shown from Unity. Is there a tutorial or description on how to make this first loading screen with Instructions, 'jump-to-scenes' button, etc 
  • .....and I have seen a number of screen loaders in Asset Store but I wouldn't know the degree of compatibility with AC. Do you recommend one?
  • I don't know what you mean by "screen loader", but AC comes with the ability to define your own loading scene that is loaded in between your normal scenes - see Section 9.6 of the Manual.

    A tutorial for creating a main menu can be found here.
  • I definitely need help here. I have followed to the letter your tutorial on Creating A Title-Screen menu but I have problems.

    First where do I build this menu on a different scene or within the main scene which I call "myHome"

    If in a different scene within the same project the Settings and the Scene Managers require a Player, etc and if so (I use 1stPerson) then I have to constrain the Player or else I cannot point at any of my Title Menu. But then what do I use as a scene? I need a plane (or else the Player goes thru the floor), etc, etc.

    I would appreciate if I get some hints on what is the procedure IN GENERAL about an INTRO scene that shows the Title Menu and then when choosing the New Game button to go to the first scene ("myHome")

    Is there a

  • edited September 2016
    Well, as long as there's a default player prefab in the settings manager it'll be spawned. In third person what I've done is have an invisible cube as a fake player and have it constrained in all axis (if there's no rigidbody it won't fall either, although that's not much of a problem if the camera is fixed). 

    The invisible part will probably do it for you too. All you need to do is create a plane, or any object really, and then disable the renderer in it, so that the plane is not drawn. So, it'll be there, but invisible. Although if you open you UI screens immediately it'll hardly be noticeable by the player, because UI is not bound by the camera (unless you use world space cameras). For backgrounds you could just have a UI element that covers the whole screen but is positioned in the canvas hierarchy in a way that it's drawn behind everything else (I think things at the top of the canvas hierarchy are shown behind... I'm away from my pc, though)

    I do think though, that it would be a better idea to have a special mode just for UI only scenes, specially for title/start screens or score/achievements screens (which are supposed to have next to no overhead or ram usage). Still, I don't know what changing AC to do that would entail (specially as it's not totally necessary... although it does feel weird to have a falling/hidden/invisible character in the scene).
  • Thanks for your prompt answer. I managed to make it work now but your suggestion of using a non-rendered plane is good (my character was diving thru the floor it was a comic show!). As background I have used a skybox (from Diverse space package) for the "TitleScreen". I'll try the UI element although I am not sure I understand it

    Since you are there I would like to use some of the very cheap ( < 10 €)  Asset Store Loading  Screens which are looking more professional but am afraid of its compatibility with AC. Can I hear your comments?

  • Which scene you use for your title screen is down to you - so long as you've used the Scene Manager to convert it to an AC one, you're fine.

    The ability to define multiple player prefabs in the Settings Manager means one of which can be left blank to let you switch to "no" player.  But in this case, as you're using First Person movement, you'll want a different step.

    When the title scene begins, use the Engine: Manage systems Action to change the Movement method to None.  This will allow you switch GameCamera during gameplay (i.e. outside of cutscenes) without it automatically switching back to your First Person Camera.  You can then use the same Action again to switch back to First Person when your game proper starts.
  • edited September 2016
    Well, as long as it's just a Unity UI it should be hookable to AC just fine. You will probably need to mind how the animations/transitions are performed though (which can be done either by script or by animation). AC provides a way to hook Animations from the Animator component placed in a UI (although if the devs have scripted the transitions to the UI buttons -like a close button-, they may trigger automatically anyways). 

    You would also need to mind how the UI is being laid out or generated. By what I mean is that, if parts of the menu are being generated dynamically (like buttons or part of the general layout), it may be harder to hook specific components to AC. i.e: if buttons are generated at runtime you won't be able to hook them to AC the normal way, so you'll need to do so with scripting. 

    On the other hand if the menus do their thing without needing AC then you can just hook the canvas and the object that holds the other objects to AC (that's a common hierarchy for UI --Canvas->holder then the elements go inside that holder). Then the menu will appear and work if you call it with an actionlist even if AC doesn't actually control the buttons or the text, etc. I did this a while back with a rewired menu which allows the player to change the player inputs at runtime. Some of the menu's layout and functionality was dynamic, so I couldn't just hook the buttons to AC. But all AC needs to summon a uGUI is it's Canvas prefab and the rect transform holding the menu's content.

    Still, we would need to how these asset store's loading screens work to know how well they'd work with AC.
  • OK so I've got my first .exe of my game. Two remarks:

    1. When you want to send this game to someone you have to include 2 files apparently: the game??.exe and the Gam_Data. Is there a way to bundle these two and just send one file?
    2. When I launch the executable an UGLY screen shows " Adventure Creator Configuration...., Play!" why not my game Title instead?


  • edited September 2016
    2. Go to Edit/Project Settings/Player you'll be able to setup you game's name and company name, icon, Splash screen (if you have the right plan...) and other stuff. If you go to Edit/Project Settings/Quality you can also edit the available qualities the player will have to choose from (and which options will be the defaults).

    About the ugly screen... yeah, well, that's the Unity Player (as in Game playback). Not the coolest one, but all Unity games use it... you can customize the picture (can't recall if you need the "right plan" though as I'm doing android right now and that one doesn't have that).

    about 1. I still haven't checked that out myself. Don't know if you need a special program to "Bundle" the game (but I think that's how it goes...). Anyways, I'll try researching about it, I will need it for my next project, which is currently on hold... (or well, maybe some else might enlighten us first :) ).

    Anyway, if I find out anything I'll let you know.
  • Build an installer - for Windows, it's not that hard with this free program: 
  • edited September 2016
    Hey thanks! Do you know if it can encrypt the files? or like rename them and make dummy extensions and stuff like some other applications I remember seeing ages ago? (last time I checked the topic was years ago, lol).
  • Possibly - I think you can get it to do just about anything if you're really creative:

  • 2: The Resolution Dialog can be disabled from Edit -> Project Settings -> Player -> Resolution and Presentation
  • edited September 2016
    Hey, cool! I'd never notice that! 'll be great if you want to let the player select the resolution in-game, thanks for the tip! :)
  • Alverik : Thanks. Indeed the Edit/Project Settings/Player answered all my queries. I didn't mean by UGLY the Unity splash screen, that is OK, I meant the Configuration one and that now will be OK.

    Snebjorn  : I most certainly will try your suggestion to bundle both files. 

  • Wow ! Snebjorn  this means writing a script . I will rather use a simple batch file (the old .bat file) to bring both files down.
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.