• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Restrict Sharing Units

Status
Not open for further replies.
Level 9
Joined
May 21, 2014
Messages
580
  • Test Trigger
    • Events
      • Player - Player 1 (Red) changes alliance settings
    • Conditions
    • Actions
      • Player Group - Make Player Group - Player 1 (Red) treat (All players) as an Ally with shared vision
Sharing units is changing aspect of alliance as far as I know.
But this would cause to still a message that the player shared units. Maybe change that message into "You cannot share units" or something.
 
Level 9
Joined
May 21, 2014
Messages
580
  • Test Trigger
    • Events
      • Player - Player 1 (Red) changes alliance settings
    • Conditions
    • Actions
      • Player Group - Make Player Group - Player 1 (Red) treat (All players) as an Ally with shared vision
Sharing units is changing aspect of alliance as far as I know.
But this would cause to still a message that the player shared units. Maybe change that message into "You cannot share units" or something.

So far with my tests as SOLO / with Computer (Normal), this doesn't work.
It's hard to tell with Computer AI since it auto-unchecks. I don't know how to check my trigger if it'll work.
 
Level 9
Joined
Apr 23, 2011
Messages
527
I need a way to either make players unable to check share units box, or if it's impossible, to automaticly unshare units when they're shared.

i don't believe you can disable the share units box, so try using this
  • antishare
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to 12, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Integer A) Not equal to (Integer B)
                • Then - Actions
                  • Player - Make (Player((Integer A))) treat (Player((Integer B))) as an Ally with shared vision
                • Else - Actions
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
Instead of doing that every second, use the event for changing of alliance settings.

  • Player - Player 1 (Red) changes Shared units settings
also you can just reset shared unit setting instead of all alliance settings.

  • Share 2
    • Events
      • Player - Player 1 (Red) changes Shared units settings
      • Player - Player 2 (Blue) changes Shared units settings
      • Player - Player 3 (Teal) changes Shared units settings
      • Player - Player 4 (Purple) changes Shared units settings
      • Player - Player 5 (Yellow) changes Shared units settings
      • Player - Player 6 (Orange) changes Shared units settings
      • Player - Player 7 (Green) changes Shared units settings
      • Player - Player 8 (Pink) changes Shared units settings
      • Player - Player 9 (Gray) changes Shared units settings
      • Player - Player 10 (Light Blue) changes Shared units settings
      • Player - Player 11
      • Player - Player 12
    • Conditions
    • Actions
      • For each (Integer prointeger) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player(prointeger)) Not equal to (Triggering player)
            • Then - Actions
              • Player - For (Triggering player), turn Shared units Off toward (Player(prointeger))
            • Else - Actions

Edit:I suppose this little trigger makes it so that players don't see an info message when they change their alliance setting.
  • Share 1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game - Set Hide alliance changes to On
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
History repeats, it is working for me.

If you want to test single player, press ESC.

If you want to change share setting manually by hand(f11), test it from local multiplayer.
 

Attachments

  • Share Test.w3m
    16.9 KB · Views: 41

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,290
@Light : use two integer variable instead of Integer A/B, efficiency reason.
And yes, never use A and B integers, only udg's.
Oh please just stop with this already. If efficiency is a concern why even use GUI in the first place? This sort of constant advice really is not helpful when it has nothing at all to do with the problem at hand and will at most waste a few cycles.

I have no idea what the hell, i rven tried to it like in your map. BOOM! DOESN'T FUCKING RUN!
Your WC3 installation is corrupted? The map he provided opens in WE and tests perfectly for me. If it actually solves the problem I do not know.

I would like to add that disabling shared control is generally a bad idea. First it makes no difference against the AI since the AI will never use shared control units. Secondly in multiplayer it is a very useful feature because it allows people to AFK without completely becoming useless bricks. The number of times in an RPG game someone shared control with me while he took a short break so I could keep moving him around with me is numerous. In RTS games some people also needed a break and shared control so I could fix any problems while they were gone. Shared control should only be disabled if it causes serious game bugs (which it really never should).

The method used by Ceday looks sound to me, however I did not run a multiplayer test for obvious reasons. In multiplayer it may be possible that net traffic allows for a brief period of shared control. It is also possible the event fires before the actual alliance change so that the change fails as it is overwritten by the original change as soon as the trigger action returns. If the problem is indeed an ordering one then a 0 timeout timer could be used to fix it.
 
Level 18
Joined
May 11, 2012
Messages
2,108
f efficiency is a concern why even use GUI in the first place?
Because it's easier to learn? :D
It is also possible the event fires before the actual alliance change so that the change fails as it is overwritten by the original change as soon as the trigger action returns. If the problem is indeed an ordering one then a 0 timeout timer could be used to fix it.
I suspect this could be solution, too. I will try that when I get to Pc. :)
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
Is it possible to share your map?I made this trigger for someone else and it was working at that time.

Edit:Well, when all hopes are gone try this.


  • Share Kapa 2
    • Events
      • Player - Player 1 (Red) changes Shared units settings
      • Player - Player 2 (Blue) changes Shared units settings
      • Player - Player 3 (Teal) changes Shared units settings
      • Player - Player 4 (Purple) changes Shared units settings
      • Player - Player 5 (Yellow) changes Shared units settings
      • Player - Player 6 (Orange) changes Shared units settings
      • Player - Player 7 (Green) changes Shared units settings
      • Player - Player 8 (Pink) changes Shared units settings
      • Player - Player 9 (Gray) changes Shared units settings
      • Player - Player 10 (Light Blue) changes Shared units settings
      • Player - Player 11 (Dark Green) changes Shared units settings
      • Player - Player 12 (Brown) changes Shared units settings
    • Conditions
    • Actions
      • -------- Optional: Wait 0.00 seconds. --------
      • -------- But I don't think it is neccesary --------
      • -------- I can even link you a map which uses this trigger without a delay and it is working--------
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to 12, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Integer A) Not equal to (Integer B)
                • Then - Actions
                  • Player - For (Player((Integer A))), turn Shared units Off toward (Player((Integer B)))
                • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top