• 0

    posted a message on Create draw distance with triggers?

    What exactly is the difference between removing items and using the fog of war performance wise? Objects that are not visible on the screen are not rendered by your graphics card at all and the fog of war can remove all non-terrain objects from the screen, thus prevent them from being rendered. You can set structures to not display within the fog of war and I assume the same could be done to doodad objects.

    I'm just trying to clarify exactly what it is you're trying to do that requires extra work.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Find the size of an array?

    @Nevir24: I tried using a const int inside of my a record variable and errors popped up. -.-' The error was something like "The variable is not a record type". I swear, there are so many bugs with records. It works fine when const isn't checked, you just have to remember to never change the value anywhere.

    @Mille25: Yeah, it's possible inside of galaxy script. I'm considering doing it this way so that if someone changes the value of MAX_PLAYERS, the array size is automatically updated and you don't have to change both the array size and the constant value. I assume that it's not allowed in the GUI because the declarations of variables, triggers, and actions are non-linear. Adding this feature would add some form on linearity to it (you must set the constant before you set the array size). There's no way for the compiler to know at what point the constant is declared (at initialization or within a trigger or wherever). I agree though, it'd be nice to allow array sizes to be declared with a variable.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Parameter Allow Multiple

    @SiNiquity: Go

    The "allow multiple" behavior has been acting wonky for me. Even with only one parameter and having "allow multiple" enabled on it, I'll receive compiler errors if there are more than 1 parameters calling the action definition. But yes, even if I can get rid of this compiler error ("Script failed to compile: Wrong number of parameters"), it's not intuitive at all how to access the various parameters.

    I found s3rius reply on custom triggers in this thread: http://forums.sc2mapster.com/development/map-development/3788-where-to-write-scripts-when-using-editor/

    I attempted to use the advice in that thread and make a custom function such that:

    void gf_addPoints (point lp_points, ...)  //and similar calls like this
    

    I believe the ", ..." is how it's done in C, but it didn't work here with a compiler error on that line. :( I wish I could look at the "combine multiple text" galaxy code for myself to see how it's done.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Find the size of an array?

    I was figuring I'd need to resort to what you've said, but I figure if it were possible to do a [].size() or similar, it wouldn't hurt. The magic numbers that I'd get rid of are in for loops, ex:

    for (i=0; i+=1; i<12). The magic number, obviously, being 12 that could be replaced with MAX_PLAYERS.

    edit: The "+ +" (no space) markup is annoying.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Find the size of an array?

    Is there any way to find the size of an array through a trigger? I tried making a custom script of:

    gv_array.size()

    but it didn't work. :( I'm basically trying to do this for future debugging concerns with "catching" exception and also to get remove some of magic numbers, so I'd prefer not making a variable if I can get away with it, otherwise, magic numbers and strange looking default error messages it is.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Warp in from warpgate to a specific region/point?

    Use an Issue Order command and select the opening parenthesis for the "Select Ability" field and change it to "Use ability at point". The unit training abilities should be somewhere in there.

    I'm not looking at the editor atm, so the names may be slightly off.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Trigger,Data] Automatically Train Units

    I wanted to point out that you're not using the And condition correctly in the Train Marine trigger of this tutorial. The way you have it set up in the video:

    if
      (owner of (triggering progress unit)) == 1
        And
          Conditions
            (Unit Type (triggering progress unit)) == Barracks
    then
    

    What this is saying in Galaxy is:

    if ((UnitGetOwner(EventUnitProgressUnit()) == 1) && ((UnitGetType(EventUnitProgressUnit()) == "Barracks") &&))

    Notice the '&&' at the very end. This is the 'And' that is in your trigger and it is automatically removed from the script. When there are multiple statements in a condition clause, such as in your trigger, the script automatically puts an '&&' between them, thus the first '&&' in the Galaxy statement above. Because of this, you end up getting your desired effect from the trigger, even though it's implemented incorrectly. It's a good thing you weren't wanting to use an Or statement, otherwise it wouldn't have worked out for you. :) If you want to use the 'And' statement correctly, here's how it should look:

    if
        And
          Conditions
            (owner of (triggering progress unit)) == 1
            (Unit Type (triggering progress unit)) == Barracks
    then
    

    You may decide to use the above for readability purposes, but since you know that '&&' is added automatically between conditions, you also have the option to simplify the condition to:

    if
      (owner of (triggering progress unit)) == 1
      (Unit Type (triggering progress unit)) == Barracks
    then
    
    Posted in: Tutorials
  • 0

    posted a message on Refer to variable in Custom Script

    @PepperLoaT: Go

    In case what s3rius said didn't clear it up, I'll anaylze his custom script of "lv_ability_command[lv_tempInteger]" that you would place in the Select Ability Command portion of the action.

    "lv_": "lv_" (either one of them) can either be "lv_" (local variable), "gv_" (global variable), or "lp_" (local parameter), which designates where the variable is located.

    "ability_command": To find the value that belongs here, select your array variable and look for "Script Identifier:" The value listed here should replace "ability_command".

    "tempInteger": This is the integer variable that refers to the index of your array. Find the name you need for the custom script in the same way as "ability_command". You can replace "lv_tempInteger" with an integer value, such as "0", if desired.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Medic ability

    You'll need to turn the Stimpack ability from type "Effect - Instant" to "Effect - Target" in order to get your medic to cast Stimpack on others.

    Posted in: Miscellaneous Development
  • 0

    posted a message on What's the difference between a point and a region?

    Here's 2 scenarios, one where you can only use a point and one where you can only use a region:

    1) region: Find the number of units within a region. It's impossible to find the number of units in a point since there is a cap of 1 unit per point allowed.

    2) point: Tell the AI to cast an ability at a specific location. If you try to Issue an order targeting a region, that's a lot of room for error.

    Sure, there are a lot of things can be done with either a point or a region, such as "create a unit at location", but there are also a lot of things that make them distinct.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Help with a SPELL "throwing like"

    It sounds like an error in one of your effects. Look for a "Target - Impact Location +" is set to either "Source Unit", "Source Point", or "Source Unit/Point". You want to change the field value to "Target Point". Looking at the actual Raven ability:

    1) Launch Missile effect is set to Target Unit 2) Create Unit effect is set to Target Point

    Posted in: Miscellaneous Development
  • 0

    posted a message on Starcraft II DotA: Storm of the Imperial Sanctum

    Someone told me the map I am making is a DotA-ripoff, but I had never played DotA before.... I ended up playing a game of it just to see and he was right (to my dismay). 3 paths leading to the enemy base, waves of mobs fighting each other. Oh well.

    I hope your map and my Cerebrates map don't step on each others toes when July 27th hits!

    Posted in: Project Workplace
  • 0

    posted a message on Event How To: "If a change has occurred" ?

    If I understand your trigger correctly, I'm not exactly sure why you need a trigger to needlessly proc every second. Though maybe there's more to it that I don't know about. I *think* if a unit dies within a region, a "unit leaves region" event is procced, but I could be mistaken, so I'd test it before taking my word on it. The following 2 global variables and 2 triggers should switch the ownership of a region when one player has more units than the current owner of the region without proccing the trigger once every 1.0 seconds.

    Global Variables:
    NumOfUnitsInRegion[X] = {0, 0 ...}  // Adjust 'X' to the number of players
    CurrentRegionOwner = 0  // '0' denotes player 1
    
    Events
      Unit - Any Unit Enters <Region>
    Local Variables
    Conditions
    Actions
      Set NumOfUnitsInRegion[((Triggering player) - 1)] = (NumOfUnitsInRegion[((Triggering player) - 1)] + 1)
      General - If (Conditions) then do (Actions) else do (Actions)
        If 
          And
            ((Triggering player) - 1) != CurrentRegionOwner
            NumOfUnitsInRegion[CurrentRegionOwner] < NumOfUnitsInRegion[((Triggering player) - 1)]
        Then
          CurrentRegionOwner = ((Triggering player) - 1)
        Else
    

    Events
      Unit - Any Unit Leaves <Region>
    Local Variables
      PlayerNum = 0
    Conditions
    Actions
      Set NumOfUnitsInRegion[((Triggering player) - 1)] = (NumOfUnitsInRegion[((Triggering player) - 1)] - 1)
      General - If (Conditions) then do (Actions) else do (Actions)
        If
          ((Triggering player) - 1) == CurrentRegionOwner
        Then
          //Adjust "X" to the number of players in your map below
          For each integer PlayerNum from 0 to X with increment 1, do (Actions)
            Actions
              General - If (Conditions) then do (Actions) else do (Actions)
                If
                  NumOfUnitsInRegion[CurrentRegionOwner] < NumOfUnitsInRegion[PlayerNum]
                Then
                  CurrentRegionOwner = PlayerNum
                Else
        Else
    
    Posted in: Miscellaneous Development
  • 0

    posted a message on Issuing Order to build a building {advanced}

    @Zero0018: Go

    Thanks for creating this thread, Zero. I'm able to remove a bug from my map that I was planning on looking into later, but now I have an answer right here instead. (In about 10% of my maps, one of the two bases would spontaneously stop building, pretty major bug that doesn't happen consistently.) This thread made me realize that I wasn't removing the Drone from the worker group, which I assume selecting a Drone that is already building a structure caused the bug.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [solved (nub mistake)] Copying Summon Nydus Worm

    God I feel stupid for bringing up this thread now. Apparently a Nydus Network is a requirement for the Summon Nydus Worm ability. Alls I have to do is remove the requirement from the ability. -.-' Marines don't have a Barracks requirement in the Train Marine ability, why does the Summon Nydus Worm have a Nydus Network requirement? :-/ I swear I was trying to figure it out for over an hour and the solution is ultra easy.

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