Snippet Unit Exchange System

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Unit Exchange System
By Gtam

This is a nice system that would fit maps like Footman Wars, Footman Frenzy or any map with lagre armies.

What is made from:

Blood, Sweat and tears
GUI
MUI
Jass Snippet made by Rainther.( not Released)
And Some help by Yoshi.

What This system does is allows people to select a group of their units and give it to another player.
This system will not allow the the user to give away Heroes.
When the player types -Switch this systen will display the units he has selected and how many of each type thats selected. After that it will set a boolean to true allowing him to switch the next time he types
Then he types e.g. -Switch 2 then this system will give the selected untis to player 2.

Trigger:
  • Exchange
    • Events
      • Player - Player 1 (Red) types a chat message containing - as A substring
      • Player - Player 2 (Blue) types a chat message containing - as A substring
      • Player - Player 3 (Teal) types a chat message containing - as A substring
      • Player - Player 4 (Purple) types a chat message containing - as A substring
      • Player - Player 5 (Yellow) types a chat message containing - as A substring
      • Player - Player 6 (Orange) types a chat message containing - as A substring
      • Player - Player 7 (Green) types a chat message containing - as A substring
      • Player - Player 8 (Pink) types a chat message containing - as A substring
      • Player - Player 9 (Gray) types a chat message containing - as A substring
      • Player - Player 10 (Light Blue) types a chat message containing - as A substring
      • Player - Player 11 (Dark Green) types a chat message containing - as A substring
      • Player - Player 12 (Brown) types a chat message containing - as A substring
    • Conditions
    • Actions
      • Set Selected_G = (Units currently selected by (Triggering player))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 2, 7)) Equal to Switch
        • Then - Actions
          • Unit Group - Pick every unit in Selected_G and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Picked unit) is A Hero) Equal to True
                • Then - Actions
                  • Unit Group - Remove (Picked unit) from Selected_G
                  • Game - Display to (All players) the text: |cffff0000No Heroes...
                  • Skip remaining actions
                • Else - Actions
                  • Set Exchange[(Player number of (Triggering player))] = True
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • HeIsSure[(Player number of (Triggering player))] Equal to False
                      • Exchange[(Player number of (Triggering player))] Equal to True
                    • Then - Actions
                      • Custom script: call UnitCount(udg_Selected_G, GetTriggerPlayer())
                      • Set HeIsSure[(Player number of (Triggering player))] = True
                    • Else - Actions
                      • Unit Group - Pick every unit in Selected_G and do (Actions)
                        • Loop - Actions
                          • Unit - Change ownership of (Picked unit) to (Player((Integer((Substring((Entered chat string), 8, 10)))))) and Change color
                          • Set HeIsSure[(Player number of (Triggering player))] = False
                          • Set Exchange[(Player number of (Triggering player))] = False
          • Custom script: call DestroyGroup(udg_Selected_G)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Entered chat string) Equal to -DontSwitch
              • Exchange[(Player number of (Triggering player))] Equal to True
              • HeIsSure[(Player number of (Triggering player))] Equal to True
            • Then - Actions
              • Set Exchange[(Player number of (Triggering player))] = False
              • Set HeIsSure[(Player number of (Triggering player))] = False
            • Else - Actions


Credits to:
Rainther for snippet
Yoshi for trigger help

Credits is not needed when system used.

Code:
Changelog
v1.00 Released
v1.00b Leak Fix
 

Attachments

  • UES v1.00.w3x
    22.4 KB · Views: 304
  • UES v1.00b.w3x
    22.5 KB · Views: 264

Romek

Super Moderator
Reaction score
964
Credits to:
Rainther for snippet
Yoshi for trigger help
So, you didn't make this?
 

Romek

Super Moderator
Reaction score
964
How exactly did you contribute to the snippet?

(It's difficult to believe that a 3-man-team was needed to make something like this).
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
OK Rainther did the Jass part and Yoshi helped in my triggering problem
 

Romek

Super Moderator
Reaction score
964
There is no JASS part..?
And you haven't given particularly much detail about how he helped you.
 

Rainther

I guess I should write something of value here...
Reaction score
61
I recall it to be a function where you put in unit group and received back all the unit types in unit group and the amount of them aswell.
I didn't know you'd use it, however I am grateful for the credits. :D
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
There is a jass snippet Rainther created in the map tham my system uses hence the call UnitCount function
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
Looks like it leaks a unit group there as well.
 

Sevion

The DIY Ninja
Reaction score
413
Sec, would this allow me to easily exchange say 2000 units at a time. Doubtufl. Then again, I'm sure it'd lag anyways. And most pc's probablyt couldn't handle it. But I'm curious as to say what the maximum units transferable at a time is for this.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
yes its 12 since i couldnt think of a way to do more at a time
 

Sevion

The DIY Ninja
Reaction score
413
The way I'm doing it in Physics Wars, I can transfer 250+ units laglessly instantly at a time.

Which is needed for when players leave or are defeated and still have units on the map. They get spread evenly through out the remaining team.

And with a max of 250 units, that's 250*6=1500 units a a time on the map maximum + hidden units for interface etc.

This method that you use would make it impossible for me to do that.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
this is made for during the game not when a player leaves. This is made for if you see you ally was just attacked and need some units you can give him yours.
 

emolilolee

New Member
Reaction score
1
I'd tried this out, am sure I did it totally right but it gives an error at
call UnitCount(udg_Selected_G, GetTriggerPlayer()) :confused:
 

Komaqtion

You can change this now in User CP.
Reaction score
469
You should move leakfix out side the whole "If" ... As it's supposed to be destryed, even if the condition's aren't met, since it's created without them being met...

Trigger:
  • Custom script: call DestroyGroup(udg_Selected_G)


That's what I'm talking about...
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
emolily did you also copy the map header part dont think so. Other wise that error wouldnt occur so go look im my maps header and copy that code to yours
 

Tru_Power22

You can change this now in User CP.
Reaction score
144
The way I'm doing it in Physics Wars, I can transfer 250+ units laglessly instantly at a time.

Which is needed for when players leave or are defeated and still have units on the map. They get spread evenly through out the remaining team.

And with a max of 250 units, that's 250*6=1500 units a a time on the map maximum + hidden units for interface etc.

This method that you use would make it impossible for me to do that.

I;m pretty sure your map is going to break the warcraft 3 engine. I find it works poorly when you start getting near 400 units.
 

Sevion

The DIY Ninja
Reaction score
413
Actually, no one I've tested with has been able to run the map :| Only me. Everyone else gets white screen and lags insanely XD

Anywho, this system is not really useful IMO. :-/
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top