Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Turn Based Game Controller?

Discussion in 'Scripting' started by W4RH4WK117, Apr 6, 2012.

  1. W4RH4WK117

    W4RH4WK117

    Joined:
    Feb 6, 2011
    Posts:
    129
    Hey,

    I'm having some trouble trying to figure out the best way to creating a turn based game. I'm just wondering which would be the best way about doing this. Would it be easier to have a game controller check for executed code and then pass on the turn or something or perhaps a boolean that will handle the turns? Any advice, examples or even a tutorial would be great.

    Thanks.
     
  2. Diviner

    Diviner

    Joined:
    May 8, 2010
    Posts:
    677
    My youtube tutorial series is involved in making a turn based RPG, final fantasy style. You might find some leads there. Link is on my signature.
     
  3. W4RH4WK117

    W4RH4WK117

    Joined:
    Feb 6, 2011
    Posts:
    129
    Thanks, Which video specifically will help me?
     
  4. Diviner

    Diviner

    Joined:
    May 8, 2010
    Posts:
    677
    No specific video. The entire tutorial series deals with this matter, from setting up proper data structures, to designing the combat grid, registering the combatants to the Combat Controller and then dealing with the GUI side of things.

    If you're searching for a quick tutorial on how to deal with that specific subject (the turn switch), then I am afraid I don't know of any tutorials to recommend to you. Maybe someone else in these forums does.
     
  5. Xerosigma

    Xerosigma

    Joined:
    Mar 1, 2012
    Posts:
    27
    I too can benefit from a simple "baton pass" kinda system.

    My initial guess would be you'd have to register the objects that will be passed the baton with a unique identifier, that is if they don't spawn with one already. Then maybe a loop to and some boolean to dictate who's allowed to take actions.

    Take a networked game for example, do PlayerPrefab(Clones) NPC Objects have any unique identifiers that are automatically available in Unity?

    I'll take a look at your tutorials see if I can figure anything out.
     
  6. Tobias J.

    Tobias J.

    Joined:
    Feb 21, 2012
    Posts:
    423
    Currently I'm just using 'nowPlaying' and 'playerName' string variables to check who is allowed to play. 'nowPlaying' updates from the server (or rather, it will), and 'playerName' is set at game start when players joins a game.
    Very simple, maybe too simple, but it's works for now.


    There is the GameObject.GetInstanceID(), but I don't know if they're consistent across networked players.
     
  7. MadScyan

    MadScyan

    Joined:
    Jul 30, 2013
    Posts:
    4
    Where can i find this tutorial series because i there is only 1 video in your youtube account and i cant seem to find it anywhere else in your signature