HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

A few quick questions

01-26-2007, 12:53 AM#1
WNxCryptic
1. Do the triggers "Visibility - Disable Fog of War" and "Visibility - Disable Black Mask" cause server splits?

I've got a map that whoever in Grey's position would automatically get disconnected 5 seconds into the map...and occasionally other colors would get disconnected too...but as soon as I removed the visibility triggers, I got no more disconnections.

2. What is the JASS function for deallocating regions?

RemoveLocation( udg_loc )

Works for deallocating a point variable called "loc," but what deallocates variables of type "Region" ?
01-26-2007, 01:13 AM#2
Av3n
Well just your first one, black mask you shuoldn't disable it since there is no black mask created at the beginning of the game.

-Av3n
01-26-2007, 09:51 AM#3
StockBreak
Quote:
Originally Posted by WNxCryptic
1. Do the triggers "Visibility - Disable Fog of War" and "Visibility - Disable Black Mask" cause server splits?

I've got a map that whoever in Grey's position would automatically get disconnected 5 seconds into the map...and occasionally other colors would get disconnected too...but as soon as I removed the visibility triggers, I got no more disconnections.

2. What is the JASS function for deallocating regions?

RemoveLocation( udg_loc )

Works for deallocating a point variable called "loc," but what deallocates variables of type "Region" ?

2. You can use the following function:
Collapse JASS:
native RemoveRegion takes region whichRegion returns nothing
01-26-2007, 12:56 PM#4
Nu'Rah
Hi I am new here !
I like this forum and everything is nice respect!
Can the attack speed of a unit be increased by using a trigger?
And how?
Thank You!
01-26-2007, 03:47 PM#5
oNdizZ
Nu'Rah, I'm sure your question has been asked and answered before so you should try to make a search and if you just don't feel like doing that, atleast create your own thread instead of hijacking others.
Anyways, try messing around with the attack speed ability that the items use.
01-26-2007, 04:50 PM#6
WNxCryptic
lol..my thread got temporarily hijacked...

Quote:
2. You can use the following function: JASS:
native RemoveRegion takes region whichRegion returns nothing

I've tried this, it gives me a compile error, but I don't remember exactly what it says, I'll duplicate it and get back to you.
01-26-2007, 06:54 PM#7
oNdizZ
you do know that GUI regions is infact rects and that JASS regions is something else?
01-26-2007, 07:12 PM#8
The)TideHunter(
Yes, oNdizZ is correct.
To make a region, you would simply do:

Collapse JASS:
local region r = CreateRegion()

But what GUI creates is not a region, but a rect, which is literally the same but GUI uses it for its stuff.

While if you wanted to create a Rect (Which is GUI version), then you would use:

Collapse JASS:
local rect r = Rect(MinX, MinY, MaxX, MaxY)

Regions use cells while rects dont, rects just use the Min/Max X/Y.

And both of rects and regions have theyre remove functions.

Collapse JASS:
native RemoveRect               takes rect whichRect returns nothing
native RemoveRegion             takes region whichRegion returns nothing

Dont get confused with deallocatation, you merly need to remove the handle (such as a effect, a region, rect, unit or whatever), but setting a variable to null will deallocate the variable, not the handle. You need to remove and set to null to be clear of memory leaks.
Example:

Collapse JASS:
    local rect r = Rect(...)
    call DoStuffWithRect(...)
    call RemoveRect(r)
    set r = null
01-26-2007, 09:01 PM#9
Av3n
But all your rects in the GUI events then convert and thats your rects JASS name.

-Av3n
01-28-2007, 05:25 AM#10
WNxCryptic
So even with other variables, such as locations, "RemoveLocation( udg_loc_var)" does not suffice for memory leaks? I also need to go through and set that loc_var to null?

Or is setting a variable to null only for local vars?
01-28-2007, 05:27 AM#11
Av3n
Umm loc var is the location name, alos removeLocation destroys the location which means no memory leaks

-Av3n
01-28-2007, 06:21 AM#12
WNxCryptic
So when should I be certain to set a variable to null?

With only certain variable types? For non-global variables?
01-28-2007, 10:40 AM#13
BertTheJasser
Set local handles (non-int,no-real non-string vars) always to null, even globals (The even hostage an handle indices, but I am not 100% sure if this really matters for gloabls as they use the space through the whole game..), except, they stay through the whole game.
01-28-2007, 11:20 AM#14
The)TideHunter(
Quote:
Originally Posted by Av3n
Umm loc var is the location name, alos removeLocation destroys the location which means no memory leaks

-Av3n

Duh. loc is not just a variable name, it takes memory too, its a pointer. RemoveLocation will remove the handle (the actual thing) but you need to set the variable to null to remove the pointer.

EDIT: Read this post to find out more about leaks, it was posted not long ago.