• 0

    posted a message on Library Requests

    So I was looking for something with a scrollbar or similar. I could not find a single working solution, which led my to create my own.

    It would be really cool if someone made a library off of it for future use.

    Things that would be nice:
    - actual border image (not just a single color)
    - movable slider position
    - option for horizontal slider (or both at the same time)

    What it can do right now:
    - hold as many dialog controls as you want (or even other instances of itself)
    - keep visible content the same while adding/removing content
    - scroll through the content
    - create multiple instances (1 per struct instance)

    Important information:
    To capture the mouse, giantic invisible dialog controls are used. If the parent is too small (the mouse moves outside without hitting the invisible controls) the slider will react to any mouse down, no matter where on the screen.
    Using a fullscreen dialog fully avoids that problem.

    Keep in mind that this is a lot more sluggish in multiplayer but still grants a lot of power over the content.

    Example content (wavedisplay for a td):
    - 101 x content areas (0 - 100) named "Wave 0" to "Wave 100"
    - pseudo content for the waves:
    clicking on the wave button extends the content area and adds 1 additional random line
    first click also adds a close button (that works)

    edit: I pull back my request for a library for the moment. As a matter of fact, my current project needs more than my previous snippet can do, so I willl give creating the library a try.
    Might ask again if the results are too far from what I intended.

    edit2: Solved all my problems, fulfilled my own request :P
    library submission

    Posted in: Trigger Libraries & Scripts
  • 0

    posted a message on several questions - sotis styled "dialogs" etc..

    I do think that posts like hobbidudes are still useful, even after 2 years. I didn't know the picture he posted and I just had to bookmark it.

    Everyone always says "use the search function" and adding useful knowledge to old threads makes that a useful way of going at it.

    Well, that's just how I think about it.

    Posted in: Triggers
  • 0

    posted a message on Variable References

    I pull back my question, some more googling got me the answer. It is not as nice as I thought but still a vast improvement:

    Functions are referenced like this:

    void exampleFunction(){ }

    void exampleFunction2(){ }

    funcref<exampleFunction> someFunction=exmapleFunction;

    funcref<exampleFunction> someOtherFunction = exampleFunction2;

    struct abc{ int a; int b; };

    abc theStruct;

    structref<abc> structReference=theStruct;

    gonna find out now whether it works or not :P

    Posted in: Triggers
  • 0

    posted a message on Variable References

    I just stumbled upon the following in the patchnotes 1.5.0: "New support has been added for passing structure, array, and function references as function parameters. "

    I googled it and searched the sc2Mapster forums, but couldn't find more descriptions about it.

    Testing it myself I get 2 different error message for different approaches: "Invalid parameter list" and "Can only pass basic types"

    In case that I just missed it and it is indeed implemented, please give me (or link me to) an example.

    PS: From a developer point of view, this feature would be so sexy, I'm already getting wet dreams about it.

    Posted in: Triggers
  • 0

    posted a message on (solved)Default Map Option help

    @XenoZergNid: Go

    In case you are still searching, I found an answer via google, after I found this.

    The test map needs to be in the Maps folder inside the Starcraft 2 folder (where you installed it).

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Pending] [Library] Arkless Table Space Library (ATSL)

    EDIT: Not looking here anymore, use it if you want, remove this thread if it buggs you
    I don't like looking here every few days to see if something has to be update only to see that there isnt a single post in ages. And its not only this topic, its the whole f*ing forum...

    Description

    I was bothered by not being able to allocate memory on the run, so I made this library to organize the Data Table to work as possible replacement.

    • allocating parts of the data table (no overlapping)
    • includes stack
    • includes infinite array imitation
    • includes an iterator for array imitations with a fixed size

    Installation

    import the library, has to be below the natives

    Additional Information

    • Speed:
      The Data Table is slow, very slow. I already heard from a lot of fellow map developers that it is "evil" and should never be used.
      That is, in fact, true (at least the part where it says slow). But at long as you keep it below 100.000 operations (read or write already created entries) per second you wont even feel a difference to normal variables.
      Creating 100.000 new entries costs roughly 0.5 seconds, so you might want to keep big initializations splitted to multiple ticks (wait(0.0625) every 5000 entries for example) or do them on startup
    • Limitations:
      The Data Table is limited. Very limited. After shoving 30940 string entries into it the game stops working (trigger errors on every trigger).
      This also happens to all data types I tested except for reals (gui name of fixed), integers and booleans. (haven't tested much more)
      However, the amount of Integers, Reals and Booleans is UNLIMITED!
      Considering this, the library mainly uses integers for the internal functions. The only place where limited types are used is the "Allocator".
      Whenever you initialize an "Allocator" in a new subtable (one that has never been an Allocator) 1 string is saved in the datatable.
    • Drawbacks
      ATSL needs 1 char as separator. This should not be used or entrynames could overlap.
      It is at the very top in the library, you may change to any char you dont use anyways.
    • You do not lose control over the whole datatable. everything not starting with the separator still belongs to you (you can even use the separator in those strings, just not as first char).
      Every subtable that is created can be used like a whole new datatable (including adding more structures like arrays allocators and stacks)

    How to

    getting started:

    Calling the function "Tables - Get New" gives you a new TablePosition.
    Good job, you now have your first SubTable and can start saving values!

    saving/loading

    Use the string you just aquired as name in any of the "save data table value" actions/"value from data table" functions.

    records

    You want to save more than a single value? Globally save the name under wich you want to save each particular value.
    Concatenate the name to the right side of your subtable.
    example: var = load(subtable + myHero)
    (load being any of the load functions, myHero being a string variable)
    Adding a suffix for the type is a good idea, as mixing up always results in loading 0 or null (myHero (unit)).

    arrays

    There is that one particular datafield that you want to be an array?
    Use "Tables - Array - Get Array Position" to get the string reproducing that array position.

    stacks

    First you need a subtable.
    Call "Tables - Stack - Initiate at Position(subtable)" to set up the stack.
    Push(subtable) and Pop(subtable) both return a string, wich is a subtable as well. The subtable returned by "Push" should be filled with all the data you want to read when you "Pop" the subtable again.

    allocators

    First you need a subtable
    Call "Tables - Allocator - Initiate at Position" to set up the allocator.
    You can now start Allocating and Recycling subtables!

    Last notice:

    When using data with a fast pace, allocating and deallocating a lot, do not clear the table entries, use a single allocator for every record type for a maximum chance of reusing every entry that was already initialized.

    edit: uploaded version 1.0, removed a bug where reallocating a used value gave back a wrong position

    • fully backwardscompatible
    • Allocateable as integerPosition support (in case you want to use it with unit custom values)
    Posted in: Trigger Libraries & Scripts
  • 0

    posted a message on (Solved) Text Display For Individual Unit Armor.

    I'm not so sure what you actually want to do. But if you want to display something when a specific unit is selected... just do it.

    setup: create a dialog item at the position of your choice (for the normal unit interface it has to be related to the bottom (centered, so just bot) or the position changes for different graphis settings)

    Event: unit selected/deselected if: only 1 unit is selected [count of units in "units selected by triggering player" = 1] then: show dialog item and display the value on it else: hide dialog item

    edit: If you want it in the little popup when you mouseover the armor icon, you could probably create a transparent dialog image abouve the actual item and display the text normally displayed + 1 line you add. (text concatenation works for that, you can just read the data while the game is running) this is just a guess...

    Posted in: Data
  • 0

    posted a message on 1.4.0 patch notes

    @Lonami:

    At the moment the system doesn't really allow different game modes. If you get the via a vote or host, someone will leave because he doesnt like the setup that way. If you add them as different variant, the map will lose popularity because it splits into two choices in the gamelist with their own popularity.

    Not only that, if you add like 3 options that can all be toggled on or off you have to create ~8 variants.

    Imagine 10 options (far more than 100 variants), then try to find one single variant where the lobby is not empty.


    And those "options" are just small changes, like "higher startresources", "all random" or "cheating ai".


    On the password protection I agree, it's not needed :P.


    EDIT:

    nativelist, anyone, plox? :P

    Posted in: General Chat
  • 0

    posted a message on Two triggers. One needs to prevent the other from firing.

    You have a trigger create somewhere (if you use gui it is at the bottom of the "trigger" you can see in the list on the left side). The one that should prevent the other from running is supposed to created abouve the other (for gui: move that trigger abouve the other in the list on the left side). Use a global boolean wich is normally set to true. Whenever your first trigger runs, set the boolean to false. When your second trigger runs, check the boolean, if its true, execute, else change the boolean to true.

    Posted in: Triggers
  • 0

    posted a message on autocasting an ability when there is no ground unit within its range

    Give it 2 hidden attacks, one for air, one for ground. Those attacks share their cooldown with the normal attack (and their cooldown is slightly higher), they are also hidden.

    The groound attack issues the viking to land and the air attack issues the viking to fly again.

    Posted in: Data
  • 0

    posted a message on Single direction firing

    use validators to check the angle

    Posted in: Data
  • 0

    posted a message on Best way to make minions (similar to Diablo 2 Necromancer)?

    @Vexal:

    NOT 100% sure it works, but i'd try to use the broodlords escort ability ang give those escorts an attack. Try it if you get no other reply :D

    Posted in: Data
  • 0

    posted a message on Action-Kill Unit 1 if Unit1 is dead kill Unit 2
    if you want to do it a lot cleaner and need to kill more than just 2 units do it like this:
    global unit array[number of units] UNITS
    global integer COUNTER = 0
    on init:
       UNITS[0] = first unit
       UNITS[1] = second unit
    ....
    whenever you want to kill a unit:
    kill UNITS[COUNTER]
    COUNTER = COUNTER + 1
    
    Posted in: Triggers
  • 0

    posted a message on A really dumb question, I know.

    @vaykcr: Go

    Posted in: Galaxy Scripting
  • 0

    posted a message on Drop off minerals at allied command centre?

    @nodgene: Go

    I was unable to find any simple solution.

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