• 0

    posted a message on TriggerLibs, GUI And Code

    @caspersc: Go

    I don't think you can specify external galaxy files for inclusion, currently :(

    The hack I'm using is to use a placeholder action at the top of my library that uses a custom script action to include all my files. (custom script is something along the lines of:

    }
    include "libFoo/foo"
    include "libFoo/bar"
    etc
    void some_dummy_function() {
    

    It also really helps if you save the map as a "SC2Components" (expanded), rather than a standard MPQ-based archived map so that you can edit the files without having to import every other minute.

    http://nevir.net/sc2/Scripted_Map_Template.zip

    Posted in: Galaxy Scripting
  • 0

    posted a message on Worried about lag online: timers
    Quote from s3rius: Go

    @RileyStarcraft: Go

    Doesn't garbage collection usually kicks in once a memory address is orphaned? Anyway - it doesn't make sense that the memory usage just stops increasing at one point. If the collector would peroidically clean the memory it would rise and fall in turn, wouldn't it?

    That's just one type of garbage collection (reference counting) - a lot of really common GC implementations perform periodic cleanup (most Java stacks, for instance - which is why you sometimes experience random pauses when using java apps.

    Given your evidence, you're probably right that SC2's using some sort of reference counting method, but it could be the case that the game also has a pool of memory that stays allocated and gets reused as needed.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Worried about lag online: timers
    Quote from RileyStarcraft: Go

    Galaxy is garbage collected, so memory is going to increase until the next time the gc runs.

    Do we know what style of GC algorithm the engine uses? (mark & sweep? generational?)

    Posted in: Miscellaneous Development
  • 0

    posted a message on Worried about lag online: timers
    Quote from JPLetters: Go

    Why is it that WASD lags exactly?Is it the timers required?Or something else?And what else would that apply to?

    The game client seems to try to keep events in sync across all players; Network latency is slowing it down at that point - it might even have to wait for other players' game client to acknowledge the key press

    Posted in: Miscellaneous Development
  • 0

    posted a message on Centering text?

    @Fullachain: Go

    You can center it by setting the width to 0 and anchoring it relative to the top or bottom of the dialog

    Posted in: Miscellaneous Development
  • 0

    posted a message on ArrayIndexOverFlow?
    Quote from margeman2k3: Go

    Hint: In an array of length 10, the first element has an index of 0 and the last element has an index of 9.

    If the array is defined as "size 10" in the GUI, it actually gets a size of 11, though

    Posted in: Miscellaneous Development
  • 0

    posted a message on ArrayIndexOverFlow?

    @Vicboy: Go

    It means you tried to ask for an entry that was out of bounds for an array: For ex, asking for the 10th element of an array that only stores 5. Generally means your code isn't doing what you want it to, or you're not validating the value

    Posted in: Miscellaneous Development
  • 0

    posted a message on Brick wall? (Strings and Text)
    Quote from SiNiquity: Go

    @Nevir27: Go As a quick/completely unrelated aside, there's no dynamic memory allocation in Galaxy, correct? I'm trying to figure out how to store data arrays (though I may just leave them be and reference them via functions)... hmm. Something to ponder on tonight.

    Sortakinda.

    If you use the data table, you can simulate dynamic allocation (and it's pretty quick, though I haven't done extensive profiling yet), but you've got to build out a indexing scheme to use there so you avoid naming collisions. I tend to use "ListName/#" to store the count of items in a dynamic array, and "ListName/1", "ListName/2", etc to store values (starting at 1 makes life a lot easier when interacting with all the other Blizz stuff that starts at 1).

    Posted in: Miscellaneous Development
  • 0

    posted a message on Possible to hide units on the minimap?

    @Sixen: Go

    If that doesn't work, you might also be able to replace the minimap icon with a transparent/blank image

    Posted in: Miscellaneous Development
  • 0

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

    @SiNiquity: Go

    The main intent behind no text -> string conversion is that text values can change based on the locale of the user. You don't want to rely on them for lookups, only for displaying localized content to the user.

    I'm still a bit fuzzy on your example, but why not pass the Race's id around (which is a static string value), and do a Catalog lookup for the name when you need it? And ditto, if you need to reference races in other data table entries, use the race id rather than its name ("Prot", "Terr", "Zerg", "Neut", etc). Any time you reference the race as a game link in the GUI, it just spits out a string with the race's id.

    For ex, to get the localized name of the race:

    StringExternal(CatalogFieldValueGet(c_gameCatalogRace, raceId, "Name", c_playerAny));
    
    Posted in: Miscellaneous Development
  • 0

    posted a message on How to get content from gamestrings.txt.

    @Xaestro: Go

    Doesn't StringExternal() look up game strings from all the mods your map depends on, in priority order? (since it's the foundation of how the text type works)

    Posted in: Miscellaneous Development
  • 0

    posted a message on Native Library

    @Colawaffle: Go

    Here's the libNtve source as of a while ago, not quite fully up to date:

    http://pastebin.com/h1kVj685

    Posted in: Miscellaneous Development
  • 0

    posted a message on Need an expert actor event person!!!

    For situations like this, Blizzard seems to prefer doing a unit morph (but that means you need to set up two units, which may not be ideal in your map). I'm not sure what this takes to get going.

    The other option is to set up your actor's events so that it first plays the morph animation, and then does the model swap when the animation finishes. (or the reverse, if the morph needs to be done after the swap)

    For the selection circle not moving, make sure your actors have _Selectable as an alias

    Posted in: Miscellaneous Development
  • 0

    posted a message on rotating units that can't rotate

    Quote from xytor: "Cool, thanks... also, is there any way to turn animations off? I made a viking doodad but it is animated and really annoying..."

    Yeah, in the doodad's actor, open up "Event - Events +" and remove the "ActorCreation: AnimPlay Stand Stand PlayForever" entry

    Posted in: Miscellaneous Development
  • 0

    posted a message on rotating units that can't rotate

    @xytor:

    In the unit definition in the data editor, edit the "Unit - Flags" field and enable "Turnable". Then just hold control and drag around to rotate it in the terrain view

    You might also need to set the "Movement - Turning Rate" to 0 if it's rotating in game.

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