• 0

    posted a message on (Solved) Preventing units without attack command from moving when they recieve damage

    This one shold be a quickie, but you can never be sure!

    I have a unit similar to a High Templar in that it has no direct attack but can attack through spells and such. Is there a way to prevent it from moving when it is attacked by another unit? I figure it'd just be a simple flag but I can't find anything.

    Posted in: Data
  • 0

    posted a message on [Solved] Units created in cargo via trigger floating in the air upon unload

    Thanks a ton, Nerfpl. That works fantastically!

    Posted in: Data
  • 0

    posted a message on [Solved] Units created in cargo via trigger floating in the air upon unload

    When a unit recieves an order to move to the exact position it currently occupies, does it actually try to move for a single update or does it just ignore the command? I just need the created unit to move a single pixel or so once unloaded on the map to fix the bug.

    Posted in: Data
  • 0

    posted a message on [Solved] [Effects] Search effect that returns allied structures without a certain number of Buffs, Neutral/Enemy structures

    I ended up getting the result I wanted through an even more basic validation check:

    Valid Target IF
    	(Count of Buff A < 5) AND (Count of Buff B < 5)
    	OR
    	Target Is Neutral
    	OR
    	Target Is Enemy
    

    The reason this works is because, whenever a structure has 5 of one of the buffs it also has 0 of the other buff, and as such it is either under enemy control (always a valid target) or under secure allied control (never a valid target). When one of the buffs is less than 5, though, the structure is contested and therefore a valid target regardless of its current owner. I probably should have made it more clear how the two types of buffs interact with each other; in short, the structure can never have more than 5 buffs total, and adding one buff removes one of the opposing one.

    Thanks for the help! Even though I didn't use any of the suggestions, the clarification is always appreciated and helps me understand how things work in the data editor.

    Posted in: Data
  • 0

    posted a message on [Solved] [Effects] Search effect that returns allied structures without a certain number of Buffs, Neutral/Enemy structures

    Not having much luck validating ownership by a specific player. I may to take a different approach, then! I don't think I can do this one in triggers at all due to everything else that it interacts with, but maybe I can make a temporary buff appear on valid allied targets when the right conditions are met and the Issue Order effect just validates whether or not the target has that buff, or something along those lines.

    Posted in: Data
  • 0

    posted a message on [Solved] [Effects] Search effect that returns allied structures without a certain number of Buffs, Neutral/Enemy structures

    Hmm... is there a way to validate if the target is owned by a specific player? For example, could I say:

    (Owner of unit == 5)

    in a Validator? I know how to validate (Owner of unit == Ally / Enemy / Neutral / Player) but not a specific player. Is this possible?

    If it is, I think I can solve this problem. I wasn't entirely clear in my opening post; I am actually using two stackable behaviors here, each associated with a player, and when one stack reaches 5 the target flips to ownership of the player associated with it. To fix the bug I have, the validator check I need to be making is

    ( (target == [the specific player number for the first player]) AND (stacks [of behavior associated with that player] < 5) )
    OR
    ( (target == [the specific player number for the second player]) AND (stacks [of behavior associated with that player] < 5) )
    OR
    Target Is Neutral
    OR
    Target Is Enemy
    

    I am certain this will work, but I just need to figure out how to validate a specific player number.

    Posted in: Data
  • 0

    posted a message on [Solved] [Effects] Search effect that returns allied structures without a certain number of Buffs, Neutral/Enemy structures

    Yes, but I'm not sure where where that validator should be specifically. Should I put it in the Search Area effect, or the Issue Order effect? If it goes in the former, should I remove the existing filters and do the entire thing through a validation tree?

    Posted in: Data
  • 0

    posted a message on [Solved] [Effects] Search effect that returns allied structures without a certain number of Buffs, Neutral/Enemy structures

    I guess this question is more about how the Effects: Validators field works for a Search Area effect, but maybe I'm just looking at things the wrong way.

    I have a Search Area effect that currently returns a list of structures controlled by any player, sorted by distance. When a structure is found, the source of the effect is given an Issue Order effect that issues a move order targetting it. (I got this working a couple days ago thanks to the help of SC2Mapster!) This works fine, but I'd like to narrow the criteria so that the unit finds all neutral and enemy structures as well as allied structures with less than 5 stacks of a specific buff behavior.

    As things are now, my Search Area effect will return any structure but does not consider how many stacks of the buff are on allied structures. I'm validating the Issue Order effect with a Combine validator that checks if the target is allied and lacks the specific buffs, but it only appears to be yielding allied targets for the move command occasionally and arbitrarily, and even then certainly not based on the TSDistanceToTarget sort filter in the Search Area effect. Should I be doing validation somewhere else?

    edit: Sorry about my huge topic titles! I've been figuring they help other people looking for similar information find things more easily in search results, but if they're too disruptive do let me know.

    Posted in: Data
  • 0

    posted a message on [Solved] Units created in cargo via trigger floating in the air upon unload

    I may yet end up having to do this via trigger, by means of issuing a move order to the unloaded unit whenever an unload all command is used. A shame, but I don't see a way to fix it in data.

    Posted in: Data
  • 0

    posted a message on [Solved] Units created in cargo via trigger floating in the air upon unload

    This is just a cosmetic bug, but it's still very annoying and I'm quite frustrated at it!

    I have a trigger that creates units directly inside a flying transport's cargo. Whenever the transport unloads the units created, though, their actors float in the air until the unit is moved somehow, either by being bumped or being given an order. The unit is still considered ground pathable, so this is purely a visual bug.

    As the problem goes away as soon as the unit moves, I've tried giving the unit a starting behavior that gives it move orders to the source unit's location every 0.1 seconds. The behavior's removal field is validated by the Source Has No Orders validator discussed in a previous post; ideally, the unit should instantly perform a move order to its own location the moment it's unloaded, and then have the behavior removed.

    Unfortunately, this approach isn't working for me, so here I am again! As always, any suggestions on how to proceed would be greatly appreciated.

    Posted in: Data
  • 0

    posted a message on [Solved] [Validators] Behavior that issues an order only when the unit has no orders

    Thank you so much for your help!

    I tried changing all the uses of caster to source as you suggested, and nothing changed; I also tried moving your behavior directly to my map, and it still didn't work. This was pretty conclusive proof that there was something else wrong, so I checked where the behavior was being assigned...

    As it turns out, when I was assigning this behavior via trigger, I had named the source of the behavior as a different unit. This was what was producing the problem, as when I changed this to be the unit itself, everything worked as planned!

    Also, I really appreciate Dryeyce for helping to clear up my perpetual confusion with the Caster/Source/Target stuff on all Effect objects. I'll figure this out eventually!

    Posted in: Data
  • 0

    posted a message on [Solved] [Validators] Behavior that issues an order only when the unit has no orders

    Thanks for the advice!

    Both of those suggestions produced the same effect I have now: the unit constantly spams the order even when ordered to stop. This leads me to believe I'm doing something wrong somewhere else in the behavior. Maybe the period is too low? I have it at 0.1 seconds. I don't know if data validators are atomic, but it might be possible that the behavior is assigning the unit another order right before validator checks to see if it already has an order, which prevents it from disabling the behavior.

    Posted in: Data
  • 0

    posted a message on [Solved] [Validators] Behavior that issues an order only when the unit has no orders

    I'm back!

    I've made a behavior that periodically orders its owner unit to move to the nearest structure. The behavior uses a Search Area effect to periodically search for nearby structures and moves to the nearest one; the Search Area effect orders the unit to move to the found structure. All of this works fine.

    My problem is with the behavior's disable validator. I want the behavior to be disabled whenever the unit has orders, and enabled only when the unit has completed/is unable to complete and cancels its order (so the unit is ordered to move to the structure once, and then is not ordered again until it arrives there). I've tried using the Caster Has No Orders, but it doesn't appear to be working, as the unit continues to spam the same order even as it moves to its destination. Is there a better validator I should use for this?

    Thanks in advance for any suggestions!

    Posted in: Data
  • 0

    posted a message on [Solved] Error regarding saving the target of a load ability in a variable

    Wow, cool! The wait thing worked. I'd tried something similar earlier but had no results, which probably means I screwed it up somewhere that time. Oh well!

    Thanks for the help!

    Posted in: Triggers
  • 0

    posted a message on [Solved] Error regarding saving the target of a load ability in a variable

    I've done a bit more testing and I've managed to avoid getting an error by replacing the problem line with this line:

    Variable - Set cargo unit = (Unit 1 from (Cargo units in (Triggering unit)))
    

    However I've been watching the variable in the debug window and it never changes in value from null. This leads me to believe that the trigger executes after the ability finishes but before the unit is actually placed into cargo. I've tried changing the event ability stage around but I get the same results or worse with other options.

    Posted in: Triggers
  • To post a comment, please or register a new account.