• 0.965018094089264

    posted a message on Ping Panel limitation

    This part is handled by Triggers. In particular Liberty library that sits in Liberty base dependencies.


    Values are set as constants so cannot be altered directly..

    const int libLbty_gv_c_PINGMAXCOUNT = 3;
    const fixed libLbty_gv_c_PINGRESETTIME = 2.0;
    const fixed libLbty_gv_c_PINGSUPPRESSIONTIME = 0.25;
    const fixed libLbty_gv_c_PINGLOCKOUTTIME = 5.0;

     I think viable way would be to have a trigger tied to Ping Event, which would reset the current counter.


    You should examine libLbty_gf_PingPlay function to get a better idea.

    But in short you should reset the counter of

    int[17] libLbty_gv_pingRecentCount;

    By overriding current value with 0 every time trigger is fired.


    Another way is to make a custom implementation of this system, basing on existing triggers.

    Posted in: UI Development
  • 0

    posted a message on Galaxy IDE as Visual Studio Code extension
    [Error - 09:15:25] Request textDocument/hover failed.
    Message: Request textDocument/hover failed with message: how did we get here?
    Code: -32603
    Haha, yeah.. these messages are not very insigtful.
    In new version it will print stack trace, so it will be easier for me address such issues.

    This error in particular will be fixed in upcoming version. It occured when hovering over comments/whitespaces at the end of file or within include statements.
    If you have finish the work about typedef and family, please release a new version
    Sure. Already started work on this, hoping to have it done by the end of the week.
    And there is another suggestion, could you take a feature to checking Unicode character in the script, special for the Comments, as we know custom script in SE do not accept non-ASCII characters, and if I use Chinese character "," instead of English character "," I can not copy script text to the SE window. and it is hard for me to find it with eyes.
    Not exactly sure what you're requesting there.
    I know about the problem related to handling of multibyte characters in Galaxy lexer within SC2, but what you suggest as a solution for this?
    Add option to transpile the script and escape these characters using '\x' notation?
    But since I'm not making a language extension like `Galaxy++` (at least not yet), not sure how should this be handled at the current moment..
    For me, I write galaxy as a Lib, and put them in SE as a Custom script, then encapsulate it to trigger function or trigger action. The Lib is isolated, so I do not need check dependencies except native.galaxy.
    Hmm.. so you're not saving galaxy files within map/mod directory? Just copy pasting parts of code one by one to GUI `script code` section seems rather uncomfortable to work with. Especially when you need to go back and update something.
    Is there a particular reason you do it this way?
    Why not just make one `custom script` element, that would have `include` statement to import your external scripts saved within the mod/map?
    I suppose you want to have actual GUI elements for actions/functions, but there's a way to declare dummy element using `Native` flag, so SC2Editor will be able to reference the element while auto-generating script, but it won't generate actual body of a function in its script.
    That's what I've been doing, and I don't see any cons of this method.

    I can obviously support editing galaxy files without having mod/map in the workspace, in such case however only one dependency is being indexed - `core.sc2mod` and its libraries.
    If your code will try to reference some stuff that sits in external library, then it would complain about undeclared symbols.. (since they won't be indexed).
    Ideally I was going to implement complete analysis of the script, including typechecking (i.e. when trying to assign `"foo"` to int variable it will highlight it as error). In order to do that all relevant galaxy files must be indexed.
    I write a new mod of terrain editor (rewrite the terrain mod of BLZ Enforcement). And I need these features.
    I've seen it in Delphinium videos. Cool stuff. Not sure if you guys are still planning to release it publicly, but if so I will certainly check it out.
    I was mostly interested about a way to alter terrain textures. But not just swap large part of texture surface using one of prepared presets (which is what you seem to be doing?).
    I was hoping for possibility to actually paint.. or rather have handful different shapes of splat models, so that terrain could be customized in detailed way.
    I can imagine FPS droping heavly once there's too many splats though...
    Posted in: Galaxy Scripting
  • 0

    posted a message on Galaxy IDE as Visual Studio Code extension

    Thanks for the feedback!


    Yeah, I'm slowly adding new features. typedef and family will soon be supported. I just focused on other things so far. One of which is proper support of archive dependencies. Currently only content of core.sc2mod was being read, and in order to have other dependencies indexed they had to be added to project workspace.
    But this is no loger the case, in new version (unreleased yet) dependencies of sc2map/sc2mod are being resolved, and indexed respectively. Although for this to work all revelant archives must be saved as so called sc2component, as there's no support for reading of CASC, nor MPQ. And not sure if there will ever be - I don't think it's really needed. Especially as default SC2 mods are included within the extension. For custom mods you just have to provide additional sources directory in the configuration - that should point to SC2 installation directory.


    Having access to complete dependency tree allows it to index all of the existing *Trigger* elements, and their metadata. So now when you hover over your custom functions, extension can display its name and description.

    In above example, function was delcared within the script aswell. In *Triggers* there's just a stub element created for it (with Native flag set).
    This makes it possible to document your codebase. And also bind generic parameters such as *int* to their actual preset constant variables, so it could provide more accurate auto-completins in context of that parameter.
    Also, I plan do add feature for indexing entries from *Data XML*. In order to be able to provide autocomplete list for these virtual *gamelink* parameters, which are mapped as string. To give an example, when you'd request code completions list for *unittype* parameter of UnitCreate then all possible names would be provided, along with their localized name in the tooltip.


    There's not much interest in these kind of tools among the community as you've pointed. But this doesn't stop me from working on it further. In fact it is quite fun to do so, and I've learned a lot in the process.


    I didn't had occasion to try Galaxy++ nor Andromeda. I did like the idea itself though. But I think they wanted to accomplish too much too early - get too many features at once.. And that makes it really hard to develop further while maintaining the stability.
    Also full blown language extension alone won't really be convenient to work with, if there's no tooling around it - dedicated IDEs or support within 3rd party extension for text editors (as this one).
    I'm not a fan of dedicated IDEs these days though. Their customization capability is often times highly limited.
    I like to play with many programmiang languages, thus having them all support from single editor is very convenient.


    Plugin for Sublime Text was indeed quite poor. But it's the past now!
    Do you find Visual Studio Code comfortable? It is quite customizable too - I didn't like it's default setup, but you can alter most of it in the settings or via extensions.

    If you happen to use it, feel free to report any issues and suggestions.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Patch 4.0 Sudden Errors [Partially SOLVED]

    Solution was to not use *Picked X* outside of the loop definitions. But often times people had triggers bound so much to the old design that simply adapting to changed mechanics is not convenient.

    Thus I put together library that can be used to revert what Blizzard did in relation to PickEach loops:


    Posted in: Triggers
  • 0

    posted a message on SC2 Bank Issue

    While p2p term might not apply here, it comes very close in how I envision it.

    On a network level it is client-server. But not the communication method is what I refered to, but the process of evaluating game state.

    If server is not responsible for its computation, then it has no relevance under these terms.

    Its role here is just to broadcast game input coming from its clients. There is no centralised unit. Each of the clients processes input on its own. And it's up to the clients to determine whether input they receive is valid at all for the current state.
    And now tell me that is not similar to parallel data processing - where p2p term applies.


    Though, I do realize that clients are transfering only inputs of their own actions, and not the results of the computation, what I suppose make it invalid to describe as p2p.. still, not outrageously wrong as you would want it to be.


    Also, I'm aware that Blizzard might have put some additional tasks on the server in order to get the best of this model. Tasks beyond wraping input packets with client id and instantly passing them over. But it's not what I was after.


    No peer-to-peer transfers happen as most people are behind NATs.

    While it's true, and having just said I didn't refer to network model.
    I'll just add it's not a showstopper. Techniques like udp hole punching exist and are used with great success as far as I'm aware.

    Posted in: Triggers
  • 0

    posted a message on SC2 Bank Issue

    If we are not talking about banks, then preloading is indeed only a way to optimize the map. All others assets can be read on demand if not preloaded.

    Banks however are special. Loading them on demand would not be feasible. Not in a multiplayer game, with p2p netcode. Where each player would need to transfer bank data to every other player in this particular game. Some banks can go over 1MB.. and since the current bank API is not asynchrous it would cause a lag spike that could last seconds.

    The game could preload all the existing banks certain player has. But that would not be wise given the fact that banks are scoped to publishers account, and not the map. Thus it could preload a lot of irrevelant data.
    That's why we were given system as such, where map must declare what banks it wants to use by listing them under preload section, with an option to limit it to certain player.




    I need to correct myself on one thing. Even though game protocol is P2P, the bnet servers are used as broadcasters, thus clients do not have to transfer the bank data to every other client in the game, as bnet server will do that. But it doesn't change the fact that you've to receive the bank data of every other player in the game in order to stay in sync.

    Posted in: Triggers
  • 0

    posted a message on Units running back and forth between regions (FIXED)

    I have zero experience with Wave AI, but I don't think you can freely reorder units that have been created from Wave AI. It seems like they want to reach their origin destination that was declared by Wave, what makes sense.


    You probably should issue orders to units managed by AI, using its API. There's a bunch of functions there.
    The proper way seems to be get the *waveinfo* from unit and change its *wavetarget*.


    You could also try workaround and remove mentioned unit from the Wave. By calling *Remove Unit From All Waves* action. This should likely stop the AI from redirecting your unit.

    Posted in: Triggers
  • 0

    posted a message on LOTV Timer Window Skin


    Quote from MrUnholy >>

    In reply to Prodigy454:

     Hey prodigy, I looked into what you said. Mind posting where you might find this function's definition? I opened up the code browse via the command line, no luck. Thanks!
    Posted in: Triggers
  • 0

    posted a message on SC2 Bank Issue

    You must explictly declare which banks you want to preload in map properties. There's option for it somewhere in menu, should be called "Preload info".


    In case of using Trigger GUI elements, the editor does that for you (at least it used to), but in case of raw script it doesn't, as it doesn't process it.


    btw. Small notice in regards to your code, when bank fails to verify it doesn't mean the data from it hasn't been loaded, but only that the signature check failed.
    And calling BankLoad again won't erase the data here (unless you do that manually by iterating over sections). Thus you likely want to call BankRemove after BankVerify fails. This guarantees it will be cleared.

    Posted in: Triggers
  • 0

    posted a message on Galaxy IDE as Visual Studio Code extension

    Extension for Visual Studio Code, it attempts to provide IDE-like capabilities for Galaxy Script.

    More about it: https://github.com/Talv/vscode-sc2-galaxy

    There are some screenies in README so you can just take a peek before considering using it.


    If you're not familiar with Visual Studio Code, don't mistake it with Visual Studio. These are totally different, despite the name. The former is totally free and pretty lightweight.

    Can be downloaded here:


    The extension itself is also published on marketplace, thus can be easly installed:


    The initial setup can be done within minutes, really.


    In the past I've attempted to build such extension for Sublime Text. But I failed in developing it further.. it was also awfully slow. The processing backend was written in Python, which isn't known to be fast.. though the slowness was mostly because of design mistakes I made in code parser.


    The new backend is written in TypeScript, and is at least x10 faster (I think way more, didn't really measure it). So the feedback is pretty robust - real time code diagnostic messages etc.

    I'm quite happy with the overall result. There's a lot that can be added though, and I do plan to work on it.


    Backend is LSP compilant, thus it could be ported to other editors with relatively low effort. But I don't plan it myself, as I'm totally settled on VS Code these days. I've been using Sublime and Atom in the past, but in the end I found VS Code to be superior.

    Posted in: Galaxy Scripting
  • 0.963887065003283

    posted a message on [solved]New Update broken Timer window (yes, galaxy script coded)

    You did alright. Apparently we're missing some relevant part of code.. try to add this:

    TimerWindowShowBorder(TimerWindowLastCreated(), true);

    (After TimerWindowCreate)

    Although it is likely that, this alone won't make the frame to appear.


    If you're saying that you do have VoidStory dependency then lets just use mentioned function. From what I can see the code looks correct in post #4. What was the error it printed?
    I suppose it could not work because VCUI library is not loaded. Some libraries aren't auto loaded until you actually take use of functions/triggers it exports. But it does that only when you use it through GUI elements.


    The easiest way to force autoload would be probably to have dummy trigger w/o any events. And just one action:
    Create Timer Window (Campaign)
    the one from UI (Void) library.
    Provide some fake arguments in order for it to compile.


    Once you do that the library should auto load, and all its functions will be accessible from custom script.

    Posted in: Galaxy Scripting
  • 0.963648380700595

    posted a message on [solved]New Update broken Timer window (yes, galaxy script coded)

    Mentioned function relies on several other functions and variables from VoidStory dependency. So you'll either have to copy-paste all of these, or attach the dependency itself into your map.


    If you wnat just the fix, this should do it:

    // ... THIS PART SHOULD COME AFTER TimerWindowCreate
    DialogControlHookupStandard(c_triggerControlTypePanel, "UIContainer\\ConsoleUIContainer\\TriggerWindowPanel\\TimerWindowTemplate");
    DialogControlSendAnimationEvent(DialogControlLastCreated(), PlayerGroupAll(), "HighlightStop");



    But if you're going to create multiple TimerWindows through the game, you'll need to save the hookup id to variable, as it is not possible to create multiple hookups to the same Standard frame IIRC.

    For that you'll need additional global variable, like:

    int gv_timer_frame = -1;

     And the code above would expand to:

    if (gv_timer_frame == -1) {
        gv_timer_frame = DialogControlHookupStandard(c_triggerControlTypePanel, "UIContainer\\ConsoleUIContainer\\TriggerWindowPanel\\TimerWindowTemplate");
    DialogControlSendAnimationEvent(gv_timer_frame, PlayerGroupAll(), "HighlightStop");



    Should work, but keep it mind that I didn't test it at all.

    The code from libVCUI_gf_TimerWindowCreate is for some reason destroying previously created hookup, and then hooks it up again.. but I don't think that's needed.

    Posted in: Galaxy Scripting
  • 0.965277777777778

    posted a message on [SOLVED!] Initial trigger(s) do not fire after publish / disconnected from game

    Okay, I've found out the source of it.
    It's because you've used special BattleUI frame as custom layout frame for loading screen.. BattleUI is actually root frame for Battle.net UI. Apparently trying to use it for loading screen is pretty disruptive :D And something from SC2 cannot recover without a full game restart.


    By curiosity I've tried to use couple of other frames that should not be used for loading screen, but none of it resulted in broken game.
    I don't know what made you use custom layout, and why did you actually pick BattleUI. But this together was worst case possible, haha.


    Generally editor should report about issues like that, but I haven't been seeing anything in the log. So it took a while to find.
    In fact it can be considered as bug, because ideally maps should be sandboxed in SC2. That is nothing you do inside the map should affect the game itself after you quit the map. And destroying Battle.net UI is certainly something that negatively affects user experience ;D


    To summarize, to fix it just just go to *Map -> Map Loading Screen*. Unlink *BattleUI* frame. OK.


    Posted in: Galaxy Editor Bugs and Feedback
  • 0

    posted a message on [SOLVED!] Initial trigger(s) do not fire after publish / disconnected from game

    Okay, I've played with this for a while, and I must say the Allied Commanders mod is not the one to blame. I've dettached it from your map, and also removed quite a lot of other things.. and this weird behavior is still happening.


    This is what I'm observing in my offline tests:
    If I launch your map while being logged in SC2, then I quit it and I'm back at login screen. That means I've been silently disconnected. Also I have black background on login screen, instead of planets. But what's most important I'm unable to login again unless I restart SC2 (it hangs on 'Authorizating..').
    If I launch your map while having SC2 closed, then after map is loaded I quit it (just the map). And that also results in ability to login to bnet.


    This is veeeery weird. I'll get back to this later.

    Posted in: Galaxy Editor Bugs and Feedback
  • 0

    posted a message on [SOLVED!] Initial trigger(s) do not fire after publish / disconnected from game

    What I can tell you know is that I'm getting the same issue when I'm trying to watch replay/resume it. In fact you're already disconnected before the map reaches post init phase - that is before loading screen is gone.

    And the source of it is certainly Allied Commanders mod. I'm not sure why though. Likely it might take use of some blizzard exclusive functions. What results in disconnect when done online (probably because publisher's account doesn't have necessary permissions).

    Although I've read about people using this mod before, w/o any disconnect. So it might be new thing - coming either from recent patch, or update to the mod itself.

    Also it's worth to check if your local version of this mod is the same you linked against in Battle.net (that is v0.36).


    So the question is, do you actually need this mod - are using anything implemented there?

    I'll try to identify what exactly this mod does during its initialization process that ends with disconnect from bnet. But if you want easy fix, just remove this mod from your map dependencies.


    One thing that I noticed before trying out your checklist.
    When I launch my published map through SC2, while the editor is still running in the background, the Editor spits out these error messages when the map causes the disconnection:
    "[10/6/2017 11:52:38 PM] Warning: Battle.net connection is closing: You have been disconnected from Battle.net because another computer connected using your account.
    [10/6/2017 11:52:38 PM] Warning: Battle.net connection was lost"

    That is normal. Editor acts as SC2 client. So when you login in it to the same account and region, and then launch SC2 for the same account and region, you get this exact message. Since server only allows one active connection.

    Posted in: Galaxy Editor Bugs and Feedback
  • To post a comment, please or register a new account.