• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Auto share jass script ?

Status
Not open for further replies.
Level 2
Joined
Aug 30, 2016
Messages
24
How to make a jass scripts to auto share for allies ?

i wanna add a jass line that auto shares for allies in my map

any ideas
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Can you be more specific? I'm not sure I understand what you mean.

Maybe this?
  • Player - For Player 2 (Blue), turn Shared vision On toward Player 1 (Red)
  • Player - For Player 2 (Blue), turn Shared units On toward Player 1 (Red)
This lets Player 1 see and control Player 2's units
 
Last edited:
Level 2
Joined
Aug 30, 2016
Messages
24
Can you be more specific? I'm not sure I understand what you mean.

Maybe this?
  • Player - For Player 2 (Blue), turn Shared vision On toward Player 1 (Red)
  • Player - For Player 2 (Blue), turn Shared units On toward Player 1 (Red)
This lets Player 1 see and control Player 2's units
i mean making a script in jasscraft to auto share if u press a key like for ex: press F5 allies get shared automatically
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
This is the functionality you're looking for...

  • ShareUnits
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
      • Player - Player 2
      • Player - Player 3 etc
    • Conditions
    • Actions
      • Set TempPlayer = (Triggering player)
      • Set TempForce = (All allies of TempPlayer)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ShareOn[(Player number of TempPlayer)] Equal to False
        • Then - Actions
          • Player Group - Pick every player in TempForce and do (Actions)
            • Loop - Actions
              • Set TempPlayer2 = (Picked player)
              • Player - For TempPlayer, turn Shared vision On toward TempPlayer2
              • Player - For TempPlayer, turn Shared units On toward TempPlayer2
          • Set ShareOn[(Player number of TempPlayer)] = True
        • Else - Actions
          • Player Group - Pick every player in TempForce and do (Actions)
            • Loop - Actions
              • Set TempPlayer2 = (Picked player)
              • Player - For TempPlayer, turn Shared vision Off toward TempPlayer2
              • Player - For TempPlayer, turn Shared units Off toward TempPlayer2
          • Set ShareOn[(Player number of TempPlayer)] = False
      • Custom script: call DestroyForce(udg_TempForce)
 
Level 2
Joined
Aug 30, 2016
Messages
24
the game i want to auto share for allies in is dota i think this will work thanks i will try it later
 
Status
Not open for further replies.
Top