• 0

    posted a message on Brick wall? (Strings and Text)

    @RileyStarcraft: Go

    Really just trying to get familiar with the editor with a tinkertoy project of mine. I had hardcoded the race names in ("Terran" "Zerg" "Protoss") and had a conversion to go back and forth from Race - Game Link to the full-name. Then I saw that one of the fields for Races is Name, and thought "Awesome! No more hard-coded value - I'll just grab the name from the Data Editor!"

    However, the value for "Name" is "Race/Name/# #id# #," and from there I needed "Convert Game Text," and the rest is history :) I use the full-name in some triggers and need them to be Strings.

    Again, not Earth-shattering, but I'm still a little sad that the elegant solution can't work :(

    Posted in: Miscellaneous Development
  • 0

    posted a message on Brick wall? (Strings and Text)

    And there's no other way to resolve the path given to me other than Convert Game Text? :( It's not seriously game-breaking, as I can hard-code the values, but I prefer not to where possible :D

    Posted in: Miscellaneous Development
  • 0

    posted a message on So What kind of backpack dialog looks nicer?

    I actually like the boxes around the items - seems to suggest you can click / drag them around (hoping that's the case). If so #2 gets my vote, otherwise it's misleading so #1.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Brick wall? (Strings and Text)

    I have a value from the data editor that I need to use, but unfortunately it's a reference. As far as I know, the only way to resolve data editor references is the Convert Game Text function, which returns a Text value (if I'm wrong here, please let me know!). There's no stylistic monkey business being applied to this value, it's just a plain string that I have the misfortune of only being able to reference via this Text variable. I need this to be a String (concatenation, parameters for built-in functions, etc).

    Do I have any options, or did I just hit a brick wall?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Workaround for Record passing/retrieving

    @s3rius: Go

    Excellent suggestion, and that's probably the best I can get unfortunately. I actually do have arrays of my record type, but I have multiple arrays for the same type and would like a single function to be able to handle it. Guess I can make a preset type to say which array to look in.. -_- Thanks for the tip!

    Any ideas why they removed the functionality (I doubt they said)?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Workaround for Record passing/retrieving

    <=== Is what editing is like without being able to pass records around or return them. I have so much skeleton code just waiting for the patch to enable this, and in a few key places I've actually listed every variable needed from the record to be passed into my function just so I could get the ball rolling again.

    In any case, I grow oh so weary of writing out tens of variables to pass around. Is there another way, perhaps via Galaxy Script, that will let me pass my structure (record), or return a structure / record?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Creating a powerup item - Solved(Hacky)

    No, though I'm curious to learn what you've tried and which parts did or didn't work.

    Posted in: Miscellaneous Development
  • 0

    posted a message on setting starting amount of custom resources and showing count ingame

    Maybe I missed the boat on this one, but if I understand the question correctly the OP was wanting to know how to display custom resources (i.g. Terrazine) and display them alongside or in place of minerals/gas. Meh I don't know - the thread title sounds like that, but the original post does not. :(

    @xhatix: Go I didn't even know there were races in the Data Editor. Very cool.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Enters "Any" region?

    @ralme360: Go

    If it makes you feel better, I just learned UI - Display from you :D

    On a more serious note though, I don't see the "Any Region" in my editor. My choices are for x in Unit enters Region(x):

    Playable Map Area Entire Map Empty Region Convert Rectangle to Region Convert Circle to Region

    Posted in: Miscellaneous Development
  • 0

    posted a message on SiNiquity's Consolidated Thread of Q[&A w/ your help]

    Shameless bump :D

    Posted in: Miscellaneous Development
  • 0

    posted a message on SiNiquity's Consolidated Thread of Q[&A w/ your help]

    SiNiquity's Consolidated Thread of Q&A

    Alright, I'm new to the Galaxy Editor in SC2 (hence my avatar), and instead of flooding the forum with my dozens of questions, I figured I'd consolidate them here.

    Background

    I've messed around with the SC and War3 editors, so I am familiar with the trigger system and how it works. I also have programming experience, though I'm not looking to delve into the Galaxy Scripting just yet (soon).

    Question 6 - Understanding Morphs

    Alright, so I've taken it upon myself to understanding morphs. In particular, complicated morphs such as Baneling from Burrowed Zergling. I was drawn to this one because there are several units involved: Zergling, Baneling Cocoon, Baneling.

    Units

    The first thing I gleaned from this is that order does matter! The morph starts with the initial unit (which we don't see here, a burrowed zergling), and ends with the final unit.

    Zergling
    Zergling Duration Zergling Duration 2

    Cocoon
    Baneling Cocoon Duration Baneling Cocoon Duration 2

    Baneling
    Baneling Duration Baneling Duration 2

    SOLVED Question 5 - Functions

    Can user-defined functions not be called from an initial action, but only be used as parameters?

    SOLVED: Use a custom action instead of a custom function.

    Question 4 - Using Record Type as Parameter

    WORKAROUND

    Quote from s3rius: Go

    Instead of passing the struct itself you can make arrays of your struct-type, then return the integer index of the struct. That's the only way right now, I think.

    PS: Since Blizzard disabled pointer functionality in patch 9 there's only two options: 1: They comepletely threw away the idea of passing structs. 2: It'll come later (probably much later).

    Question 3 - Label in Dialog Not Changing Color

    Created a label and set the text color to red via the label parameter, but when displayed in the dialog box the text color is the default (white). However I can force it to red if I modify the value explicitly via the hard-coded styles <c=FF0000>red</c>. So does the color parameter to the label just not work?

    SOLVED Question 2 - Converting String To File - Image

    I have an image path that I grabbed from a unit in the data editor, and I want to use it. However, Catalog Field Value Get only returns a string, and I can't seem to find a way to convert the String image path into an actual "File - Image" type. Being the good forumite, I've done some searching and found an example of what I'm trying to accomplish. However, the poster seems to return the icon path as an image, whereas I cannot since the "icon path" in my editor is of type String and the function expects File - Image. The relevant part of the example is below:

    Ability Icon
        Options: Function
        Return Type: File - Image
        Parameters
            Ability = "" <String>
        Grammar Text: Ability Icon(Ability)
        Hint Text: (None)
        Custom Script Code
        Local Variables
            IconPath = "" <String>
            DefaultButtonFace = "" <String>
        Actions
            Variable - Set DefaultButtonFace = (Value of Abilities Ability "CmdButtonArray[0].DefaultButtonFace" for player Any Player)
            Variable - Set IconPath = (Value of Buttons DefaultButtonFace "Icon" for player Any Player)
            General - Return IconPath
    

    SOLUTION

    Basically trick the editor into thinking the variable is of the correct type (because, well, it is). This can work for any 2 types that are "essentially" the same (that is, the underlying type is the same). Take the following example below:

    Convert String to File - Image
        Options: Function
        Return Type: File - Image
        Parameters
            IconPath = No File <File - Image>
        Grammar Text: Ability Icon(Ability)
        Hint Text: (None)
        Custom Script Code
        Local Variables
        Actions
            General - Return IconPath
    

    The editor will accept this because IconPath is of the correct type. Now, change IconPath to type String and you're done!

    Convert String to File - Image
        Options: Function
        Return Type: File - Image
        Parameters
            IconPath = No File <String>
        Grammar Text: Ability Icon(Ability)
        Hint Text: (None)
        Custom Script Code
        Local Variables
        Actions
            General - Return IconPath
    

    SOLVED (?) Question 1 - The Red Dot over some Trigger Icons

    UPDATE: It seems that the red dot means the trigger is half-disabled... hmm.

    UPDATE 2: Opened the editor this morning, no problems. Editor bug I guess?

    Starting off with an easy one. One of my functions has a red dot over the question mark, and so do some of the actions in that function. I would assume that's indicative of an error, but no only do I not see one, the function works as intended. Any ideas? Here's the function - it takes a CamelCased word and turns it into Camel Cased. The first 2 "General" triggers (For and IfThenElse) both have red dots, and the function itself in the left sidebar has a red dot over the question mark.

    Camel Case to Spaced
        Options: Function
        Return Type: String
        Parameters
            Camel Cased Str = "" <String>
        Grammar Text: Camel Case to Spaced(Camel Cased Str)
        Hint Text: (None)
        Custom Script Code
        Local Variables
            n = 0 <Integer>
            StrLen = 0 <Integer>
            Spaced Str = "" <String>
            Current Character = "" <String>
            Last Character = "" <String>
        Actions
            Variable - Set StrLen = (Length of Camel Cased Str)
            General - For each integer n from 0 to StrLen with increment 1, do (Actions)
                Actions
                    Variable - Set Current Character = (Substring(Camel Cased Str, n, n))
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            Or
                                Conditions
                                    ------- Current character is not uppercase
                                    Current Character != (String(Current Character) as Upper Case)
                                    n == 0
                                    Last Character == " "
                        Then
                            Variable - Set Spaced Str = (Combine (Spaced Str, Current Character))
                        Else
                            Variable - Set Spaced Str = (Combine (Spaced Str, " ", Current Character))
                    Variable - Set Last Character = Current Character
            General - Return Spaced Str
    

    More to come... <3

    Posted in: Miscellaneous Development
  • 0

    posted a message on Traversing Data Array

    Real quick, when I say "data array" I mean an array located in the Data Editor. So far I've figured out using Category Field Value Get, I can get access to a single value, such as InfoArray[0].Unit from the SCV's TerranBuild ability. However, I want to iterate over all members of the array, that is InfoArray[i].Unit. This brings me to 2 questions:

    1) Is there a way to determine, a priori, the length of a data array (so I could loop it without hard-coding its length and worrying about if it changes later)?

    2) Even with the loop and a hard-coded maximum length value, I'm a bit puzzled as to how to get the "i" in InfoArray[i].Unit, as it's just a string parameter. Edit: Realized I could just use StringCombine and pass in "i" that way [duh].

    Sorry if this has been answered before - if so, then my searching ability is must be subpar.

    -SiNiquity

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