• 0

    posted a message on Preview image flipped by editor upload to bnet?

    @dimfish: Go

    I have. I'm guessing you're on a Mac. I've reported this bug about a dozen times but they never fix it.

    Posted in: Galaxy Editor Bugs and Feedback
  • 0

    posted a message on Patch 1.1 Desync Issue

    My set of fairly popular maps, Cortex Roleplay, has been rendered basically useless with the new patch 1.1. For some reason, when the game starts, everyone gets a "Desync!" message and the game ends for them instantly.

    I'm still tracking down this issue but if anyone would have any ideas or has this problem, too, that'd be great help.

    Posted in: Triggers
  • 0

    posted a message on Bank Issue With Mods

    @TheFallenOne222: Go

    I have a library that makes use of BankPreload for me, and it works fine, from within the library.

    Posted in: Galaxy Editor Bugs and Feedback
  • 0

    posted a message on Galaxy FAQ

    I'm writing this because I see a lot of the same questions regarding Galaxy asked several times, and I think it'd be useful to consolidate this information into one thread.

    Q: What is Galaxy?

    Galaxy is a C-like scripting language that Starcraft 2's triggers are coded in. The Trigger Editor GUI actually creates XML code that helps the editor generate the actual Galaxy to do the work.

    If it's a trigger, it's programmed in Galaxy.

    For those who are thinking of learning C to learn Galaxy, don't. Most of the time you'll spend learning C will be wasted because those features don't exist in Galaxy. If you're determined, skip everything regarding memory management and casting at least.

    Q: Why should I care about Galaxy?

    You probably don't have to. It all depends on your preferences. GUI is often described by non-technical users as easier to read and to use. It's certainly easier to get started with if you're new to programming. People who already have experience in programming languages may prefer Galaxy simply because it's what they're used to, and they don't have to click through the GUI windows.

    There are a few things that GUI can't do that Galaxy can, also. But these are generally easily worked around by using custom script blocks.

    Q: How can I learn Galaxy?

    As with all things, practice makes perfect. Start by writing some basic triggers in the GUI. Then, click Data and hit View Script. The Script Editor will open and show you the generated Galaxy code. GUI is notorious for generating hard-to-read instructions, but it's a good starting point. You can see how to call GUI functions by clicking Data and then View Raw Data. This will show the normal method names as defined in Galaxy. Note: If the function isn't a native, then it's prefixed by libNtve_gf_

    Q: I heard Galaxy has a 2 MB size limit. Is this true?

    Yes, and no. Galaxy is only capable of addressing 2 MB worth of data due to the internal workings of it's code. This does not mean that you can't have more than 2 MB worth of triggers or .galaxy files. This limit is in terms of memory allocation. For example, an int is 4 bytes. It would take 524,288 ints before you reach this limit. For all practical purposes, you don't need to worry about this. If you do need to worry about this, chances are you're allocating memory irresponsibly. Avoid doing things like int[100][500] as it actually allocates 50,000 ints.

    Q: Can I see a list of all the natives?

    Here you go. This paste will help you with basic naming. I recommend you use GUI as a reference while you're learning, though. You can see how to call GUI functions by clicking Data and then View Raw Data. This will show the normal method names as defined in Galaxy. Note: If the function isn't a native, then it's prefixed by libNtve_gf_

    Q: Can I do X with Galaxy?

    Can you do it with GUI? If so, yes. If not, then the answer is still probably no. Galaxy isn't magic. Most "complex" system are just large problems that are broken down into smaller problems to solve the larger one. For example, I notice a lot of people asking how to give 10 minerals every minute to the player controlling a region, like in a King of the Hill-style map. A skilled programmer can break this into smaller parts, rather than just looking for one easy solution. He knows he needs to periodically, every 60 seconds, determine who is in control of the hill (create a region for the hill) and for each player, find out how many alive units are on the hill, and see who has the most. Then, he may reward the victor.

    Q: How do I convert Text to String?

    You don't. You can only concatenate them and compare their pointers for equality. If you want to work with texts and strings, convert the strings to text.

    Q: Where's Game Links, players, dialogs, and other types that GUI had?

    GUI lies about what the types of some things are. Game Links for example are all strings, and players are ints. "Marine" is the game-link of the Marine unit. If you need to figure out what's what, go to the GUI and see what the Preset type is, then go under the folder Support and find that type. If Raw Data is on, you'll see the real type.

    Q: In GUI I saw an option for Threads, how does this work in Galaxy?

    See above: GUI lies. There are no threads in GUI. What happens is the next event is run "pseudo-in-parallel" to the current one, rather than branching off, completing, and going back. Nothing in Galaxy can truly run in parallel. Thus, locking mechanisms are never needed. :)

    Q: Is there something I can use for intellisense and editing, like in other languages?

    Not officially, but grim001 made a really nice NotepadPlusPlus extension that handles intellisense as well as syntax highlighting for Galaxy. You can check it out here.

    Posted in: Galaxy Scripting
  • 0

    posted a message on [Events] attempting to create events

    You can create custom events, you just have to be creative. Make an array of trigger[123] or some reasonable number, then have your event save the callback in that array. Repeat for any params the event may have.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Should I learn the scripting lanaguage?

    @Jercy: Go

    It all depends on how you like to work with your logic. Personally, as a programmer, I like working with just the raw scripting language.

    For a lot of people though, GUI offers a lot of good features and sheer simplicity.

    As for how to "learn" Galaxy, start by learning basic C syntax. Nothing too complex, don't even bother with memory management or anything remotely beyond a 101 level. Hell, if you understand any programming language, Galaxy won't be a difficult learn.

    Start by making something simple like Hello world in GUI. Then hit Data -> View Script. That's the raw Galaxy code, and that's basically how you start learning.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Chat Received Event can read your whispers.

    @progammer: Go

    I hope they do. I'm just trying to bring their attention to it so that they can. It makes for example, my custom chat system very hard to do because PMs end up being publicized as well, which is obviously unintended.

    I'm just really pushing this bug report now because I've reported it before and nothing got done.

    Posted in: Galaxy Editor Bugs and Feedback
  • 0

    posted a message on Chat Received Event can read your whispers.

    No, that's completely unrelated.

    Make a simple test map, make it write to the UI every time a player sends a chat message using a chat event.

    Then publish it, go in-game, and whisper one of your friends on your buddy list using the Tab thing on the chat window. You'll find your message gets read by the map.

    This shouldn't be happening, by definition. It's a whisper transmitted through Battle.net and shouldn't involve the map at all.

    Posted in: Galaxy Editor Bugs and Feedback
  • 0

    posted a message on Chat Received Event can read your whispers.

    Cross-posted from: http://us.battle.net/sc2/en/forum/topic/627973187

    Quote:

    I've reported this before on the beta forums but it seems nobody ever listens.

    In the Map Editor, you can create a trigger which binds to chat events. In WC3 this worked fine and lets the map maker parse and read what a user types.

    The blatant problem in SC2 is that, if you hit tab to reply to a player because someone whispers you, the map can read this private conversation.

    Again, this isn't the Private player-to-player map chat, these are your private whispers to friends.

    The message log might not show the message, but the map chat event trigger does fire.

    This particularly poses problems for me, since I do my own chat system and rely on chat events. It's rather embarrassing when your whispers get written into the chat box as normal chat.

    Posted in: Galaxy Editor Bugs and Feedback
  • 0

    posted a message on Attached Region To Unit

    @DirtyDevious: Go

    That would make sense.
    Otherwise, this native would have no point. :P

    Posted in: Miscellaneous Development
  • 0

    posted a message on Cortex Roleplay

    I've updated screenshots with stuff that is now possible in 1.1 Beta. The newer screenshots also include real Battle.net roleplaying in action.
    Everything you see in these maps are player-created, even the majority of doodads, giant leviathan-overmind-thing, and Enter buttons.

    Posted in: Project Workplace
  • 0

    posted a message on 2MB or 2.5MB trigger restriction

    @vjeux: Go

    To put the memory limit into perspective, we have 2^21 bytes of memory available for our use. That's 2,097,152 bytes. Assuming that an int is 4 bytes (usually is), we can have 524,288 ints stored at once in our triggers, before we hit the limit.

    So unless you're doing very stupid things like int[1000][500] you almost assuredly will never hit this limit in normal practice.

    Posted in: Galaxy Editor Bugs and Feedback
  • 0

    posted a message on It is impossible to manage banks through Galaxy

    Apparently what happens in GUI when you call BankPreload() is that GUI enables some crazy flags that generates BankList.xml among other things.
    It is impossible to manage banks if you're going through raw Galaxy and using normal calls like BankLoad(). The banks will always fail to load, 100% of the time, even if you do generate and fill in BankList.xml

    Another huge disappointment, Blizzard.

    Posted in: Galaxy Editor Bugs and Feedback
  • 0

    posted a message on I see Preserve Trigger is gone...

    @Vexal: Go

    Triggers would basically automatically turn themselves off in SC1 after they ran, from what I understand.

    Posted in: Miscellaneous Development
  • 0

    posted a message on I see Preserve Trigger is gone...

    @Mesden: Go

    In SC2, all triggers are "preserved". Every single time the event is run, the trigger runs.
    Unless the conditions aren't met.
    So make a condition.

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