• 0

    posted a message on Removing A Dependency

    Hmm I seem to have ruined my map with this... Same problem as OP, I'm not sure how to get rid of fake dependencies.  Anyone have any suggestions?

    Posted in: Data
  • 0

    posted a message on Follow Unit Smoothly

    Just worked on this same thing today and I wanted to document more clearly for anyone else.

     

    The cleanest solution is simply to use built-in follow (ctr-shift-F) or create a trigger and edit the camera options in the data editor.

     

    In the Cameras tab, select Default Camera and edit the following fields:

    (Basic) UI: Target Smooth - 0.0000:0.0000:0.0000:100.0000
    (Basic) UI: Displacement Minimum 0.0000
    (Basic) UI: Smooth Time Maximum 0.0000
    (Basic) UI: Smooth Time Minimum 0.0000
    (Basic) UI: Velocity Maximum 100.0000

     

    Posted in: Galaxy Scripting
  • 0

    posted a message on Change Model for Right Click Move Target?

    When you have one or more units selected in the game and right click in the world, four little animated arrows will appear indicating your target point.

     

    I figure this should be accessible in the data editor somewhere, but I'm not proficient in the data editor and can't find it.  Suppose I wanted to just do something simple like make this move-target model smaller, semitransparent, or a different color.  Is there a way to do that?

    Posted in: Data
  • 0

    posted a message on Reference Parameters

    I'm trying to make a function take a parameter by reference... Checked the box to use reference and in the script it's still not a reference.

     

    How does this work?

    Posted in: Triggers
  • 0

    posted a message on Access subregions of a region?

    Can I access the subregions of a region in a trigger?

     

    For example, suppose I wanted to write a function (psuedo-C code here just to demonstrate the idea),

    float area(Region r) {
       float area = 0;
       for (Region subregion : r) {
          area += subregion.height * subregion.width;
       }
       return area;
    }

     Would this be possible in the SC2 editor?

    Posted in: Triggers
  • 0

    posted a message on Space Background

    Oh my goodness... I was driving myself crazy trying to figure this out, and today I just restarted the editor and it was suddenly working.  Changed nothing.  Aieeeeeeeeeeee

    Posted in: Terrain
  • 0

    posted a message on Space Background

    I'm trying to create a space background for my map.  As a model, I created an empty map on Braxis Alpha Ex2 tileset, and looked at the data there.  (In that tileset, if you draw a low cliff, it turns into space, which is what I want.)  I took their texture set and copied the attributes Background Model (Fixed), Background Model (Not fixed), Camera, etc, but I ended up with a kind of broken variation:

     

     

    What did I miss?

     

    (Note that it's important that I add this space background functionality into my already existing map, rather than start over from a blank space map.)

    Posted in: Terrain
  • 0

    posted a message on A Fatal Error Has Occurred - Every time I test my map

    Yep, that's basically what I ended up doing and it turned out to be a stack overflow happening in the map initialization triggers.  In the future I will know to look at map initialization for this type of problem, I don't think other triggers could cause a crash during loading.

    Posted in: General Chat
  • 0

    posted a message on A Fatal Error Has Occurred - Every time I test my map

    How would I go about debugging this.  Today I created a map, and every time I try to play it, I get the generic "A fatal error has occurred" message when the map is about 80% loaded.

     

    I've restarted my computer, reopened the map, tried in trigger debug mode, tried disabling trigger preloading, all to no avail.

     

    All that's in my "messages" box (where errors often appear in the editor when opening/saving a map) is:

     

    [5/18/2019 8:01:05 PM] UI: File [StandardDialog.SC2Layout] Line [189] Column [9]. Unknown type attribute [Browser] for: [Browser].
    [5/18/2019 8:01:05 PM] UI: File [DescIndex.SC2Layout] Line [110] Column [5]. Failed to load included Desc File [UI/Layout/Glue/LobbySlot.SC2Layout].
    [5/18/2019 8:01:05 PM] UI: File [DescIndex.SC2Layout] Line [111] Column [5]. Failed to load included Desc File [UI/Layout/Glue/LobbySlotSetup.SC2Layout].
    [5/18/2019 8:01:05 PM] UI: File [DescIndex.SC2Layout] Line [275] Column [5]. Failed to load included Desc File [UI/Layout/Glue/ScreenMulti.SC2Layout].
    [5/18/2019 8:01:05 PM] UI: File [DescIndex.SC2Layout] Line [276] Column [5]. Failed to load included Desc File [UI/Layout/Glue/ScreenNetwork.SC2Layout].
    [5/18/2019 8:01:05 PM] UI: File [DescIndex.SC2Layout] Line [281] Column [5]. Failed to load included Desc File [UI/Layout/Glue/ScreenLobby.SC2Layout].
    [5/18/2019 8:01:05 PM] UI: File [DescIndex.SC2Layout] Line [282] Column [5]. Failed to load included Desc File [UI/Layout/Glue/ScreenNetworkLobby.SC2Layout].
    

     Would be happy to send my map for a firsthand look, I just don't want to post it publically here.

    Posted in: General Chat
  • 0

    posted a message on Basic Data Editor Question
    Quote from Alevice >>

    swithch to xml view and check if your unit id is right

     The Unit IDs are all the same as the basic names.
     
    Quote from DrSuperEvil >>

    You using tokens?

     I'm not sure what tokens are, so probably not.  I could upload a new clean map with just this unit added if my explanation wasn't clear enough to see the problem.
     
     
    --
     
    I won't worry about this for now, I've worked around it.  But the data editor is definitely my weak point, and I need to figure this stuff out at some point.
    Posted in: General Chat
  • 0

    posted a message on Basic Data Editor Question

    I know there are a lot of old threads and tutorials on this topic, but so many of them are gutted (the pictures are too old, and not showing).

     

    In short, I've created a custom unit and get the error: "Unable to create unit actor.  Creating fallback sphere unit."  In-game, I see both the model that I expect to see, and the default sphere on top of it.

     

    What I did:

     1) Created a new unit called "VortexUnit", race Protoss, object type Unit.  Edited some flags like cannot be clicked, cannot be targeted, invulnerable, and so forth.

    2) Created an actor called "VortexActor", added an event on UnitBirth.VortexUnit - Create, and on UnitDeath.VortexUnit - Destroy.  Set the Art: Model field to "Vortex Model" (which then links to "Assets\Effects\Protoss\SingularityAreaImpact\SingularityAreaImpact.m3").

    3) Added a trigger to create 1 "VortexUnit" at a point, and tested the map.

     

    So I must have missed a step or two.  Could anyone help fill in what I need to do?

    Posted in: General Chat
  • 0

    posted a message on UI Error in All Maps

    Thanks, I know it's not a problem for my map functioning correctly on Battle.net, I was just wondering if there was a way to get that annoying error message to go away.

    Posted in: General Chat
  • 0

    posted a message on UI Error in All Maps

    All my old maps and blank new maps that I create have this UI error.  I'm wondering if other people have this problem, and/or if there's an easy fix.

     

    UI: File [StandardDialog.SC2Layout] Line [189] Column [9]. Unknown type attribute [Browser] for: [Browser].

     

    Posted in: General Chat
  • 0

    posted a message on Starcraft 2 - Square Root Function Behaviour

    Thanks, the specification for their fixed type is very helpful.  I will investigate further in my spare time :)

     

    It looks like it's very simple knowing that.  Reproducing SC2's results was as simple as (python again):

     

    def frac(x, den):
        num = int(x*den)
        return num/den
    
    def to_fixed(x):
        return frac(x, 4096)
    
    def sc2_sqrt(x):
        return to_fixed(to_fixed(x)**0.5)

     

    This function sc2_sqrt(x) produces the same results as SC2 now.

     

     

    The real moral here is just that SC2 uses a fixed-precision data type as described by Talv.  If any unusual behavior comes up, it's because of how the values are stored.

    Posted in: General Chat
  • 0

    posted a message on Starcraft 2 - Square Root Function Behaviour

    I was recently exposed to the oddity of the SquareRoot function in Starcraft 2's Engine.

     

    For example

    SquareRoot(10.5) ==> 3.2402

    This is quite far, and in a strange manner so, from the correct value (computed from a python console):

     

    10.5**0.5 = 3.24037034920393


    However, it seems to do better with integers (though I am still using the fixed/real version), for example
    it computes the square root of 24 as 4.899, which is accurate at least to that many digits.

     

    Does anyone know what this function is actually doing?  Is there a way to find out?  This is quite curious.

    Posted in: General Chat
  • To post a comment, please or register a new account.