Complex Trigger Problem

Phubar

Ultra Cool Member
Reaction score
30
To avoid comanding unit before whole group is selected add
-make triggering unit uncommandable
at the very start of selection group trigger and
-make triggering unit commandable
after the group selection is done.
 

Phubar

Ultra Cool Member
Reaction score
30
To instant select you need a function that gives the group where the unit is in (cant find it... you need a custom function)
Then you have to use "select group" base function and refer to the group (group in which the triggering unit is).
Siretu may help with this custom function, try to tell him to take a look at this discussion (if he does not alteady done it) :)
 

Dave312

Censored for your safe viewing
Reaction score
269
To instant select you need a function that gives the group where the unit is in (cant find it... you need a custom function)
You don't need a custom function. Just use the Selected Units function to get the currently selected units for that player.

I personally would be just using the Custom Value attribute on each unit to store which squad they belong to. Then when you need to select a squad, just cycle through all the units owned by that player and if the custom value matches the value from the unit selected, add that unit to the units selection. Should be pretty fast if a player doesn't have too many units in the game at once. I personally see data table as being quite slow but where this is actually true or not I don't know. Ofcourse this still won't solve your problem with the delay.
 

Kyuft

Member
Reaction score
11
I have a working system right now, with custom values, but it still has a delay. very short, but its still a delay...

-Kyuft:cool:
 

Phubar

Ultra Cool Member
Reaction score
30
Dave i was talking about another thing.
If you have 3 groups (A, B and C) when you select any unit the trigger will
-Select all unit in group (the one where the selected unit is)
So it will select A, B or C.
 

Dave312

Censored for your safe viewing
Reaction score
269
After some testing, it seems the delay comes from the time difference between the unit being physically selected in the game and available for orders and the Unit Selected event firing. In which case, you will never be able to remove the delay.

As Phubar suggested, you can stop a unit being quickly given orders which the rest of his squad doesn't receive by making the unit uncommandable. To get this to work correctly, each unit needs to be made uncommandable when they are create, and then when selected, make them commandable. If a player attempts to issue an order to quickly to the unit, then the player will receive a "Unit is Uncommadable" error.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Couldn't you make another trigger that runs when a unit is selected that checks if the amount of units selected by the triggering player == 1 and if so, orders all units in that unit's group to do the same thing.

I only skimmed throuh the thread so I might be missing some big parts of the problem.
 

Phubar

Ultra Cool Member
Reaction score
30
Siretu, the "problem" is that there is no function that selects or returns the group of a given unit.
Or i cant find it..
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
I'm not sure what you mean.

- Do you mean that there's no event that triggers when a unit is selected? There's the "Unit is Selected" event which should work.

- Do you mean that there's no way to get all the other units in Kyuft's own unit groups? There should be, how else can he select all of them when one is selected?

- Do you mean that there's no way to get all units selected by a player? Use the "Selected Units" function.

I think I'm missing the actual problem here.
 

Phubar

Ultra Cool Member
Reaction score
30
None of them :)
I mean im not able to do a thing like
myGroup= group of (myUnit)
ie
unit "mom" is in group "family", unit "carl" is in group "friends".
myGroup= group of (mom) will do myGroup=family
If i change mom with carl myGroup=friends.

Kyuft made a trigger for group selection but he asked to chsnge it.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
The reason there's no such action is that a unit can be in several unit groups at once. Kyuft doesn't want to use real unit groups iirc, because there's going to be potentially infinite amounts of unit groups.
 

Phubar

Ultra Cool Member
Reaction score
30
Kyuft has already a working set of triggers but he wants to change it becouse of:

I have found a new problem[...] I have realized that in the time it takes for the trigger to process all of the Actions, and select the rest of the squad (when a unit is selected), you can still command that single unit. I want to somehow make it so that the instant the unit is selected, the rest of the squad is selected, as if they are one big unit. [...] Does anybody have any clue how to make an instant, neat system like the one I have described?

So i think he has to keep his triggers as they are and find a way to bypass the problem of commanding a unit before the whole group is selected.
I suggested this (to add in the trigger triggered by "Unit is selected")

Add
-make triggering unit uncommandable
at the very start of "selection group trigger" and
-make triggering unit commandable
after the group selection is done.

Dave said that this can be source of some bugs but i dont understand why. I keep thinking about it but i dont see wrong things.
 

Phubar

Ultra Cool Member
Reaction score
30
Sry but i think that your trigger wont work if he selects 2 or more units (by selection box).
Btw he solved the "reselect a unit that is alredy selected" (using his or my solution, that are similar) and now has the problem that in the time gap between he selects a unit and the whole group is selected, he can order that unit to do something and of course the rest of the group wont take the order becouse it's not selected.
Am i wrong? :)

PS Kyuft can you post your map on the bnet? So we can test it and see how big is that delay.
 

Kyuft

Member
Reaction score
11
Guys, my system works, but I guess I'll just have to get used to the .02-.05 second delay that is slightly inconvenient. Thanks though!

-Kyuft:cool:
 

Kyuft

Member
Reaction score
11
I will upload it soon.

EDIT: Phubar, you have it exactly correct, however, using your solution, I can set the units invulnerable until all of the units in the squad are selected. I was just hoping that there wasn't a delay, because I want someone to be able to select the unit (and its squad) and move them instantly, rather than having to wait for the units to all be selected.

-Kyuft:cool:
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
I'm sorry, this is slightly frustrating. I might just be missing the point, but I am trying to suggest a way to fix the delay problem. That's what I'm trying to solve, nothing else.

It shouldn't be a problem if you select more units because I said to add a condition that checks that there's only one selected unit, so it excludes drag selecting several units.

Edit:

Here's what I'm talking about:
Trigger:
  • Single Unit order
    • Events
      • Unit - Any Unit is issued an order to Any Ability Command
    • Local Variables
      • DataValue = "" <String>
    • Conditions
      • (Number of Living units in (Selected units for player (Triggering player))) == 1
    • Actions
      • Variable - Set DataValue = (String((Custom value 0 of (Triggering unit))) with Any Precision decimal places)
      • Unit - Order all units in ("MarineSquad[" + lv_dataValue + "]" from the Global data table) to ((Ability command for (Triggering order))) (Replace Existing Orders)

So if you manage to select a unit and give it an order before it selects all units in the group, it automatically tells the group to do the same thing as you told the single unit. Is there any reason why this wont work?
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Good point. When I think about it, my solution has some problems. I think it'll cause an infinite loop. I suggest you try it out but remove the condition and turn off the trigger first and turn it on at the end.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      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