Results 1 to 5 of 5

Thread: Changing Number of Players

  1. #1

    Changing Number of Players

    Hi all,

    I'm just about finished scripting Dragon Canyon! The last major hurdle is changing the number of players (2-5). There's a bunch of scripting zones and hard-coded locations related to each player, although I've tried to dynamically generate positions wherever possible.

    Here is my question: what's best practice for handling multiple player counts? Is it possible to move and delete scripting zones and player hands? Is it possible to 'kick' player colors that aren't being used? I know from experience this can be tricky when (for example) you try broadcasting to a color that isn't present.

    Plan A: asking for player count on load, and changing the script accordingly. Plan B: creating multiple save files (one for each player count).

    Let me know if you have any tips/experience with this issue I can also provide the file if it helps.

  2. #2
    Join Date
    May 2016
    This is a really broad question, I'm not sure how to help with it. Why do you want to remove unused hands/script zones when the game starts? Is it because you want to avoid your code interacting with them, so nobody else is capable of joining?

  3. #3
    Sorry for being unclear!

    The game file currently has player hands and numerous scripting zones for 5 (player boards, resources, a card tableau). Every player has their own set of cards. It's quite crowded.

    What I want is to customize the setup based on the number of players - remove all the objects that won't be used, and move player hands around the table for maximum space. I would also like to prevent other players joining after the game has started (they should only be spectators).

    So I'm not sure whether I'm better off making multiple save files (for the different player counts) or have 1 file that is modified.

    5 players.jpg

  4. #4
    Join Date
    May 2016
    You'll need a way to identify each player's items, so a script zone over each player's stuff would work, or GUIDs or some other method. Then make a table an associate that player's gear finders with the color. ["White"] = "guid for script zone", ["Red"]="guid for script zone" etc

    Then have some way to indicate a game is beginning. A "start game" button or "lock in players" or whatever. When it is triggered, loop through your table of colors+objects and check if Player[color].seated is true. If it isn't true then you know no player is seated there and you can use the object association tied to that color in your colors+objects table to remove the unwanted objects.

    I don't really know a way to delete hands with scripting without getting info out of the JSON, but you could use Player[color].setHandTransform to place their hand in the stratosphere scaled to 0,0,0 which would essentially remove it from consideration. Delete the object you had your button on to trigger all this and viola, your table is set up for the right number of players with the other garbo removed.

    If you would like clarification on how to perform any of the actions I described, lemme know

  5. #5
    Thanks for the advice!

    Just for an update: I decided to use a single save file and remove components if the Player is not seated. If anyone has a similar problem, this is what I ended up using...

    for i, v in ipairs(potentialPlayers) do
    if Player[v].seated == true then
    numberPlayers = numberPlayers + 1
    table.insert(tablePlayersOrder, numberPlayers, v)
    ~remove stuff~

    Also created a big list of GUIDs by player color, so it moves down the table zapping objects.

Similar Threads

  1. Changing the card back?
    By MarcusRaven in forum Scripting
    Replies: 5
    Last Post: 07-14-2017, 12:41 PM
  2. Changing the Background using Scripting
    By Mark in forum Scripting
    Replies: 0
    Last Post: 10-16-2016, 04:09 PM
  3. [ADDED] [v5.5] Number Markers
    By Ribonizer in forum Suggestions
    Replies: 8
    Last Post: 08-29-2015, 01:07 AM
  4. [SOLVED] Displayed number of Players in server exceeding limit
    By TheRaven81 in forum Technical Support
    Replies: 1
    Last Post: 08-17-2015, 03:56 PM
  5. [ADDED] [v5.0]Select the number of "Card Hands" based on players
    By BrashFink in forum Suggestions
    Replies: 2
    Last Post: 06-28-2015, 05:53 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts