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).
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.
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 :| )
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.
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.
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.
0
@kogits35: Go
Click the bracket ( to the left of triggering unit. It should be the first thing in the expression.
0
@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).
0
@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.
0
@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.
0
@kogits35: Go
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:
And then in your trigger that spawns the zealots, check if zealots_enabled[player number] is true.
0
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.
0
@SteffenDs: Go
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.
0
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
0
Just wanted to say that this has been fixed for me in the latest SC2 update :)
0
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