System Unit Command System

Fluffball

Well-Known Member
Reaction score
35
Unit Command Spell

Ok, this is a system for a spell, that, when cast will order all units in a (500 + (Level of Upgrade x 100)) radius to attack move the point of the spell being cast. This is useful for a map that has many small units, that will be tiring to order around twelve by twelve. For this System, you will need:
-A Unit Commander unit.
-A Unit Command Ability (Base ability = Shockwave, with 99999 range, 0 damage, you know what i mean. No model, but you can change the caster art to whatever you want.
-A Unit Command Upgrade, which doesn't do anything, so set all the object editor fields to 0, except for the cost, upgrade time, etc, with as many levels as you want, but the more you have, the more the spell will select, and the more lag.
-2 TempPoint Point variables
-1 TempGroup Variable (If you tick automatically create new variables while pasting trigger data you won't need these.

Code:
Command Units
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Command Units 
    Actions
        Set Temp_Point2 = (Target point of ability being cast)
        Set Temp_Point = (Position of (Casting unit))
        Set Temp_Group = (Units within (500.00 + ((Real((Current research level of Command Units  for (Owner of (Casting unit))))) x 100.00)) of (Position of (Casting unit)))
        Unit Group - Remove (Casting unit) from Temp_Group
        Unit Group - Pick every unit in Temp_Group and do (Actions)
            Loop - Actions
                Unit - Order (Picked unit) to Attack-Move To Temp_Point2
        Custom script:   call RemoveLocation (udg_Temp_Point)
        Custom script:   call RemoveLocation (udg_Temp_Point2)
        Custom script:   call DestroyGroup (udg_Temp_Group)

This is 1 very simple trigger, Please PM me with any bugs (Shouldn't be any, as I have tested this a lot). Feedback, Thank-Yous and +rep are greatly appreciated.

View attachment Fluffball's Unit Commander System.zip
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> CommandUnitLevel

That variable isn't needed. Neither the "upgrade" trigger.
Use "player - current tech level of upgrade" instead...

You also leak a unit group and a point on every cast.
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
It could be better I think if you use group moving.
As in, the units stick to a formation when they move. :)
Just filter the commander unit out when you first add units to the group.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> use group moving.

Well, the idea is good, but there's a small problem there.
"Unit group - Order group to ..." has the same restriction as doing it yourself, i.e. 12 units max at once.
 

Fluffball

Well-Known Member
Reaction score
35
Will that unit group leak? It's only picking them, not putting them into a unit group.
 

Don

Rise with the Fallens!
Reaction score
52
Here is your trigger without leaks, just add the variable and custom text :D

Code:
Command Units
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Command Units 
    Actions
        Set Temp_Point = (Position of (Casting unit))
        Unit Group - Pick every unit in (Units within (500.00 + ((Real((Current research level of Improve your Command Units Spell  for (Owner of (Casting unit))))) x 100.00)) of Temp_Point) and do (Actions)
        Set Temp_Group = (picked unit)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Not equal to Unit Commander
                    Then - Actions
                        Unit - Order (Picked unit) to Attack-Move To (Target point of ability being cast)
                    Else - Actions
        Custom script:   call RemoveLocation (udg_Temp_Point)
        Custom script:   call DestroyGroup (udg_Temp_Group)

as easy as that!

PS. i'm not sure about the location of the ''set bla bla = to bla bla bla''
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
How exactly do you set a unit group to a picked unit?
Code:
        Unit Group - Pick every unit in (Units within (500.00 + ((Real((Current research level of Improve your Command Units Spell  for (Owner of (Casting unit))))) x 100.00)) of Temp_Point) and do (Actions)

That's your leaking line. You filter out units creating a new reference to these picked units. This reference is lost if not added to a variable then removed, hence called leak.

Edit:

You even added a point leak to the trigger:

Code:
(Target point of ability being cast)

Which will leak once for each unit picked in the unit group.
 

Fluffball

Well-Known Member
Reaction score
35
1.) Unit Group - Add (Picked Unit) to Unit_Commander unit group variable

And as for the point of ability being cast, i fixed that, making it a variable and removing it
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
@Acehart

Oooooh sorry, I thought the triggers would have magical powers and be able to move more :p
 

Anti-krazy

New Member
Reaction score
5
Hmm perhaps making unit variables for Casting unit, Target of Ability being cast and picked unit?
 

Fluffball

Well-Known Member
Reaction score
35
Bump

Sorry Romek, I thought I fixed that.... Maybe I forgot to save the new version and added the old file to the archive, then uploaded.
 

Romek

Super Moderator
Reaction score
964
Code:
Order (Picked unit) to Attack-Move To (Center of (Playable map area))

Center of map? Why?!
Anf that leaks anyway.

This is hardly a system too. It's more of a spell or a snippet.
 

Fluffball

Well-Known Member
Reaction score
35
Kk thanks for the feedback, will change to Spell (EDIT: even in Adavanced edit, i can't find a way to change the prefix) and will fix the center of map area bug.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    Happy Thursday!

      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