• 0

    posted a message on spawn after upgrade?

    @kogits35: Go

    Click the bracket ( to the left of triggering unit. It should be the first thing in the expression.

    Posted in: Triggers
  • 0

    posted a message on Help with a trigger for only 1 person.

    @CrinklyMilk: Go

    I'm not 100% sure what you're asking since you didn't post your trigger, but maybe I can help anyway. Player IDs in SC2 are literally just an integer. Player 1 is 1, Player 2 is 2, etc. Most likely what you want is a condition: (Triggering Player) == 1 (or whatever player you want).

    Posted in: Triggers
  • 0

    posted a message on How order to worker normal build (not spawn)?

    @AprilTaurus93: Go

    In SC2, building is an ability. So you're looking for the action "Issue Order", and then you want to pick the order type "Order Targeting A Point" and the ability "SCV - Build Bunker". Look at the picture I've attached. Remember that you need to pick a point and a unit, which I haven't done here.

    Posted in: Triggers
  • 0

    posted a message on spawn after upgrade?

    @kogits35: Go

    Ah okay. It's a comparison called "Upgrade Count For Player". If you type "upgrade" in the search box you'll see it pretty quickly.

    Posted in: Triggers
  • 0

    posted a message on spawn after upgrade?

    @kogits35: Go

    Spawn Zealots
        Events
            Timer - Every 50.0 seconds of Game Time
        Local Variables
        Conditions
            ([your upgrade] count for player 1, counting Complete) > 0
        Actions
            Unit - Create 3 Zealot for player 1 at (Point(0.0, 0.0)) facing 270.0 degrees (No Options) [or whatever]
    

    Or whatever. But the main thing you need to take from this is the condition.

    Alternatively, you can have a boolean array global variable that is set to true for each player when they research your upgrade:

    Zealot Researched
        Events
            Unit - Any Unit research progress is Completed
        Local Variables
        Conditions
            (Triggering progress upgrade) == [your upgrade]
        Actions
            Variable - Set zealots_enabled[(Owner of (Triggering unit))] = True
    

    And then in your trigger that spawns the zealots, check if zealots_enabled[player number] is true.

    Posted in: Triggers
  • 0

    posted a message on Getting Length of an Array in the Catalog?

    Solved my own problem!

    For anyone looking at this and wondering, you just enter "GlossaryStrongArray" in custom script for the field path, WITH the speechmarks " (that was my problem :| )

    e.g.

            General - For each integer ttt from 0 to ((Count of values in Units Immortal "GlossaryStrongArray" for player Any Player) - 1) with increment 1, do (Actions)
    
    Posted in: Triggers
  • 0

    posted a message on Queue new units after completion

    @SteffenDs: Go

    Queue Marine
        Events
            Unit - Any Unit training progress is Completed
        Local Variables
        Conditions
            (Unit type of (Triggering unit)) == Barracks
        Actions
            Unit - Order (Triggering unit) to (Barracks - Train Marine) (Replace Existing Orders)
    

    Remember, in SC2, training a unit is an ability command, unlike WC3 where you there was a function called "train" and you select a unit. There's a way to do this with the data editor involving behaviours and effects, but it's kind of messy imo.

    Posted in: Triggers
  • 0

    posted a message on Getting Length of an Array in the Catalog?

    Hi, just a quick question,

    How do I get the length of an array in the catalog? I know there's already a function called "Catalog Field Value Count", but when I try to select the field I want, it asks me to provide an index which makes it useless for me:

    I tried accessing it with custom script as just 'GlossaryStrongArray' without an index but it won't compile.

    Just info on what I'm trying to do: I'm trying to create a counter table for an AI for an arcade map I'm working on. I want to cycle through GlossaryStrongArray for each unit, and everything works apart from the fact that I can't get the length of the array so I get a bunch of errors in game, which is pretty ugly.

    What do I do? :( Am I just missing something?

    Cheers, Alex

    Posted in: Triggers
  • 0

    posted a message on Editor reformatting code on reopen?

    Just wanted to say that this has been fixed for me in the latest SC2 update :)

    Posted in: Galaxy Scripting
  • 0

    posted a message on Editor reformatting code on reopen?

    First of all, this is my first post so hello :)

    I am a guy who used to make the odd map for WC3, and have recently decided to make one for SC2. However, SC2's editor is even more of a pain in the arse than WC3's, so I've resolved to minimise my pain by writing my triggers in Galaxy instead of using the GUI.

    Now let me just get to the point: When I write some code in the editor it looks like this:

    But when I close the editor and reopen it, my code looks like this:

    :(

    Now as you may have already determined, I don't have much patience for stuff like this. I just like to write my code with a nice interface and no messing around, and I don't like lots of newlines in my code. Is there a way to change this behaviour? I can't find any nice formatting options in the editor or anything. But surely some of you must have gotten around this, because I don't see how anyone could write code with this happening every time the editor is reopened.

    Cheers dudes, Alex

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