Snippet Advent

Bribe

vJass errors are legion
Reaction score
67
Every one of your comments shows you just don't get how this works.

1. The first trigger is for storing static codes used by "register". It is attached to the event itself and this trigger can have many conditions attached to it.

2. The other triggers are dynamic, with just one condition each.

3. registerEx returns an integer which represents the registry that was just made.

4. unregister takes that integer and disassembles that registry.

The typecast of "Advent" specifically refers to the parent node that was made via the "create" method. It does not refer to the child-nodes returned by "registerEx".
 

Dirac

22710180
Reaction score
147
No Bribe i already knew the 4 points you stated. And i fully knew what your intentions were (about the first trigger being the one with many conditions and the other's having only one) And i knew this because i read the code, not because i'm trying to prove you wrong.
What you're missing is that it doesn't have to be that way.
My way you can make every "node" have many conditions if you want, the sole action of using registerEx tells the system that this registration fires at the same time the head does.
It's like a circular linked list of triggers.
However each node should be fully manipulable and it also should be removed from the list it belongs without mentioning the head whatsoever, because after all it would make no sense to register the head from itself ([ljass]call this.unregister(this)[/ljass])
The deallocate method should be like the one my linked list has, yes it forces to recycle triggers, but that doesn't cause that much damage. (IMO you should avoid loops whenever you can)
Conclusion, every node should be an Advent, apart from the nodes within it's range
Forcing the user to attach data himself makes thing only more complicate, you're doing this from the idea that every advent could have more than data attachment, and why should it?
Instead of letting the user know which Advent is the one firing this function (when there's no need at all) through the "reg" var, have every Advent store it's own "data" integer var.
 

Bribe

vJass errors are legion
Reaction score
67
I could add a regData member but what if the user wants to attach other things like units, other types, multiple variables, etc? I get that it can save arrays if the user wants it but if the user doesn't want it he must suffer an additional array (which I don't honestly think is enough of a problem for me to not do it).

Why would someone want to multi-register a dynamic sub-trigger of the Advent? I prefer keeping it as integers so the user doesn't do something screwy like firing a node instead of a proper Advent.

Recycling triggers is possible but in reality what's there to lose in destroying them and keeping the RAM/handle ID stack low? The two latter benefits (doing it my way) the user very nicely.

The Advent sharing identity with its nodes doesn't make sense. You create an Advent (say, unit indexed or unit damaged), then register some attachment functions to that Advent. You don't register attachment functions to attachment functions >>
 

Dirac

22710180
Reaction score
147
Just an [ljass]integer data[/ljass] would suffice instead of having to create lots of arrays for every time you want to attach data to advents (like the way you suggest on your documentation of having [ljass]integer AdvData[Advent.registerEx][/ljass] kind of stuff)
If you were using a circular list you could fire nodes and nothing would go wrong using this way
JASS:
local integer exit=this
loop
    call TriggerEvaluate(this)
    set this=next
    exitwhen this==exit
endloop

It wouldn't cause any issues and would provide even more flexibility (i need it for my damage library)
If you want to destroy triggers you might as well loop through the list using the loop above and then flush the list.
 
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!
    +1
  • 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