HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Will this leak...?

05-03-2007, 08:33 AM#1
Tide-Arc Ephemera
Trigger:
GT Wheel Spin
Collapse Events
Time - Every 0.03 seconds of game time
Conditions
Collapse Actions
Set WheelPoint = (Random point in EntCenter <gen>)
Unit - Move Wood Spirit 0002 <gen> instantly to WheelPoint
Set WheelPoint = (Random point in EntCenter <gen>)
Unit - Move Wood Spirit 0002 <gen> instantly to WheelPoint
Set WheelPoint = (Random point in EntCenter <gen>)
Unit - Move Wood Spirit 0002 <gen> instantly to WheelPoint
Set WheelPoint = (Random point in EntCenter <gen>)
Unit - Move Wood Spirit 0002 <gen> instantly to WheelPoint
Custom script: call RemoveLocation (udg_WheelPoint)

I'm just curious, because I'm lazy, would t his leak?
05-03-2007, 08:44 AM#2
Earth-Fury
yes. you must remove the location before you change its value. every time.
05-03-2007, 10:07 AM#3
Tide-Arc Ephemera
I see... well... this will take some time to do (this is pretty much a wisp wheel type object thing which I learned from scratch)... um... +rep?
05-03-2007, 10:31 AM#4
Fireeye
Another way would be to move the location, you can do it with the following command, so you don't need to clear it when you use the same variable all the time. (As much as i know, i can be wrong of course, but then someone will say it ^^)
Collapse JASS:
native MoveLocation             takes location whichLocation, real newX, real newY returns nothing

A GUI call would look like
Trigger:
Custom script: call MoveLocation(udg_WheelPoint,GetRandomReal(MinX,MaxX),GetRandomReal(MinY,MaxY))

MinX and MinY are the lower bounds of your rects and MaxX and MaxY are the upper bounds.
05-03-2007, 11:49 AM#5
Tide-Arc Ephemera
Well... there's a mild problem there... one being I'm using this for a wisp wheel based function type thing (as said before), this was just a sample of what COULD be going on.

And um... frankly... I don't know how to use JASS very well. If someone can teach me how to use polar offsets, that'd save time and a shizzum load of commands in my triggers.
05-03-2007, 10:10 PM#6
Pyrogasm
Polar offset is rather simple actually.
Trigger:
Set SomeNewPoint = SomePoint offset by 200.00 towards 96.70 degrees
In the above action:
  • "SomePoint" is the originating point, from which SomeNewPoint is based on
  • "offset by 200.00" is the distance from <the origin point> the new point will be created (regular WC3 distance)
  • "towards 96.70 degrees" is the angle at wich the new point will be created <the above distance> from <the origin point>
05-03-2007, 11:20 PM#7
MaD[Lion]
it will leak cus of the random points