System Rectwraps

Azlier

Old World Ghost
Reaction score
461
That code is long gone. Maybe I can scrape something together.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
I will wait few weeks for your fix, i don't really have the need actually anyway, and if i remember correctly you can code only the week end, right ?

But if you need some help, feel free to ask me.
 

Trollvottel

never aging title
Reaction score
262
Wont the registerEnter function make problems if you change the size/shape/position of the rect after? as far as i know the triggerregisterenterrect functions are hardcoded so they take the coords of minxx/y and maxx/y and dont change when the rect changes?
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Wont the registerEnter function make problems if you change the size/shape/position of the rect after? as far as i know the triggerregisterenterrect functions are hardcoded so they take the coords of minxx/y and maxx/y and dont change when the rect changes?

Don't confuse rect and regions.

Azlier said:
Last time i played with them, i thought we can edit the region (add/remove rect/cells), and the event handled theses changes.

That makes sense for me.

For example you can morph an unit, but the specific unit event will always fire.
I mean ok you can't change the region associated to the event to an other one, but i don't see why you couldn't edit this region.
But when you add a rect, i don't think it links the rect to the region, i mean it probably just adds the coordinates of the rect, and then if you edit the rect or even destroy it, the region isn't edited as well.
And i'm fairly sure it rounds up to use only 32*32 cells following this formula :

JASS:
32.0*R2I(<real x or y>/32.0)
 

Azlier

Old World Ghost
Reaction score
461
I remember playing with rects and the regions would actually change accordingly. Though I might just be crazy.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Be crazy is fine.

But be lazy is not an option.
Gogo fix it, or at least graveyard it until you haven't fix it.
 

Azlier

Old World Ghost
Reaction score
461
Alright. Update, I guess. Two more methods added, that region thing should be fixed.

It would be nice if someone tested the new isPointOn and isUnitOn methods.

Now, I'm off to steal Jesus4Lyf's documentation template which he in turn stole from Cohadar! Up, up, and away!
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
It seems you did it in the right way. (need to test it though, with my test code and some edits maybe ?)

But more tests are needed, for example what happens when an unit doesn't move, but suddenly a region under these feet is created, does the enter region event fire ?
 

Azlier

Old World Ghost
Reaction score
461
I would guess no. But if so, that doesn't affect rectwraps. I don't think.

That's more "study of rects and regions" area.

Hey, if it does fire, it's a new way to do GroupEnumUnitsInRect :p.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
I'm a perfectionist and i would make this kind of tests before release a such code, but it's up to you.
Anyway i will test it myself if you don't soon.

Hey, if it does fire, it's a new way to do GroupEnumUnitsInRect.

Exactly.

We should also create a trigger and add a specific unit event to it, when an unit enter the map, instead of directly using a player-unit event. :p
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
I think the .wrap thing is bugged.

It kept setting maxX or minX to the wrong coordinate (it should be 2560 or something, but kept going -2560).
 

Azlier

Old World Ghost
Reaction score
461
Oh God. That's a horrible mistake I made in that method. There, fixed :p.

Nobody noticed because nobody needed the coordinate values yet (not even me :p).
 

Azlier

Old World Ghost
Reaction score
461
I finally overcame my laziness and fixed the replaceTerrain, setPathing, and iterateThrough methods. They are faster, safer, and cleaner than before.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Evaluate a trigger open a new thread as well as execute it , and since it is supposed to be faster use .evaluate instead of .execute ?
Also i'm pretty sure you miss few cells with the pathing method.

As far i remember it applies for 32*32 cells but the formula for finding which cell will be considered is R2I(X/32.)*32.
Where X can be the X and the Y of the coordinates.

I suppose i'm not clear at all, but i still can make a demo map if needed.
 

Azlier

Old World Ghost
Reaction score
461
.evaluate doesn't exactly get around the op limit for some reason. Only .execute managed to replace all the terrain in a 96x96 map.

>Also i'm pretty sure you miss few cells with the pathing method.

It missed cells before. So, no idea.

This one uses the native in the middle of the cell instead of the top left corner, where real inaccuracies might cause... strange happenings.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
.evaluate doesn't exactly get around the op limit for some reason. Only .execute managed to replace all the terrain in a 96x96 map.
Are you really sure about that, because at least inside an initializer ExecuteFunc,TriggerExecute and TriggerEvaluate get around the limit op.
I know many "respected" users assumed only .execute (and ofc ExecuteFunc) open a new thread, but i can say that is just-an-other-pseudo-fact-which-was-never-tested.

About the cells i did it like that :
http://www.wc3c.net/showthread.php?t=101317
 

Azlier

Old World Ghost
Reaction score
461
I'm positive. .evaluate filled merely 3/4 of the map, while doing nothing but replacing .evaluate with .execute caused it to fill the entire map.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Oh well, it's trickier, TriggerEvaluate opens a new thread or not depends the environment, i will do more tests and post samples codes and conclusions later. (in the jass forum i guess xD)
 

Azlier

Old World Ghost
Reaction score
461
So I'll keep .execute because it's guaranteed to start a new thread, then.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top