Mastermind Tank System V1.20

This bundle is marked as approved. It works and satisfies the submission rules.
A system I've had lying on my computer for months (at least since 6 months) awaiting the completion of the mastermind tank model (created by misha) as a request by him to create a system to allow the mastermind tank to function like a proper mastermind tank from RA2 and is meant to be used with the mastermind tank model, but it not restricted to this.

Done in Gui for simplicity for people who don't understand JASS and out of laziness to not remake it.

I turned the test map into a minigame (for no real reason other than for the hell of it)


  • Setup
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • -------- Creates the hashtable --------
      • Hashtable - Create a hashtable
      • -------- Sets the variable to the hashtable --------
      • Set Mind_Control_Hash = (Last created hashtable)
      • -------- Damage for having more than max units controlled --------
      • -------- As a base --------
      • -------- for every other unit over the limit, 1 more damage will be added --------
      • Set Config[1] = 10.00
      • -------- Max number of units --------
      • -------- There should not be decimals used in this number. --------
      • Set Config[2] = 3.00
      • -------- Mind Control AOE --------
      • Set Config[3] = 600.00
  • Mind Control
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- Picks all units which are currantly under control of a mastermind tank --------
      • Unit Group - Pick every unit in Mind_Controlled and do (Actions)
        • Loop - Actions
          • -------- Gets the picked unit --------
          • Set Temp_Unit = (Picked unit)
          • -------- Gets the picked unit --------
          • Set Temp_UnitID = (Key (Picked unit))
          • -------- Checks to see if the unit is alive and then begins actions depending on the result --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Temp_Unit is alive) Equal to True
            • Then - Actions
              • -------- Sets the variable to the location of the corresponding Mastermind Tank --------
              • Set Temp_Point[1] = (Position of (Load 2 of Temp_UnitID in Mind_Control_Hash))
              • -------- This is what creates the visible bond --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 7777 of Temp_UnitID from Mind_Control_Hash) Equal to 8
                • Then - Actions
                  • -------- Above is an mui wait condition --------
                  • -------- Resets the wait --------
                  • Hashtable - Save 0 as 7777 of Temp_UnitID in Mind_Control_Hash
                  • -------- Creates the dummy unit --------
                  • Unit - Create 1 Attack dummy for (Owner of Temp_Unit) at Temp_Point[1] facing Default building facing degrees
                  • -------- Makes the dummy unit temporary --------
                  • Unit - Add a 0.80 second Generic expiration timer to (Last created unit)
                  • -------- Orders the unit to attack, this creates the 'chain' --------
                  • Unit - Order (Last created unit) to Attack Temp_Unit
                • Else - Actions
                  • -------- Increases the wait time --------
                  • Hashtable - Save ((Load 7777 of Temp_UnitID from (Last created hashtable)) + 1) as 7777 of Temp_UnitID in Mind_Control_Hash
              • -------- Removes a location leak --------
              • Custom script: call RemoveLocation (udg_Temp_Point[1])
            • Else - Actions
              • -------- Decreases the amount of controlled units by 1 --------
              • Hashtable - Save ((Load 10 of Temp_UnitID from Mind_Control_Hash) - 1.00) as 10 of (Load 2 of Temp_UnitID from Mind_Control_Hash) in Mind_Control_Hash
              • -------- Removes the unit from the unit group --------
              • Unit Group - Remove Temp_Unit from Mind_Controlled
              • -------- Returns ownership to the original owner --------
              • Unit - Change ownership of Temp_Unit to (Load 1 of Temp_UnitID in Mind_Control_Hash) and Change color
      • -------- Picks all Mastermind Tanks --------
      • Unit Group - Pick every unit in Mastermind_Tanks and do (Actions)
        • Loop - Actions
          • -------- Gets the picked unit --------
          • Set Temp_Unit = (Picked unit)
          • -------- Gets the picked unit --------
          • Set Temp_UnitID = (Key (Picked unit))
          • -------- Checks wether or not the Mastermind Tank is overloaded --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 10 of Temp_UnitID from Mind_Control_Hash) Greater than Config[2]
            • Then - Actions
              • -------- Uses an mui wait to create delays between damage --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 7778 of Temp_UnitID from Mind_Control_Hash) Equal to 33
                • Then - Actions
                  • -------- Above is an mui wait condition --------
                  • -------- Resets the wait --------
                  • Hashtable - Save 0 as 7778 of Temp_UnitID in Mind_Control_Hash
                  • -------- Damages the Mastermind Tank --------
                  • Unit - Cause Temp_Unit to damage Temp_Unit, dealing ((Config[1] + ((Load 10 of Temp_UnitID from Mind_Control_Hash) - Config[2])) x 1.00) damage of attack type Spells and damage type Normal
                  • -------- Causes the unit to use it's overload animation, if the unit doesn't have this animation, remove it --------
                  • Animation - Play Temp_Unit's stand hit animation
                • Else - Actions
                  • -------- Increases the wait time --------
                  • Hashtable - Save ((Load 7778 of Temp_UnitID from Mind_Control_Hash) + 1) as 7778 of Temp_UnitID in Mind_Control_Hash
            • Else - Actions
          • -------- Checks wether or not the Mastermind Tank is under 4 controlled units --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 10 of Temp_UnitID from Mind_Control_Hash) Less than or equal to Config[2]
            • Then - Actions
              • -------- Allows the warning to go off again when the mastermind overloads --------
              • Hashtable - Save 0.00 as 50 of Temp_UnitID in Mind_Control_Hash
            • Else - Actions
          • -------- Checks wether or not the Mastermind Tank is dead or not then runs actions depending on the result --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is dead) Equal to True
            • Then - Actions
              • -------- Checks to see if the following actions have been done before for this particular tank --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 20 of Temp_UnitID from Mind_Control_Hash) Equal to 0
                • Then - Actions
                  • -------- Sets the value to 1 so that these actions are not run again for this partiular tank --------
                  • Hashtable - Save 1 as 20 of Temp_UnitID in Mind_Control_Hash
                  • -------- Sets the variable to the location of the tank --------
                  • Set Temp_Point[2] = (Position of Temp_Unit)
                  • -------- Plays a 'release' sound --------
                  • Sound - Play HolyBolt <gen> at 100.00% volume, located at Temp_Point[2] with Z offset 0.00
                  • -------- Plays the units death animation --------
                  • Animation - Play Temp_Unit's death animation
                  • -------- Removes th tank from the group so that the dead animation works properly --------
                  • Unit Group - Remove Temp_Unit from Mastermind_Tanks
                  • -------- Removes the location leak --------
                  • Custom script: call RemoveLocation (udg_Temp_Point[2])
                • Else - Actions
              • -------- Sets the Temp_Group to the corresponding controlled units --------
              • Set Temp_Group[3] = (Units in (Playable map area) matching ((Load 2 of (Key (Matching unit)) in Mind_Control_Hash) Equal to (Picked unit)))
              • -------- Picks the units in the Temp_Group --------
              • Unit Group - Pick every unit in Temp_Group[3] and do (Actions)
                • Loop - Actions
                  • -------- Gets the picked unit --------
                  • Set Temp_Unit = (Picked unit)
                  • -------- Gets the picked unit --------
                  • Set Temp_UnitID = (Key (Picked unit))
                  • -------- Frees the controlled units to be controlled by a new mastermind --------
                  • Hashtable - Save 0 as 5 of Temp_UnitID in Mind_Control_Hash
                  • -------- Removes the units from the mindcontrolled group --------
                  • Unit Group - Remove Temp_Unit from Mind_Controlled
                  • -------- Returns ownership to the original owner --------
                  • Unit - Change ownership of Temp_Unit to (Load 1 of Temp_UnitID in Mind_Control_Hash) and Change color
              • -------- Removes from the current mastermind tanks group --------
              • Unit Group - Remove Temp_Unit from Mastermind_Tanks
              • -------- Clears the unit group leak --------
              • Custom script: call DestroyGroup (udg_Temp_Group[3])
            • Else - Actions
      • -------- Sets the Temp_Group to all masterminds --------
      • Set Temp_Group[1] = (Units in (Playable map area) matching (((Level of Mind Control for (Matching unit)) Greater than 0) and (((Matching unit) is alive) Equal to True)))
      • -------- Picks the units in the Temp_Group --------
      • Unit Group - Pick every unit in Temp_Group[1] and do (Actions)
        • Loop - Actions
          • -------- Gets the picked unit --------
          • Set Temp_Unit = (Picked unit)
          • -------- Gets the picked unit --------
          • Set Temp_UnitID = (Key (Picked unit))
          • -------- If the tank is not within the Mastermind group this will add it to it. --------
          • If ((Temp_Unit is in Mastermind_Tanks) Equal to False) then do (Unit Group - Add Temp_Unit to Mastermind_Tanks) else do (Do nothing)
          • -------- Sets the handle to the tank --------
          • Set Mastermind_Tank = (Picked unit)
          • -------- Sets the unit variable to the tank --------
          • Set Mind_Control_Tank_Unit = Temp_Unit
          • -------- Sets the variable to the location of the tank --------
          • Set Temp_Point[1] = (Position of Temp_Unit)
          • -------- Sets units which are allowed to be taken control of and adds them to the Temp Group --------
          • Set Temp_Group[2] = (Units within Config[3] of Temp_Point[1] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A Hero) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner
          • -------- Removes the location leak --------
          • Custom script: call RemoveLocation (udg_Temp_Point[1])
          • -------- Picks the units in the Temp Group --------
          • Unit Group - Pick every unit in Temp_Group[2] and do (Actions)
            • Loop - Actions
              • -------- Gets the picked unit --------
              • Set Temp_Unit = (Picked unit)
              • -------- Gets the picked unit --------
              • Set Temp_UnitID = (Key (Picked unit))
              • -------- Makes the unit unavailable for another Mastermind Tank to capture --------
              • Hashtable - Save 1 as 5 of Temp_UnitID in Mind_Control_Hash
              • -------- Increases the total amount of units controlled by the particular mastermind Tank --------
              • Hashtable - Save ((Load 10 of (Key Mastermind_Tank) from Mind_Control_Hash) + 1.00) as 10 of (Key Mastermind_Tank) in Mind_Control_Hash
              • -------- adds the unit to the mind controlled group --------
              • Unit Group - Add Temp_Unit to Mind_Controlled
              • -------- Saves the player of the original owner --------
              • Hashtable - Save Handle Of(Owner of Temp_Unit) as 1 of Temp_UnitID in Mind_Control_Hash
              • -------- Links the two units together --------
              • Hashtable - Save Handle OfMind_Control_Tank_Unit as 2 of Temp_UnitID in Mind_Control_Hash
              • -------- Changes the owner of the unit to the owner of the mastermind Tank --------
              • Unit - Change ownership of Temp_Unit to (Owner of Mind_Control_Tank_Unit) and Change color
              • -------- Sets the variable to the location of the corresponding Mastermind Tank --------
              • Set Temp_Point[1] = (Position of (Load 2 of Temp_UnitID in Mind_Control_Hash))
              • -------- This is what creates the visible bond --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 7777 of Temp_UnitID from Mind_Control_Hash) Equal to 8
                • Then - Actions
                  • -------- Above is an mui wait condition --------
                  • -------- Resets the wait --------
                  • Hashtable - Save 0 as 7777 of Temp_UnitID in Mind_Control_Hash
                  • -------- Creates the dummy unit --------
                  • Unit - Create 1 Attack dummy for (Owner of Temp_Unit) at Temp_Point[1] facing Default building facing degrees
                  • -------- Makes the dummy unit temporary --------
                  • Unit - Add a 0.80 second Generic expiration timer to (Last created unit)
                  • -------- Orders the unit to attack, this creates the 'chain' --------
                  • Unit - Order (Last created unit) to Attack (Picked unit)
                • Else - Actions
                  • -------- Increases the wait time --------
                  • Hashtable - Save ((Load 7777 of Temp_UnitID from Mind_Control_Hash) + 1) as 7777 of Temp_UnitID in Mind_Control_Hash
              • -------- Saves the lightning effect so it can be destroyed later --------
              • Hashtable - Save Handle Of(Last created lightning effect) as 3 of Temp_UnitID in Mind_Control_Hash
              • -------- Removes a location leak --------
              • Custom script: call RemoveLocation (udg_Temp_Point[1])
              • -------- Checks to see if the Mastermind tank is overloading --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 10 of (Key Mastermind_Tank) from Mind_Control_Hash) Greater than Config[2]
                  • (Load 50 of (Key Mastermind_Tank) from Mind_Control_Hash) Equal to 0.00
                • Then - Actions
                  • -------- Stops the warning going off again --------
                  • Hashtable - Save 1.00 as 50 of (Key Mastermind_Tank) in Mind_Control_Hash
                  • -------- Sets the variable to the location of the mastermind tank --------
                  • Set Temp_Point[2] = (Position of Mind_Control_Tank_Unit)
                  • -------- Plays an 'alarm' sound --------
                  • Sound - Play CreepAggroWhat1 <gen> at 100.00% volume, located at Temp_Point[2] with Z offset 0.00
                  • -------- Removes the location leak --------
                  • Custom script: call RemoveLocation (udg_Temp_Point[2])
                • Else - Actions
                  • -------- Sets the variable to the location of the mastermind tank --------
                  • Set Temp_Point[2] = (Position of (Picked unit))
                  • -------- Plays an 'Capture' sound --------
                  • Sound - Play AbsorbMana <gen> at 100.00% volume, located at Temp_Point[2] with Z offset 0.00
                  • -------- Removes the location leak --------
                  • Custom script: call RemoveLocation (udg_Temp_Point[2])
          • -------- Removes the unit group leak --------
          • Custom script: call DestroyGroup (udg_Temp_Group[2])
      • -------- Clears the leak generated by the unit group --------
      • Custom script: call DestroyGroup (udg_Temp_Group[1])



V1.0:
- Initial upload
V1.10:
- Removed useless functions
- Used variables to set picked units
- Removed the aura buff on the map-specific ability
V1.20:
- Changed the variable type of Temp_UnitID


Give credits if you use this system with your map, enjoy.

Link to Mastermind Tank model: http://www.hiveworkshop.com/forums/models-530/ra2-yr-mastermind-tank-191501/

AoE mind control (takes control of enemy units within a given proximity, but units can then leave this proximity)
Controlling more than 3 will cause overload damage as like RA2
The mastermin dies -> units released
Unit dies -> one less controlled.
Thats all there is to it really.

Keywords:
RA2, yuri, Master, mind, Mastermind, Diplomatic mission, Simpletons, mind control, Predictable.
Contents

Mastermind Tanks v1.20 (Map)

Reviews
14:50, 28th Jun 2011 Maker: Last created hashtable:(Load 7777 of (Key Temp_UnitID) from (Last created hashtable)) Equal to 8 Temp_UnitID should be an integer. Maker, v1.20, 14.07.2011 Changes made, approved.

Moderator

M

Moderator

14:50, 28th Jun 2011
Maker:
Last created hashtable:
  • (Load 7777 of (Key Temp_UnitID) from (Last created hashtable)) Equal to 8
Temp_UnitID should be an integer.

Maker, v1.20, 14.07.2011
Changes made, approved.
 

Tank-Commander

Spell Reviewer
Level 29
Joined
May 26, 2009
Messages
1,839
I would be able to reduce the lag from the sfx, but I'd require the creation of a specific missile with Ribbon effects to create the tail to be able to do it, however sinse this is not available at the current time, it's unavoidable without making the effect look terrible, as for running over, that was a game mechanic more than an ability, and can be done using immoliation alone, thus I don't think it'd be appropriate to add.

The lag though is purely caused by the amount of sfx on my computer I do not notice the effect of it when I control 20-30 units with a single mastermind tank
 
Level 36
Joined
Mar 6, 2006
Messages
9,243
You could use variables, store both of these and use them instead of calling GetEnumUnit() and GetHandleId() functions repeatedly.
  • Set unit = (Picked unit)
  • Custom script: set udg_ID = GetHandleId(udg_unit)
Loading stuff:
  • Set Temp_Point[1] = (Position of (Load 2 of ID in Mind_Control_Hash))
Whoopsie:
  • (Load 7777 of (Key (Picked unit)) from (Last created hashtable)) Equal to 8
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Load 10 of (Key Mastermind_Tank) from Mind_Control_Hash) Greater than Config[2]
          • (Load 50 of (Key Mastermind_Tank) from Mind_Control_Hash) Equal to 0.00
->
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Load 10 of (Key Mastermind_Tank) from Mind_Control_Hash) Greater than Config[2]
      • (Load 50 of (Key Mastermind_Tank) from Mind_Control_Hash) Equal to 0.00
This won't save "null" as the unit, the unit's handle will still remain there:
  • Hashtable - Save Handle OfNo unit as 2 of (Key (Picked unit)) in Mind_Control_Hash
 
Last edited:
Ah, nice to finally release this :D

Also, in RA2 the tank could run over troops and kill 'em. Perhaps you could add that? :p
mastermind tank in Yuri's Revenge would go around even an attack dog XD you mixed it up with other tanks that mow down all near them
I could have sworn that the mastermind was a tank with a giant brain on it...
yes, that is true, but concept, my model hides the brain under the TC dome, as the original YR unit looks
Hmm maybe add an ability to free all units. It kinda sucks if you control 4 units and see your Mastermind die slowly without having a chance to do anything against it.
In YR, Masterminds die when overloaded unless you send your units to be killed

EDIT: Mind removing the "mastermind presence" altogether? it lags and obstructs the vision of my model, lol ^^
EDIT2: if not, then at least remove the "aura"
 
Last edited:
Level 12
Joined
Jun 9, 2009
Messages
1,131
fail :(... 5/5 for this, i had same idea to do, and i was finishing it :d
EDIT: After long testing, map gets serious FPS Drop, and if anyone wants to make army of tanks, that would cause huge fps dropping, idea is great, but method isn't best, + bow doesn't works when tank or units are moving. But all in all gj again
 
Level 4
Joined
Feb 19, 2010
Messages
22
Nice i see it's nothing like it now, nice spell though it is exactly like the mastermind tank.

edit: i think i found a bug randomly a dummy will attack another mastermind without taking it over, also if i control 4 units force kill 1 the mastermind still takes damage every second or two, you might want to check this.
 
Last edited:

Kyrbi0

Arena Moderator
Level 36
Joined
Jul 29, 2008
Messages
8,803
Excellently-made, and I love a good over-powered master race Red Alert 2 reference. Masterminds were one of my favorite units. :p One question; may I edit this for my personal uses? I would love to implement this somewhere cool, but need to modify a couple of things.

I, too, ran into the issue described by Dangles20; once my Mastermind goes above 3 Mind-Controlled Targets, it takes damage from that point on until it dies (i.e. even killing off the extra ones doesn't stop it). This would be more of a problem for me, but I personally won't be using that aspect of it (if I have permission to edit).

Also, I think I'm going to quote this thread and Request an SFX for it; just too good/lag-saving/important to go without. :p

Again, good job, and thanks.
 

Tank-Commander

Spell Reviewer
Level 29
Joined
May 26, 2009
Messages
1,839
Certainly, you have permission to edit so long as this is credited and linked (if the map resource is on another site), and the new version is not redistributed as a new resource - I believe getting an appropriate ribbon effect model was attempted before but nobody took it up, but yes I agree with you whole-heartedly about it being lag saving, though I myself due to this being old have forgotten how you control the projectile frequency and such, I believe it's an attack from a dummy unit - can't remember if I ever made that attack homing or if there was some reason why I didn't, goodluck eitherway.
 

Kyrbi0

Arena Moderator
Level 36
Joined
Jul 29, 2008
Messages
8,803
Certainly, you have permission to edit so long as this is credited and linked (if the map resource is on another site), and the new version is not redistributed as a new resource - I believe getting an appropriate ribbon effect model was attempted before but nobody took it up, but yes I agree with you whole-heartedly about it being lag saving, though I myself due to this being old have forgotten how you control the projectile frequency and such, I believe it's an attack from a dummy unit - can't remember if I ever made that attack homing or if there was some reason why I didn't, goodluck eitherway.
Schweet! Thanks.

I'll have to see about that Ribbon. And yes, it appears you just used a Dummy Attacker with uber-Attack-Speed and that purple-arrow model to make an connected line... Once I get the ribbon, it shouldn't be an issue to make the attack speed much lower, to match the Tank's speed.

Actually, the way I'll be using it, a lot of my problems are already solved; as a "Mastermind Ward" for a Trollish hero, it can't move (just the target can), and it can't die (Ultimate ability), so the Overload damage not going away isn't an issue.

I'll let you know how this pans out. Thanks again!
 

Kyrbi0

Arena Moderator
Level 36
Joined
Jul 29, 2008
Messages
8,803
I am absolutely flabbergasted to realize my last post in this topic (& ostensibly the last time I thought about using this) was 4 years ago.

Here we are, then. I've finally (re)downloaded it, imported it into my map, did all the troubleshooting (it replaced all the instances of Dummy Attackers & Mind Control abilities with already-existing custom units/abilities in my map, lol)... And it works. It's great! I plan on doing the 'streamer missile' thing (though I'm still trying to decipher that section of the code, trying to make sure I don't break it; is there a reason the Dummy Attacker exists for 0.80 seconds?), but overall I'm pleased.

There is one thing, however:
It would be useful if there was a maximum range and maximum number of units controlled (as in it can only be used on X units at a time) in addition to the max units before damage.
I guess I just assumed that's what the Config variable in the Setup trigger was for... Unfortunately it's not. I cannot figure out how to hard-limit the number of mind-controlled units; for the purpose I am working towards, a stationary but destructible (don't know why 4-years-ago-Kyrbi0 thought it wasn't; it should be tough but destructible (well, wait, it is an Ultimate, maybe that's why...)) Ward that should only be able to mind control a certain number of target enemy units.

Unfortunately as it is, this 'Mind Control Ward' will simply keep snapping up nearby enemies. Whether or not it can die is besides the point.

Any help?

@Tank-Commander
 

Tank-Commander

Spell Reviewer
Level 29
Joined
May 26, 2009
Messages
1,839
The code was original built to specification which didn't have a hard limit for the mind controlled unit count - only a limit by which controlling more would deal damage, you'd have to add your own configurable for it and then when the code -would- add a new target compare it with the current number and if it's reached the max, don't add it pretty much only requires adding the configurable and an if-then-else, or additional condition when adding the targets
 

Kyrbi0

Arena Moderator
Level 36
Joined
Jul 29, 2008
Messages
8,803
The code was original built to specification which didn't have a hard limit for the mind controlled unit count - only a limit by which controlling more would deal damage, you'd have to add your own configurable for it and then when the code -would- add a new target compare it with the current number and if it's reached the max, don't add it pretty much only requires adding the configurable and an if-then-else, or additional condition when adding the targets
I'm gonna sit down for several minutes & try to parse this, but in the mean-time, I should ask the primary question: "How willing would you be to making those changes?" : )
 
Top