System Rectwraps

Azlier

Old World Ghost
Reaction score
461
I still don't see how it would help. At all. You would have to attach the struct to the handle to make it work as it should.
 

Azlier

Old World Ghost
Reaction score
461
Would simplify syntax, indeed. But you still need to attach the struct to the region and/or rect.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Hm. Depends how it's implemented, then. He may be right. We'll have to wait and see.

Because "extending handles" to me, means instead of an integer index, it will be a real handle, so its kind of like a thin wrapper. Which wouldn't help here, I imagine. But this wouldn't allow struct members. If it's implemented as "rect" becomes an integer, and JassHelper automatically reads rect.actualRect or whatever, then yes, this could work with it. But at the end of the day, this must pass around an integer. :)
 

Azlier

Old World Ghost
Reaction score
461
Optional, alternate interfaces are now available. Just like the one in Trackable2.
 

Jesus4Lyf

Good Idea™
Reaction score
397
JASS:
    method registerEnter takes trigger whichTrigger, rectwrap which returns nothing
        local region reg = CreateRegion()
        local trigger t = CreateTrigger()
        local Cache c = Cache.create()
        local RegionList r = RegionList.create()
        set c.toFire = Event.create()

This can't be right... can it? A new event for every registration? Shouldn't it be one event per region? Did I miss something? >_>
 

Azlier

Old World Ghost
Reaction score
461
Is it? I really don't remember it anymore. Oh, wait. Yesss. Now I remember. If you don't create a new event for each rect, it runs the trigger as many times as how many rects you registered.

Anyway, what are the RegionLists for? I forget.

EDIT: Ahhh, yes. RegionLists are there to clean things up after struct destruction. Riiight.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Lol err... I'm pretty sure you butchered this somewhere along the line. The idea of Event is you don't know how many triggers will be attached. The way you've used it, only one can be attached. But if you wanted two triggers to trigger off entering the same rect or region, it should add to the same event... <_<?

But it doesn't?

May be time to rewrite this from scratch using your new experience if you can't remember how it works... XD :p
 

Azlier

Old World Ghost
Reaction score
461
Maybe I should just trash the event and store the trigger. Yes.

EDIT: Done. Oh, and Event is no longer needed. Efficiency gain, too.
 

Azlier

Old World Ghost
Reaction score
461
Total rewrite.

There is now only one body, the rectwrap. The system is now much more efficient, it actually works dynamically (better than the natives, in fact). The code is also shorter. Rects, regions, and triggers are also recycled. Today is a good day for rectwraps. Just needs some heavy testing. It passed my light testing.

Could someone change the thread title to Rectwraps, please? There is no R&R. Not anymore.

Requires Event once again.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Hey, I actually read through it! You seem to have done it correctly this time 'round. Well done, credits to you. The code is nicely commented and was actually nice to read! :thup:

You don't need to set TrigRec to 0 or whatever I think. In your event-firing triggers. That's about it.

Well done. This actually looks quite usable and neat now. :D
 

Azlier

Old World Ghost
Reaction score
461
>You don't need to set TrigRec to 0 or whatever I think.
I do if I want it to behave like a true WC3 event. If I called it somewhere random in, say, a timer callback, I would get the last triggered rectwrap. Kind of weird to have around.
 

Azlier

Old World Ghost
Reaction score
461
Update. The wrap method now works with a copy of the rect, preventing possible bugs with the recycler and prevents the user from messing with the rect directly.
 

Azlier

Old World Ghost
Reaction score
461
There is a constructor that takes reals. It's .create. .wrap just takes an existing rect, making gg_rct rects easy. Don't think I haven't thought this over.
 

Azlier

Old World Ghost
Reaction score
461
Well, it used to toss the rect you gave it into the recycler. Which means modifying the rect at a later time could ruin a random rectwrap within the system. Also, it overwrote anything else that might be in there, causing a memory leak. Copying the rect is safer and memory leakless (except in the case of the original rect, which the user may destroy or use more).
 

Azlier

Old World Ghost
Reaction score
461
Does anybody find this useful? Or is it just me? It's one of the things I made that I actually use :p.
 

Azlier

Old World Ghost
Reaction score
461
Meh. Alternate interface exists once more, for EGUI (should Sevion want rectwraps in there) and those who don't know structs.
 
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

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top