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: 305
  • UES v1.00b.w3x
    22.5 KB · Views: 265

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.
  • 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 The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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