• 0

    posted a message on Unit properties unique?

    @Enexy: Go

    Sorry I should clarify, what if each player had two marines and I only wanted to change the name of ONE them (ie; a specific unit)?

    Posted in: General Chat
  • 0

    posted a message on Triggered chat messages to log

    Sending chat messages to the chat channel works just fine 'n all, and looks like someone spoke, only difference is triggered chats don't show up in bnet's Message Log. Any quick way to do that? (Aside from making my own custom message log dialog, I know that)

    Posted in: Triggers
  • 0

    posted a message on Unit properties unique?

    Can you data edit just one type of "Marine", but through triggers set different instances of that unit to have a different name?

    Example, making 2 preset "Marine" on the map, each belonging to player 1 and player 2, and naming each player's marine to "Player 1" or "Player 2"?

    I understand this can be done in the data editor just by duplicating the Marine and changing it's name, but I'd rather not do that.

    Posted in: General Chat
  • 0

    posted a message on Bank scope

    @soulzek: Go

    Think I just answered my own question. Since banks are linked to a specific player when opened, it'd probably be bad to have a global that's pointing at another player's bank or some goofy stuff like that.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Bank scope

    I've tested making my bank object global and persistent throughout the life of the map, as well as a bank object local to the functions and doing BankLoad() every time. Both work, but since I can't find detailted documentation on how the internal file stream works, does anyone know if a global bank or a local bank with frequent Loads is more appropriate?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Time of Day >= a Number? [SOLVED]

    @soulzek: Go In GUI he doesnt even need to use seconds to compare the times. He can just enter "12:00:00" and the function will convert it to seconds aswell. This also works in galaxy using strings.

    Example:

    if (getTimeOfDaySeconds(GameTimeOfDayGet()) < getTimeOfDaySeconds("12:00:00"))
    {
         //its before noon
    }
    else
    {
         //its after noon
    }
    

    This is true, and does make it more readable (thats what comments are for!), though it is significantly more efficient to just pre-calculate any hard-coded values as the converted number since string parsing and manipulation is slow.

    Posted in: Triggers
  • 0

    posted a message on Time of Day >= a Number? [SOLVED]

    @Yaksmanofage: Go

    string   GameTimeOfDayGet();
    

    This is a SC2 function that returns to you the current game time of day as a string. It is formatted as mentioned above. I printed it to the screen as a test and the default starting time (this map was essentially blank and had no time of day manipulation) was "06:00:00".

    Using Mille's function, you can pass the current game time of day to his function, get a numeric value back and compare that against whatever you want... for example noon would be 43200 (3600 * 12).

    if (getTimeOfDaySeconds(GameTimeOfDayGet()) < 43200)
    {
         //its before noon
    }
    else
    {
         //its after noon
    }
    

    Here is another example to see if the time is between 5pm and 6pm.

    int nTimeOfDay;
    nTimeOfDay = getTimeOfDaySeconds(GameTimeOfDayGet());
    if (nTimeOfDay >= 61200 && nTimeOfDay <= 64800)
    {
         //its between 5pm and 6pm
    }
    
    Posted in: Triggers
  • 0

    posted a message on EventMapInit vs my own

    So right now I basically have two main init functions; my custom one for my custom script, and a trigger that fires off from Map Initialization. I kept them seperate because I assumed there might be important differences like one is the loading screen and one is actually ingame.

    So the question is: Is there truly a need for the Map Initialization trigger or is doing everything in my own code init just fine? Like what if I tried to start setting map/ingame data like a pre-placed unit's health in my own init? Would it happen too soon or does it not matter?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Banking & Security

    As with most things editor related, a lot of stuff on the internet from 2010 and 2011 is out of date. I wanted to ask the current editor community what the situation is with secure bank files nowadays? I see Blizzard implemented their own signature, is that enough to rely on or should I double it up and combine that with something like Starcode?

    Or is this all still pointless because of things like unlocking maps (is this still possible)?

    Looking for suggestions.

    Posted in: Triggers
  • 0

    posted a message on Dialog Z-ordering

    Alright thanks. At least I don't have to research it any further now lol

    Posted in: Triggers
  • 0

    posted a message on Dialog Z-ordering

    I found a native function that lets you set the priority on a dialog ITEM control, but nothing for dialogs themselves. Do they just automatically sort based on creation time? Is there any way you can make a custom display purposefully display over or underneath the game UI such as the chat window?

    Posted in: Triggers
  • 0

    posted a message on Clicking on triggered chat message

    I am showing a chat message to players with areas of importance contained within the text, such as a specific player's name. How can I go about handling being able to click on either that portion of the message, or even simpler just the entire message itself to invoke an event like opening a dialog?

    My only lead so far is generically handling a mouse click on the entire game UI, calculating the width/height of the specific text I sent as a chat message, seeing if it newline-wrapped, etc, etc, etc to get a bounding area specific to that chat message using the default mouse click event. As determing this bounding area would be an obscene amount of work, are there any alternatives?

    Posted in: Triggers
  • 0

    posted a message on how to- define a local variable

    Your example isn't necessarily wrong, it's just that galaxy script is (so) bad that you have to declare all local function variables at the top of the function before you attempt to execute any statements.

    So, instead of:

    void somefunc()
    {
         SomeSC2Function();
         if (checking stuff...)
         ...
         int x;
    }
    

    Just do:

    void somefunc()
    {
         int x;
         SomeSC2Function();
         if (checking stuff...)
         ...
    }
    
    Posted in: Galaxy Scripting
  • 0

    posted a message on Dynamic Array Unit Indexer

    @DieHappy1234: Go

    I was just referring to SoulCarverr's post when he said it's not dynamic, it's just a big array. That defeats the purpose of something being dynamic, because if it's there the whole time then it's not dynamic. It won't effect game speed, only memory (as long as you loop for the actual count and not the entire array limit, as you said).

    Posted in: Galaxy Scripting
  • 0

    posted a message on Dynamic Array Unit Indexer
    Quote from SouLCarveRR: Go

    It may not be all that dynamic.... but having the memory declared the whole time lets you know your in good shape and it wont bog the game down if it starts filling up.

    While this is probably as close as dynamic can get for galaxy scripting, it is never something you should do. I've just come to terms with galaxy not supporting dynamic allocation and code with that in mind.

    Posted in: Galaxy Scripting
  • To post a comment, please or register a new account.