• 0

    posted a message on Datamine HotS/Sc2:LotV question

    Bring it on!
    You have our protection :-D

    Also, @Arcane already posted some stuff from data mining so i don't think there's reason to worry about it.

    Posted in: General Chat
  • 0

    posted a message on Advanced script example

    You seem to worry a lot about quality of your code :) It looks good to me as a concept.
    One good side about so many limitations in galaxy is that it's hard to write a broken code.

    Do you use some external editor for coding? I noticed that you have all your stuff in a single custom script block. I hope you are not typing this inside a SC2 editor? Do you? :)

    And script itself is already too big for me to go through every piece to be honest. I'm not even entirely sure what's the goal of your map.
    You could also organize it a bit - split into files etc.

    Have you resolved your library issue yet?

    Because looking at your map i don't see any library created :) I think mentioned data entries are to export library outside of the mod so that it can be used in maps. But firstly you need to actually create a library inside a trigger editor ("New -> Library").

    If you want a live example checkout "GAx3", public mod on bnet. It has a library that is exported into maps that use the mod as a depedency. Plus it is partly based on custom script which is included from file inside the mod itself.

    Posted in: Galaxy Scripting
  • 0

    posted a message on so...when is the next BIG mapeditor patch?
    Quote:

    The only way Void will break your stuff is if you are using Blizzard stuff.

    Most of maps are based on campaign depedencies etc. so.. :)

    In my case though the problem is related to UnitSetFacing native. They seem to change on how it behaves when called again on unit that hasn't yet finished its turn.
    In swarm when called again it will instantly stop its current not finished turn, and proceed to execute new one instantly.
    In lotv when called on unit that is already turning it will stop the turn AND wait till the next tick (i think so, didin't investigate it carefully yet) before proceeding to execute new turn.

    It might seem like a trivial change, but for games based on that mechanics (ice escapes) it's a game breaking bug.

    Basing on this i suspect there might be more hidden changes.. or it's just me being unlucky :< we'll see i guess.
    I just hope it's a bug and i'll be able to report it somewhere.

    Posted in: General Chat
  • 0

    posted a message on Advanced script example

    Good use of User Data Types! I should've suggested that earlier, but wasn't sure whether it will satistify you as they don't provide field for direct link to region.

    TriggerDestroy(TriggerGetCurrent());
    

    It is used correct in your code, but i think you might use some description on how it behaves as it wasn't obvious for me at begining.
    TriggerDestroy will indeed destroy trigger but it won't stop already runing context. For example if you would put that at the top of the function it would still execute to the end.

    There's also TriggerStop. But it won't instantly kill runing trigger as one might think. It must be first released before it can be killed by scheduler. Releasing runing trigger is archived by calling Wait function. Then scheduler jumps to next trigger and can kill the previous one.

    There's no real multi-threading in galaxy.

    regionTmp = RegionFromName(regionName);
    if (!regionTmp)
    

    If region with given name doesn't exist it will return null, so you should do null comparison.
    As far as i remember galaxy overall doesn't like those logical comparisons without clear condition, on complex types like region etc. And usually just throws an error.

    // XXX String values default to "" right? Or null? Check this.
    if (evilRegions[i].name == "")
    

    Every declared string is initialized to "" (empty string) by galaxy VM. So that condition is correct.
    There are some natives that can return null strings though. Like TriggerGetFunction called on non-existing trigger will return null. Trying to compare null string to empty string would throw a warning.

    Posted in: Galaxy Scripting
  • 0

    posted a message on so...when is the next BIG mapeditor patch?

    @MaskedImposter: Go

    Nope, editor is still not available. But that doesn't mean you can't just launch the map offline. I do it from command line:

    SC2Switcher.exe -reloadcheck -run "MapFilename.SC2Map"
    
    Posted in: General Chat
  • 0

    posted a message on Where to find the Transmission Portrait Container

    I don't think you can hook it up this way. It's created dynamically from templete. So you must override template via .SC2Layout files.

    Posted in: UI Development
  • 0

    posted a message on Gets units that will be affected by Lurker attack?

    If you look at how lurker attack effect is setup you'll see that it archives the line damage by calling 10 search area (circle of 0.625 radius) effects towards the unit with 1pt spacing between each.

    There are actually 2 methods to simulate & detect which units gonna get damaged.

    First would involve creating dummy effect in data that would match the original search effect of lurker. Then you would need to setup a trigger that would be bound to that effect. Then in your trigger "lurker starts attacking" you would manually run that dummy effect at the position of target unit.

    native void     UnitCreateEffectPoint (unit inUnit, string inEffect, point inTarget);
    

    Second method is to do the calculations manually using circle regions. Inside an "lurker starts attacking" trigger, measure the angle between lurker and its target. Then in loop through 1 to 10 fetch units that are inside each circle going towards the angle.
    Natives you will need:

    // measure angle between the lurker and target
    native fixed AngleBetweenPoints (point p1, point p2); 
    
    // move the point by *distance* towards the angle
    native point PointWithOffsetPolar (point p, fixed distance, fixed angle); 
    
    // create region at calculated point
    native region RegionCircle (point center, fixed radius); 
    
    // from unitgroup fetch units that are inside given region
    native unitgroup UnitGroupFilterRegion (unitgroup g, region r, int maxCount);
    
    Posted in: Triggers
  • 0

    posted a message on Advanced script example
    Quote:

    The fact that I can't redeclare a static function in another file completely ruins the keyword then. Grrrr. And I suppose namespacing is impossible as well, then.

    Yeah, no namespaces available.. i find it hard to deal with too.. Everything you declare is basically global. Unless it's in context of function.
    Coding in galaxy is overall very similiar to coding in embedded C. Lots of static linking, no dynamic memory allocations etc.

    Quote:

    How can I get the regions name?

    You can't. There's no native to do that.
    What about using some kind of naming convention for regions? Like Namespace_1.

    Quote:

    Is it possible to set custom values on a Region through the editor, and if so can I get them through script? I already checked and the max length of a Regions name when created through the editor is 80, so I can use that to store some metadata if I can just get to it through script.

    There are no custom values. You can indeed store some data in the name itself but it doesn't sound like a good way :)

    Quote:

    Or, alternatively, can I enumerate all regions in the map?

    I don't think so.
    If you really need that then viable apporach would be to write a custom script/app (whatever) that would read Regions file inside an map (its an XML file that looks like that) . From that data create .galaxy file which would fill the data into array at map initialization. I did similiar thing for my map to scan terrain texture cells and write it down to .galaxy file:
    https://bitbucket.org/Talv/untitled-escape/raw/776ffaa1e25a35754cab0d08f3549e03ef4ee916/map.SC2Map/TextureMap.galaxy
    It's pretty unhandy though. As you obviously need to regenerate that file every time you edit regions.

    Posted in: Galaxy Scripting
  • 0

    posted a message on so...when is the next BIG mapeditor patch?

    I wonder how many maps gonna get broken from that massive update.. they surely stacked a lot of changes through hots development.

    I personally already tried my map on lotv client and guess what.. yeah -.- ..

    Posted in: General Chat
  • 0

    posted a message on Where to find the Transmission Portrait Container

    This?

    It seems to be created from PortraitPanelTemplate
    Builtin UI editor (ctrl + alt + f12) is good for hunting that type of things as you can see on screenshot.

    offtopic: What map are you making now? :)

    Posted in: UI Development
  • 0

    posted a message on Advanced script example
    Quote:

    - repeatedly do many dynamic things if condition but stop it at some different condition (I understand TriggerAddEventTimeElapsed and such, but is it good to have 50 of those running or should I make a big one that handles all of them, even if the things happen at different intervals? If so, should I just have a |timer| running that I check for elapsed time with a big if/switch block? Should I create an array of structrefs, that contain a time and funcref, that I loop through and trigger at the right time?)

    I'm not sure which method is the best in terms of perfomance, but i think every of those suggested are pretty close to each other. As long as the limit is 50. It's better though to use a single trigger. As every one would create a new context with separate stack.

    So have an single trigger with multiple events tied to it. Every event would have an own timer. To detect which timer has been triggered you must store all of them inside an array then loop through all of them and match the right one using:

    native timer    EventTimer (); // it will return the timer that has intiated the trigger
    
    // other natives you need:
    
    native timer    TimerCreate ();
    
    native void     TimerStart (timer t, fixed duration, bool periodic, int timeType);
    native timer    TimerLastStarted ();
    
    native void TriggerAddEventTimer (trigger inTrigger, timer inTimer);
    
    Quote:

    - can I have anonymous functions / create functions on the fly

    Nope. TriggerCreate and funcref's is all we have available for that type of things.

    Quote:

    - is it possible to use static functions for CreateTrigger or must it be a global one

    I believe so. As long as function matches the

    bool fn(bool,bool)
    

    pattern it will accept anything. There's really no difference between static and non static functions though. You just can't reference them outside of the current script file where they were defined. They are still global for my understanding - you can't redeclare another static function with same name in different file.

    Quote:

    - can I create unit Behaviors through Galaxy and bind them

    It's not possible to create any static data entries like behaviors via galaxy. All you can do is adjust some values of already created entries with:

    native bool CatalogFieldValueSet (int catalog, string entry, string fieldPath, int player, string value);
    
    Quote:

    - create a hash-type map like map["key"] = value

    Galaxy doesn't support associative arrays natively. You would need to implement some sort of library by yourself. But as it would require some sort of hasing system it might not be worth the effort.. and even be slower than other methods.
    The simpliest way is just to have an array of structs. And to fetch them by name use one of those 2 methods:
    1) Store the name inside an struct and loop through all the entries untill it's matched.
    2) Use dynamic data tables and store the key id to an array inside them.

    native void         DataTableSetInt (bool global, string name, int val);
    native int          DataTableGetInt (bool global, string name);
    
    Quote:

    After reading the forums here for a while I recognize many names of whom I'd like to read their code, but I can't find their maps through the editor. That probably means they have obfuscated the code right? Or locked their maps, that is.

    Pretty much. Editor is listing only maps marked as public. Private maps aren't necessarily obfuscated - it's optional. Also only auto-generated code from triggers built via editor GUI is being obfuscated. If someone has wrote its code by hand it will be untouched - default obfuscator from editor cannot handle that type of things..
    Private maps can still be downloaded as Funky said. Just not directly through editor.

    Quote:

    Also, how can I get the ID of a unit that I select with my mouse in the World Editor? The code I am working with references UnitFromId(123), but how can I find that unit in the terrain view?

    I don't know any way. Atleast not a simple way that doesn't involve some tedious workarounds.
    What i do is instead of preplacing units on the map i preplace points. Then i dynamically create units at position of the point. Points can by fetched with PointFromName(string name).

    For other things you can check out my map (Back To Brood Ice Escape, on arcade):
    https://bitbucket.org/Talv/untitled-escape
    Can be downloaded here: https://bitbucket.org/Talv/untitled-escape/get/master.zip

    It's a mix of GUI triggers and custom scripts.. core libraries were written in galaxy and are exposed into GUI via custom API. Although it's pretty dirty i must say. I would have done many things different if i would be about starting new map. There's some inconsistency etc.. So it's not an good project to base things on but you might find something useful after all.

    There's also cortex engine (library for role play maps)
    https://github.com/90-proof/cortex-forge/tree/master/Cortex initially created by Motive.
    And i must say i don't know any other public maps that use pure galaxy. Most poeple just built stuff with blocks in GUI..

    Posted in: Galaxy Scripting
  • 0

    posted a message on Datamined Terrain Changes in Heroes of the Storm/Void

    Nice find!

    I like how they approached this. Basing on the posted XMLs i'm guessing that format of t3TextureMasks file hasn't even changed. Instead there are block descriptors inside an XML. Each block has its own descriptor that contains tileset id.

    Basically 8 texture limit still exists, but it is now limited to a terrain block, not a whole map. One block is 8x8 long (contains 64x64 pixels).

    I wonder how is it handled inside an editor.

    Posted in: General Chat
  • 0

    posted a message on "HostSiteOpsSet" - how to clear it

    Oh, nevermind. Figured it out, lol.

    To clear appended site op you just need to use the same actor message, just without parameter.

    // set
    HostSiteOpsSet ::Host SOp180
    
    // clear
    HostSiteOpsSet ::Host
    
    Posted in: Data
  • 0

    posted a message on "HostSiteOpsSet" - how to clear it

    I have an unit actor in which i use the "HostSiteOpsSet" actor message, to set the site operation dynamically. Then I would like to dettach that site op. But i can't see a way to do that. There's seems to be no message that would take care of it. ideas? Maybe workarounds?

    Posted in: Data
  • 0

    posted a message on What is the charge count label called?

    It's GameUI/UIContainer/ConsoleUIContainer/CommandPanel/CommandButton00/ChargeLabel

    It uses GameButtonCharge as default text style - overriding just this style might be sufficient in your case, without touching the UI.

    Example:

    <Frame type="CommandPanel" name="GameUI/UIContainer/ConsoleUIContainer/CommandPanel" file="GameUI">
        <Frame type="CommandButton" name="CommandButton00">
            <Frame type="Label" name="ChargeLabel">
                <Anchor side="Bottom" relative="$parent" pos="Max" offset="-8"/>
                <Anchor side="Right" relative="$parent" pos="Max" offset="-8"/>
                <Style val="GameButtonCharge"/>
            </Frame>
        </Frame>
    </Frame>
    
    Posted in: UI Development
  • To post a comment, please or register a new account.