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.
  • 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!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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