1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Player Disconnect Locals

Discussion in 'World Editor Help Zone' started by Radicool, Aug 28, 2014.

  1. Radicool

    Radicool

    Joined:
    Mar 27, 2011
    Messages:
    1,148
    Resources:
    4
    Maps:
    4
    Resources:
    4
    So I have a system which makes 1 shop for each player at the same spot. Only 1 shop can be seen per player (each player has their own shop). Each shop stacks on top of each other so they are all at the same location (the buildings are stacked on top of each other).

    Trigger:

    • Create Armories
      • Events
        • Map initialization
      • Conditions
      • Actions
        • Set TempPoint = (Center of Armory <gen>)
        • Player Group - Pick every player in ThePlayers and do (Actions)
          • Loop - Actions
            • Unit - Create 1 Armory for Player 9 (Gray) at TempPoint facing Default building facing degrees
            • Unit - Change color of (Last created unit) to (Color of (Picked player))
            • Neutral Building - Add Hero Upgrade to (Last created unit) with 1 in stock and a max stock of 1
            • Neutral Building - Add Marine Training to (Last created unit) with 1 in stock and a max stock of 1
            • Neutral Building - Add Reinforced Plating to (Last created unit) with 1 in stock and a max stock of 1
            • Neutral Building - Add Armored Unit Plating to (Last created unit) with 1 in stock and a max stock of 1
            • Neutral Building - Add Firearms to (Last created unit) with 1 in stock and a max stock of 1
            • Neutral Building - Add Energy Cells to (Last created unit) with 1 in stock and a max stock of 1
            • Neutral Building - Add Supply to (Last created unit) with 1 in stock and a max stock of 1
            • Unit - Hide (Last created unit)
            • Custom script: if GetLocalPlayer() == GetEnumPlayer() then
            • Unit - Unhide (Last created unit)
            • Custom script: endif
        • Custom script: call RemoveLocation (udg_TempPoint)


    When a player selects the shop, they are immediately disconnected from the game. Why is this and how do I fix it? Btw, I know next to nothing about locals and jass, so please baby me through it.
     
  2. GywGod133

    GywGod133

    Joined:
    Jul 16, 2012
    Messages:
    630
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    try to save the Picked Player in a variable

    if GetLocalPlayer() == TempPlayer then
     
  3. Radicool

    Radicool

    Joined:
    Mar 27, 2011
    Messages:
    1,148
    Resources:
    4
    Maps:
    4
    Resources:
    4
    As I said, I don't know much about jass or locals. Not sure how to do what your asking.

    After some research it seems you cannot locally use the "Hide Unit" action. The only thread I could find regarding locally hiding units is here: http://www.wc3c.net/showthread.php?p=1100333

    Is this true, some work-around perhaps?
     
  4. nhocklanhox6

    nhocklanhox6

    Joined:
    Feb 12, 2012
    Messages:
    335
    Resources:
    28
    Models:
    6
    Spells:
    21
    Tutorials:
    1
    Resources:
    28
    Using local player for this is risky. Instead of do that. Try this way:

    Step one: Create a fake shop unit
    Step two: Place all shop units to a secret location that nobody can't see.
    Step three: Try playing with some trick code.
    Step four: You're done!.

    Below is the demo map, which used for ONE hero per player with a safer method.
     

    Attached Files:

  5. shadowvzs

    shadowvzs

    Joined:
    Nov 13, 2006
    Messages:
    1,803
    Resources:
    2
    Spells:
    2
    Resources:
    2
    only jass what do u need is the
    if GetLocalPlayer() == udg_PlayerVar then
    normal trigger
    endif

    and u dont need hide the unit, if isnt building then just use animation vertex color opacity and make transparent, something like this:

    • Melee Initialization
      • Events
        • Map initialization
      • Conditions
      • Actions
        • For each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • Set PlayerVar = (Player((Integer A)))
            • Set PointVar = (Center of (Playable map area))
            • Set RealVar = 100.00
            • Unit - Create 1 Footman for PlayerVar at PointVar facing Default building facing degrees
            • Custom script: if GetLocalPlayer() == udg_PlayerVar then
            • Set RealVar = 0.00
            • Custom script: endif
            • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with RealVar% transparency
            • Custom script: call RemoveLocation (udg_PointVar)
     
  6. Mythic

    Mythic

    Media Manager

    Joined:
    Apr 24, 2012
    Messages:
    8,274
    Resources:
    144
    Models:
    122
    Icons:
    6
    Skins:
    1
    Maps:
    5
    Spells:
    6
    Reforged HD Icons:
    1
    Tutorials:
    3
    Resources:
    144
    Why are you hiding them locally anyways? :eek:

    Mind giving us the idea?
     
  7. Radicool

    Radicool

    Joined:
    Mar 27, 2011
    Messages:
    1,148
    Resources:
    4
    Maps:
    4
    Resources:
    4
    I'm so sorry, I forgot to reply to this thread to say I solved the problem using nhocklanhox6's method. I slightly altered your method to adapt it to my map, but it worked. In the end I decided against using a shop and switching to an upgrade building (player owned). Couldn't of figured this out without you. + rep.

    I'll explain my current system. I wanted to create a shared upgrade building for all players. Of course you can't do that so I thought I'd create 1 building for each player stacked on top of each other and hide all of them, allowing each player to only see their own and walla; seemingly there's only 1 upgrade shop. The idea was to save map space and improve visuals.

    I figured out locally hiding units causes desyncs so I used nhocklanhox6's method. I ended up giving each player their own upgrade center without a model (so it cant be seen) and hid the minimap display. A dummy research center was placed to give the appearance of 1 building. When a player selects the dummy center, they are automatically transferred selection to their own center.

    I implemented it into my map already and it appears to be working. Feel free to take a look:

    http://www.hiveworkshop.com/forums/maps-564/terran-base-defence-v37-224459/