System Bars

Deaod

Member
Reaction score
6
1.) Perhaps, yes.

Then what can the best be described as?
Im sorry, you lost me there. What do you want me to describe?

It has construction.
Which is an irrelevant feature of a bar. Make a separate library for that, which deals specifically with the problem of associating a bar to a construction process.
 

Sevion

The DIY Ninja
Reaction score
413
2) I want everyone to use what is best (ideally there should only be one library).

Why would I make a separate library?

Do you mean the library should only deal with the creation of a bar, the movement of a bar, and the value of a bar and other libraries/modules implement features such as health, mana, construction, and custom tracking?
 

Deaod

Member
Reaction score
6
Why would I make a separate library?
As i said a few sentences later, when all else (talking the coder of the current "best" into adding a feature) fails and the current "best" library does not have an important feature, you should probably write your own.

Do you mean the library should only deal with the creation of a bar, the movement of a bar, and the value of a bar and other libraries/modules implement features such as health, mana, construction, and custom tracking?
Exactly. You dont need to mix code for those things. They can be implemented outside the library at a very low cost of performance.

Btw, why did you include support for locking the bar to an item or a destructible? Both cant move on their own.
 

Sevion

The DIY Ninja
Reaction score
413
Atm, I'm very busy, but I'll reply to that last line for now, will edit for more later.

I added items and destructables because what if units pick up the item/destructable? It then starts moving.
 

Nestharus

o-o
Reaction score
84
JASS:
                set this.Mixed.red = R2I(RAbsBJ(this.Color1.red*(1-ratio)-this.Color2.red*ratio)+.5)
                set this.Mixed.green = R2I(RAbsBJ(this.Color1.green*(1-ratio)-this.Color2.green*ratio)+.5)
                set this.Mixed.blue = R2I(RAbsBJ(this.Color1.blue*(1-ratio)-this.Color2.blue*ratio)+.5)


this can be this.mixed.asMix(this.Color1, this.Color2, ratio)

And ???
JASS:
    //! textmacro Bar__CONFIGURABLE_GLOBALS
        private constant string BAR_CHAR = "'"
        private constant integer NUM_CHARS = 30
        private constant integer NUM_CHARS_CONSTRUCTION = 80
        private constant real BAR_SIZE = 11.00
        private constant real X_OFFSET = -35.00
        private constant real Y_OFFSET = -40.00
        private constant real Y_OFFSET_MANA = -14.00
        private constant real X_OFFSET_CONSTRUCTION = -65.00
        private constant real Y_OFFSET_CONSTRUCTION = -40.00
        private constant real X_OFFSET_CUSTOM1 = -35.00
        private constant real Y_OFFSET_CUSTOM1 = -40.00
        private constant real X_OFFSET_CUSTOM2 = -35.00
        private constant real Y_OFFSET_CUSTOM2 = -40.00
        private constant real X_OFFSET_CUSTOM3 = -35.00
        private constant real Y_OFFSET_CUSTOM3 = -40.00
        private constant integer BACKGROUND_RED = 10
        private constant integer BACKGROUND_GREEN = 10
        private constant integer BACKGROUND_BLUE = 10
    //! endtextmacro


Create bar config structs or something and just pass those in... one global configuration to be forcefully applied to all bars seems stupid.. you also don't have comments around your configuration variables to explain what they do. For example, I get offset, but what is custom1 through custom3???

There is this too..

JASS:
    //! textmacro Bar__GetCustomData1
        set i = GetUnitUserData(this.unit)
    //! endtextmacro
    //! textmacro Bar__Custom1EndCondition
        set b = this.max - 1 < T32_PERIOD
    //! endtextmacro
    //! textmacro Bar__GetCustomData2
        set i = GetUnitUserData(this.unit)
    //! endtextmacro
    //! textmacro Bar__Custom2EndCondition
        set b = this.max - 1 < T32_PERIOD
    //! endtextmacro
    //! textmacro Bar__GetCustomData3
        set i = GetUnitUserData(this.unit)
    //! endtextmacro
    //! textmacro Bar__Custom3EndCondition
        set b = this.max - 1 < T32_PERIOD
    //! endtextmacro


And what is up with your custom stuffs? For customs, users can just use a location + an interface for the ratio.. seriously : P.

And really, because you can avoid interfaces and what not, you can just make them call a method with their values and pass their function into the timer...

JASS:
private static method periodic takes nothing returns nothing
    call bar.update(x, y, ratio)
endmethod

public static method create takes nothing returns thistype
    call Bar.create(this, function thistype.periodic) //will auto add to a timer and start if function thistype.periodic not already added
    //or you can use struct types like onInit { thisType = Bar.getType(); } and then 
    //create(this, function thistype.periodic, thisType)
endmethod



Furthermore, mixed should be static..
 

Deaod

Member
Reaction score
6
I added items and destructables because what if units pick up the item/destructable? It then starts moving.
Destructables cant be picked up, AFAIK.
Attaching to items could be externalized, as items cant move and can only be moved by a unit (and code). If the item you want to follow is in a units inventory, attach the bar to the unit.
Changing an items position could be captured using hooks (same applies to destructables).
 

Sevion

The DIY Ninja
Reaction score
413
Destructables can be picked up using the Grab Tree ability.

Items can be moved out of the loop, that is right... Hmm. I would need to add some sort of Update function. Hold on, I'll rewrite a few things quick.

Nes, the only reason I was using my own asMix was because I haven't updated the code yet to show the .asMix use. I had it earlier, but you remember your little.... problem...

Edit: I won't be able to update stuff for a while. I'm going on vacation until July 10.
 

Sevion

The DIY Ninja
Reaction score
413
Sorry for not updating anything. I really haven't worked on it, but this is what I have done:

JASS:
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~ Bars ~~ By Sevion ~~ Version 2.0.0.0 ~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//  What is Bars?
//          -A sandbox for creating floating bars.
//
// Configurables:
//
//  API:
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Be amazed at the amount of work I did in the long period of time.....

But yes, I am taking your advice and making this very modular. Bars itself will basically be a sandbox with many mini-libraries (modules) to add functionality with Bars only having the very very core components.

Hopefully it's a bigger success than this is atm.
 

Sevion

The DIY Ninja
Reaction score
413
Currently, Mana tracking is implemented into the core.

JASS:
call Bar.createOnUnit(GetTriggerUnit(), TRACK_TYPE_MANA, 0, Color.create(0,0,255), 0)


That will change with the 2.0 update.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top