• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Lock Selection for specific Players

Status
Not open for further replies.
Level 10
Joined
Jan 20, 2011
Messages
492
Hey guys, I'm trying to make a hero selection system, and I want to lock selection onto one unit which is the store you buy your heroes from, however I'm using the line

  • Game - Disable selection and deselection functionality (Enable selection circles)
  • Unit - Create 1 Hero Selection for (Picked player) at temploc facing Default building facing degrees
  • Selection - Select (Last created unit) for (Picked player)
and to my knowledge this disables everyones ability to select units, and I do not want that since another person may want to load a character, which will completely over look the character creation step.

So how do I disable selection for one particular player?

Thanks in advance.

  • Hero Selection Creator
    • Events
      • Dialog - A dialog button is clicked for CSDialog
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to CSDialogButton[1]
        • Then - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked player) controller) Equal to User
                  • ((Picked player) slot status) Equal to Is playing
                • Then - Actions
                  • Sound - Play InGameChatWhat1 <gen>
                  • Set temploc = (Center of Region 036 <gen>)
                  • Game - Disable selection and deselection functionality (Enable selection circles)
                  • Unit - Create 1 Hero Selection for (Picked player) at temploc facing Default building facing degrees
                  • Selection - Select (Last created unit) for (Picked player)
                  • Custom script: call RemoveLocation(udg_temploc)
                • Else - Actions
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: Type in your code b...
 
Level 10
Joined
Jan 20, 2011
Messages
492
try using GetLocalPlayer technique, I think you can achieve this by using that block.

Thanks I looked at your link and looked into the function more and came up with this:

  • Hero Selection Creator
    • Events
      • Dialog - A dialog button is clicked for CSDialog
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to CSDialogButton[1]
        • Then - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked player) controller) Equal to User
                  • ((Picked player) slot status) Equal to Is playing
                • Then - Actions
                  • Set Player = (Picked player)
                  • Custom script: if GetLocalPlayer() == udg_Player then
                  • Game - Disable selection and deselection functionality (Enable selection circles)
                  • Sound - Play InGameChatWhat1 <gen>
                  • Custom script: endif
                  • Set temploc = (Center of Region 036 <gen>)
                  • Unit - Create 1 Hero Selection for (Picked player) at temploc facing Default building facing degrees
                  • Selection - Select (Last created unit) for (Picked player)
                  • Custom script: call RemoveLocation(udg_temploc)
                • Else - Actions
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: Type in your code b...
Since I cannot test it for multiplayer currently since my friend is offline, does that trigger look like it would work for multiplayer? since I just tested it and worked fine singleplayer
 
Level 10
Joined
Jan 20, 2011
Messages
492
This should work as intended, I don't see flaws.
JNGP 2.0 allows your to use multiple instances of warcraft for easier multiplayer testings. Try it out, it's awesome and I use it to test triggers that involve GetLocalPlayer. :)

Thanks a heap BloodDrunk, I remember having a peak at JNGP 2.0 awhile ago, might give it a test now, since the need for it has come up.
 
Status
Not open for further replies.
Top