• 0

    posted a message on Pathing at Edge of Map.

    Is "Map - Map Bounds" what you are looking for?

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Trigger] Issuing an order to the last created unit 2 times.

    It's impossible to add both of the orders immediately (even in a queue) since a burrowed unit can't be ordered to move (and it's still burrowed when the game tries to issue the order). Using shift does not take into account any changes that have been ordered previously.

    Comparison, you can't tell a viking to morph to flying and back to ground in a queue since the ground viking does not have the morph to ground ability.

    I ended up simply doing a small wait, like RageQit said, and then ordering it to attack or move or whatever when I ran into this problem.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Is it bad to use a while loop without any wait?
    Quote from Berrala: Go

    ...or you could run the shop interface update trigger when "Player - Player 1 Custom Resource changes".

    Tried and didn't work, or did it get lost in the other replies?

    It doesn't matter if you are customizing everything, there are events for most things you'd want to do anyway. And when there isn't, bend your other triggers a bit. For this scenario, there are a ton of different player properties you can choose from. If a players income only exists inside a variable and a custom display, either mirror his income to credits, minerals, custom resource or something or simple use a player property instead of a variable to store a players income.

    Posted in: Triggers
  • 0

    posted a message on [Resolved Trigger] Changing the unit color of all units in a unit group

    Yeah, it's odd. I can't see the pattern why some things do work for multiples but not all... but you gotta do what you gotta do (damn, too much Mafia 2).

    Posted in: Triggers
  • 0

    posted a message on Mindless wandering of monsters?

    Personally, I don't care much for the built-in "Critter Wander". If you'd like a bit more control over how your units wander, you could do something like this (of course, add a condition that excludes any unit you don't want to wander):

    Wander
        Events
            Unit - Any Unit Becomes idle
        Local Variables
        Conditions
        Actions
            General - Wait (Random real between 2.0 and 20.0) Game Time seconds
            Unit - Order (Triggering unit) to ( Move targeting ((Position of (Triggering unit)) offset by (Random real between 3.0 and 10.0) towards (Random angle) degrees)) (Replace Existing Orders)
    
    Posted in: Triggers
  • 0

    posted a message on [Resolved Trigger] Changing the unit color of all units in a unit group

    I think you're missing something here... or I didn't understand what you wanted. It's very easy to do something to every unit in a unit group or region or whatever. Modify this to suit your needs.

            Unit Group - Pick each unit in (Last created units) and do (Actions)
                Actions
                    Unit - Set (Picked unit) team color to (Player 01) Red
    
    Posted in: Triggers
  • 0

    posted a message on Is it bad to use a while loop without any wait?

    I'd say you should try to avoid triggers running continuously if you don't absolutely need them to. Don't know how much of a performance hit you'd take if you'd do it your way though. Adding a 0.1 sec wait would probably be quick enough.

    ...or you could run the shop interface update trigger when "Player - Player 1 Custom Resource changes".

    Posted in: Triggers
  • 0

    posted a message on [Solved][Trigger] Break down a region into points and spawn units

    Once I found the functions I wanted, this was pretty straight forward.

    It may seem as I'm mixing integer and real values / variables for no reason, but this was the easiest way to do what I wanted. If I change the variables to Integers, I can't add them to the offset. If I make the loop "for each real...", I can't convert to integer to avoid infinite loops in case the region isn't even. I could, of course, add a ton of convert integer to real and vice versa.. but this works, so meh.

    It only works for square regions, so hopefully that's what you want. Adapting this for circular or combined regions would be a pain.

    The wait 0.1 is only there to visualize how the trigger works.

    Spawn units
        Events
            Game - Map initialization
        Local Variables
            x = 0.0 <Real>
            y = 0.0 <Real>
        Conditions
        Actions
            General - For each integer y from 0 to (Integer((Height of Spawn 01))) with increment 1, do (Actions)
                Actions
                    General - For each integer x from 0 to (Integer((Width of Spawn 01))) with increment 1, do (Actions)
                        Actions
                            Unit - Create 1 Marine for player 1 at ((Bottom-left of Spawn 01 bounds) offset by (x, y)) using default facing (No Options)
                            General - Wait 0.1 Game Time seconds
    
    Posted in: Triggers
  • 0

    posted a message on [Trigger] Cliff detection

    Sorry for butting in, but why Wait 0.0 Game time seconds? Does this prevent the trigger from running multiple times? I usually use wait 0.1 or 0.01 when I want something I ordered in the trigger to happen before moving on.

    Posted in: Triggers
  • 0

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

    Love the editor, so many ways to do the same thing, and none of them wrong... usually. :-p

    I picked my way because it makes the unit run away from whoever is attacking it regardless of the current facing, some units might shoot without turning, some may turn after the shot if fired (dunno when "attacked" trigger, impact or shot fired).
    The drawback of my way (fixable of course), would be that the distance is calculated from the attacking unit.
    Klishu's way is probably the easiest way, but with less control of the distance it flees.

    Try them all and see which feels best for your map. :)

    Posted in: Miscellaneous Development
  • 0

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

    It works in my minimalistic test environment.

    Except the trigger, I only changed a few things in the data editor. I removed the wander behavior from the Lyote, gave it 1000 life and a high regen rate.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Attacking a neutral unit to accelerate it.
    Comparison
        Value 1: Attacking Unit
        Operator: ==
        Value 2: Zealot [37.01, 39.19]
    
    Posted in: Miscellaneous Development
  • 0

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

    What you want to do should look something like this. Of course, you'll probably want the zealot and the critter to be variables and possibly the distance too. Also, you'd have to edit the health of the critter so it does not die in one hit, or the trigger won't do anything.

    Flee!
        Events
            Unit - Any Unit is attacked
        Local Variables
        Conditions
            (Attacking Unit) == Zealot [37.01, 39.19]
            (Triggering Unit) == Critter - Lyote [39.31, 39.17]
        Actions
            Issue Order
                Unit: Triggering Unit
                Order: Order Targeting Point
                    Ability Command:  Move
                    Target Point: Point Offset Towards Point
                        SourcePoint: Position Of Unit
                            Unit: Attacking Unit
                        Distance: 10.0
                        TargetPoint: Position Of Unit
                            Unit: Triggering Unit
                Queue: Replace Existing Orders
    
    Posted in: Miscellaneous Development
  • 0

    posted a message on [help] unit entering an area = crash

    Triggering unit works in events? By definition, the trigger has not triggered yet, so there should be no triggering unit to recall. Could it be using an old trigger's triggering unit? I guess the triggering unit could be already defined since something has entered the region. But you should really use "Any Unit" or something else.

    Other than that, I can't find anything that should crash the game. Usually you'll just get an error message (red text on the left side of the screen)

    If you paste your triggers and other things in [ code] [ /code] tags (without the spaces), it's a bit easier to read. But either way works.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [help] unit entering an area = crash

    I'm not good with crashes (can't hurt to have a look though), but you really have to give more information about the problem for people to be able to help (assuming it's not a widely known bug in the editor or something)

    Copy the trigger (rightclick, copy as text) and maybe include a screenshot of the triggering areas. Anything relating to the trigger helps.

    Multiple events are no problem, they are basically treated as separate triggers. One of the events occur, trigger fires.

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