• 0

    posted a message on Attacking a neutral unit to accelerate it.

    @Berrala: Go

    Oh yeah, that is what was wrong. Don't know how I missed that so many times. So, in continuation of my galaxy editor learning process, now that I got that trigger to work I've scrapped it and I'm trying another method. Not really related, but it should be kind of cool if I get it working. I'm basically setting up an array of points around each cow and setting up functions to return a desirability value for each of these points based on said point's proximity to various positive (food, other cows) or negative (cowboy, zergling) units. The unit will then move to the most desirable point. If it works, this should allow much more freedom and adaptability, and will be more elegant than a different function for herd movement, fleeing, eating, etc. If you're interested, I'll let you know how it works out.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Attacking a neutral unit to accelerate it.

    The example you attached is pretty much exactly what I want. For some reason, I still can't get it to work in my map though. Maybe I made some change to the cow unit that's interrupting things?

    Edit: Got it working now! I think one of my conditions was calling for a triggering unit after I had changed the trigger to periodic event, though I can't find the error in the code below.

    Anyhow, here's the current version of my triggers:

    Flee2
        Events
            Timer - Every 0.3 seconds of Game Time
        Local Variables
            Cows = (Empty unit group) <Unit Group>
        Conditions
        Actions
            Unit Group - Add all units in (Any units in (Entire map) owned by player 9 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) to Cows
            Unit Group - Pick each unit in (Last created units) and do (Actions)
                Actions
                    Flee Action((Picked unit), Marine [87.95, 112.45])
    

    Then the Flee Action:

    Flee Action
        Options: Action
        Return Type: (None)
        Parameters
            Cow = No Unit <Unit>
            Agressor = No Unit <Unit>
        Grammar Text: Flee Action(Cow, Agressor)
        Hint Text: (None)
        Custom Script Code
        Local Variables
            PathingCost = 0 <Integer>
        Actions
            Variable - Set PathingCost = (Pathing cost between (Position of Cow) and ((Position of Cow) offset by 3.0 towards (Angle from (Position of Agressor) to (Position of Cow)) degrees))
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (Distance between (Position of Cow) and (Position of Agressor)) <= 7.0
                    PathingCost <= 8
                Then
                    Unit - Order Cow to ( Move targeting ((Position of Cow) offset by 3.0 towards (Angle from (Position of Agressor) to (Position of Cow)) degrees)) (Replace Existing Orders)
                    General - Wait 0.1 Game Time seconds
                Else
    
    Posted in: Miscellaneous Development
  • 0

    posted a message on Attacking a neutral unit to accelerate it.

    So this is what I hacked together, but it's still not working. Initially the trigger was timing out, so I added the tries counter and a quick .1 second wait for good measure. I see the trigger firing in the debugger, but my cows aren't moving (neither the passive ones nor the ones already in their herd routine). If you see any errors or have any ideas, I'd love to hear! My only thought is that maybe the pathing cost is in different units or on a different scale than the actual distance. I'll see what happens if the allowable pathing cost is a much larger number. Edit: I set the limit for pathing cost to 80 and still got nothing, so it doesn't seem like this is the problem.

        Events
            Unit - Any Unit Enters a distance of 6.0 from Marine [87.95, 112.45]
        Local Variables
            PathingCost = 0 <Integer>
            tries = 0 <Integer>
        Conditions
            (Owner of (Triggering unit)) == 9
        Actions
            General - While (Conditions) are true, do (Actions)
                Conditions
                    (Distance between (Position of (Triggering unit)) and (Position of Marine [87.95, 112.45])) <= 7.0
                    tries < 4
                Actions
                    Variable - Set PathingCost = (Pathing cost between (Position of (Triggering unit)) and ((Position of (Triggering unit)) offset by 3.0 towards (Angle from (Position of Marine [87.95, 112.45]) to (Position of (Triggering unit))) degrees))
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            PathingCost <= 5
                        Then
                            Unit - Order (Triggering unit) to ( Move targeting ((Position of (Triggering unit)) offset by 3.0 towards (Angle from (Position of Marine [87.95, 112.45]) to (Position of (Triggering unit))) degrees)) (Replace Existing Orders)
                            General - Wait 0.1 Game Time seconds
                        Else
                            Variable - Set tries = (tries + 1)
    
    Posted in: Miscellaneous Development
  • 0

    posted a message on Attacking a neutral unit to accelerate it.

    I had forgotten to disable the wander behavior, which was giving me problems. Looks like it's working now. I'm still having a little issue, though. Maybe somebody will have a creative way to deal with it. I'm trying to implement this behavior for a bunch of cows so that can be herded. If a unit is near the edge of a corral (or up against any other obstacle) the movement order will often be to a point outside of the corral. This means that rather than moving away from the attacker, the unit will take a potentially long path around the obstacle. I can think of two potential ways to get around this, but I don't really know how to do either of them. The first would be to somehow check the path to the selected point and see how long it is. If it's a certain amount longer than offset distance of the move order, the movement would be canceled. I can't seem to find any to return a pathing distance rather than an absolute distance thought. The other potential solution would be to use an ability other than move that would be set up so the unit would just move in a certain direction for a certain time, rather than move targeting a point, but I really have no idea how to go about this. (are there any abilities already like this?)

    Edit: Apparently there's a function that returns the pathing cost between two points. I'll see if I can get it to work and report back.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Attacking a neutral unit to accelerate it.

    So I'm having a similar problem. I have a trigger that's more or less exactly what Berrala wrote above (if attacked, move to point x amount from triggering unit, polar offset by angle between attacking unit and triggering unit). It's just not doing anything at all. My theory was that another movement-related trigger was messing with it, but on disabling those other triggers I still had the same problem.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Disappearing Textures in Editor

    Though I've been making slow but steady progress on figuring out the editor, I've encountered a few things that seem too frustrating to be merely sharp-learning-curve related. First, all my triggers disappeared. Luckily I had only made a couple basic things at that point (e.g. revealing the map and assigning some starting resources). Though those triggers seem to be lost forever, restarting the editor allowed me to rebuild the triggers (before the restart all the trigger-related menus were blank). This problem is, at least assuming it doesn't recur, fixed. I mention it because I wonder if it might be related to the other problem I'm having: all my terrain and button textures have disappeared. The map itself appears as totally black other than my one little builder man, and the units and doodads menus are filled with little blue and red squares. Not sure if this is relevant, but if I go to Map > Map Textures, the current texture set is listed as ZhakulDas (unknown) and the only option in the New Texture Set menu is Story Mode. Also, if I test the map, everything seems to function properly. All the textures and buttons work in game, just not in the editor. Anybody else have this problem or know how to fix it?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Calldown and Build

    @Spintherism: Go

    Well, I managed to get the ability to work, more or less, based on the calldownMULE ability, but there are still two issues. First, the animation is doubled. Two little canisters fall from the sky, one after the other. I tried changing the associated model to see which one might disappear, but neither did, it just added a dumpster in addition to the two canisters. Second, it would be nice to have a little shadow-type placement helper as is present in building buildings instead of the crosshair.

    Posted in: Data
  • 0

    posted a message on Calldown and Build

    Hey all, I apologize if a similar question has already been addressed. I did a search and found a lot of related things, but nothing that would answer my specific question. I'm Working on a Tower Defense type map. I'm trying to make a tower build via a calldown type ability. Ideally, the construction would be in two phases. On placing the tower, it would be dropped down in an unfinished state. The builder would then walk over to the building site and complete the tower. If this proves too complicated, I would be satisfied with simply dropping the tower in fully formed. I made a new ability based on the terran BuildDrop ability, but I can't get it to function properly (the command card button doesn't show up in game). In fact, I even tried giving the original builddrop ability to my guy with the default supply depot, and it still doesn't show up. Any advice?

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