Results 1 to 6 of 6

Thread: Issues With Buttons: Player Hands and Flipping

  1. #1

    Issues With Buttons: Player Hands and Flipping

    Since currently TTS does not have support for modifying an object's context menu, one way to provide object functionality is to use buttons. Buttons can be created on objects and can provide access to object related functions.

    However, when an object with buttons is placed in a player's hand, the card becomes unknown to other players but the buttons do not. This means that if different cards have different options (i.e. different buttons based on the card), as might be the case in a game like Magic The Gathering, the buttons that show up while the card in is a player's hand could help narrow down the content of the card for other players.

    Is there a way to make buttons visible to all when no one has ownership of the parent card but display only to the card owner when a player holds the parent card in his/her hand?

    Also I noticed there is no onFlipped event in the API (at least not documented as far as I can see) but the Y parameter of the button's position is in relation to the face up side of a card. This means that if the button uses a positive Y value (for example, to allow the buttons to hover over the card) the buttons disappear into the table when the card is flipped. However, there is no onFlipped event that can be captured to allow a script to compensate for this (i.e. reposition the button).

  2. #2
    Join Date
    May 2016
    Well, there is no way to make buttons appear for only some people. I only have 2 solutions. 1, a button board in a hidden zone which has the buttons for cards appear on it. This would be challenging. Two, just put a hidden zone over people's hands and use a counter to indicate how many cards they have for the other player.

    You could also ready the rotation for the card to determine if it is face up or face down. When face up, the Pitch, Roll, or Yaw will be consistently 0 or 180. You could just have timers checking every 1 second or something to see if a card was face up or face down and create/remove buttons accordingly.

  3. #3
    Interesting options. I like option 1 better because it will make player hands still look nice. If I make the hidden area parallel to the player hand area, I should be able to make the button appear in a slight offset to the card and this should push it into the hidden zone.

    The timer solution for the facing is doable but I hate to use such tactics...if the frequency is too often you get poor performance...if the frequency is too small then when a card is flipped it will take a while for the buttons to compensate. Hmm...I wonder if a flip causes a onPickup and onDropped...probably not, eh? I should give it a try just in case.

  4. #4
    Join Date
    May 2016
    Just to add, in case it impacts you plan, I do not think buttons turn invisible if they enter a hidden zone. I think they turn invisible if the object they are tied to enters a hidden zone. Test it out to check!

  5. #5
    Join Date
    Mar 2016
    I have a mod (Hunt for Red October) that uses hidden zones (manipulated with scripting) and buttons on objects (in my case, in cards) that are dynamically created and updated through the game phases. I can tell you that when you create new buttons on an object, move/scale a hidden zone, and drop those objects into the hidden zone, the buttons do not (always) remain hidden. I haven't been able to find the "trick" to preventing this, and it still happens in the mod depending on the size, location and timing of the things I mentioned above.

  6. #6
    Is it possible that the button offset is sometimes making the button be outside the hidden area even though the card (i.e. dropping the card near the edge of the hidden area) and sometimes not (i.e. dropping the card in the middle of the hidden area)?

    I found, related to player hands (not hidden areas), that if two player areas are side by side, close to each other (but not touching or overlapping) the automatic hand adjustment can cause the first card in player hand B to be captured by player hand A when the player hand B is re-arranged. Maybe something similar is happening with your buttons. When the card is dropped too close to the hidden area edge, the button offset could be placing the button outside the hidden area (and thus causing it to be visible) while cards that are placed in the middle of the hand area, even if the button offset, the button remains in the hidden area and thus is hidden.

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