Forum rules - please read before posting.

Creating a 3D "player menu

Hi, its been a while since I used AC, I might be a little rusty, I thought this would be easy, but setting to work tonight was surprisingly hard.

I have 4 possible "Players" so player switching is set to allowed.
I have dragged my 4 players to the slots.
Now I want to have a "pre-game" scene set up like a menu. with the 4 players standing there
NO PLAYER SHOULD BE DEFINED YET!
Rolling over the characters will do something, light them up, text appear...
Click will "select" them and the game "proper" will load, bringing this character with it, starting from a unique Player Start for each character.

To be honest, I got stumped at the first hurdle.
I created an ONLoad cutscene and switched to a MENU_CAM, but it doesnt do that in instead uses the camera for the first player in the list (they are actually first person players when in game, so each has its own camera attached)

Anyway... whats the sensible way to do this... incidentally, it WILL need to be possible to remove characters from this "menu scene" if they are currently unavailable (or dead)

Comments

  • To start the game without a defined player, create another slot in the Settings Manager, leave it empty, and make it the default.

    When playing the game in first person, the camera will always be set to the first-person camera during gameplay.  If you want to rely on AC's regular GameCameras, you will have to rely on a different Movement method, presumably None in your case, and then switch to First Person once the game proper begins.

    You can switch your movement method using the Engine: Manage systems Action.  Place this Action in your game's ActionList on start game (as set in the Settings Manager), to set it to None when your game begins.  Then when a player is switched to, you can change to First Person movement.

    To start a scene in a different place according to which player you are, you don't want to rely on your default PlayerStart.  Instead, you want to run an OnStart cutscene that checks for the current player and teleports them accordingly (Player: Check and Object: Teleport).

    And OnLoad is only run when a save file is loaded - use OnStart to run Actions when a scene begins naturally.
  • edited March 2017
    Well, you could've you just setup NPC versions of your players for that scene. The AC framework (and practically all frameworks really) are not made to have multiple players in the same scene... It's best if you have clean versions (with no scripts or cameras) for that, or AC NPC versions, to avoid confusing the engine. 

    Most probably you'll only need to play some animations if the player places the mouse pointer on top of a character, right? So you can do as Chris mentioned, just setup an empty Player to use in that scene and then setup your NPC versions of the players so they can be animated. Course, that's just one of many ways to do it, so you can still explore other ways I guess.

    Anyway, hope it all works at the end.
  • edited March 2017
    Fantastic!
    You both got me started... Chris for the actual game set up and Alverik for the great and obvious point... they DONT HAVE TO BE PLAYERS.. just look like them... DOH

    Great!
  • edited March 2017
    I got this as soon as I added a OnStart cutscene: didnt add any actions.

    NullReferenceException: Object reference not set to an instance of an object
    AC.MainCamera.SetFirstPerson () (at Assets/AdventureCreator/Scripts/Camera/MainCamera.cs:346)
    AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:391)
  • edited April 2017
    Ummm... make sure your first person "player" has a first person camera. Though, it might be better to use a different Player control type during that scene. You could also start by using a third person setup and change to first person when switching scenes. Though it could also be that it's not finding the Player. so make sure the "Player" actually is tagged Player. It's been a while since I've had to do the empty player trick so I can't recall if you need to set a Player script on it too (you can just disable locomotion and animation, etc... was how I did it long ago when I first got AC for the first time, lol)
  • Um... ok, i'll check your suggestions.
    It IS something to do with the first person set-up and yes, you are right that the characters had their cameras removed, but now I have forgotten where I set that! Is it in scene movement ? I don't need the game to know it's first person til it starts...
  • Just to be on the safe side select your Camera and the hit the AddComponent button, then type: First-person Camera, it'll appear in the search.
  • ok, Im a little confused about cameras however.
    I have the _Cameras folder in my hierarchy
    within that I have 2 more items
    _GameCameras (that contains cameras I have created, that sit in places around my game, waiting to be called from actions for cutscenes. and...
    MainCamera (that also contains a LookAt Game object.)

    HOWEVER, for normal gameplay I have a camera childed withing each of my Player Characters (you can swap players in my game) 

    The SCENE Im talking about here, is the character selection scene, and therfore as previously discussed doesn't need any player characters... So none of the onscreen characters are nor real Players (at your great suggestion).

    So the only camera IN THE SCENE, is the MainCamera... are you saying THAT should have First person attached, because I dont need it to here...
  • OK figured it out... I had an action in my OnStart cutscene Engine/manage systems... I have forgotton the menu there where you pick movement type... I selected none and the error went away... obviously looking for a first person script when there wasnt one...

    ... altho... just before I did that I DID add a First Person camera script to the MainCamera, as you suggested... the error DIDNT go away then...Hmm..
    anyway.. its working now... might run into this issue again soon...

    Wrong thread, well mayb not but an additional question... Is it problematica that I miht swap from Forst Person to 3rd person in the course of my game... thinking about the lurking First Person Cameras all attached to my players... can I "pop" them out of the player and have them become 3rd person cameras, or should I have an extra set of cameras that get enabled and disabled?
  • In future, please update to the latest AC before posting Console errors - they can't be used to solve an issue unless the line numbers match.  At the very least, you should post the version number so that we know what those lines are referencing.

    A FirstPersonCamera component must always be placed on the Player - not the MainCamera.

    Switching from 1st to 3rd-person mid-game is valid - again, just use the Engine: Manage systems Action to change the movement method.

    You will, however, require a separate set of camera for the 3rd-person mode.
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.