| 07-13-2008, 03:40 PM | #2 |
Make a proper jass script of it, or submit it with [trigger]-tags. Nobody's going to read it while you have bj_forLoopAIndex instad of... well... i However, my suggested approach would be something like: JASS:local integer r=300 local real phi=0 loop // The first loop is the radius exitwhen r>=600 // The inner(second) loop is the angle set phi=0 loop exitwhen phi>=2*bj_PI // Create unit at (r*Cos(phi),r*Sin(phi)) set phi=phi+whatever_increment_you_want endloop set r=r+100 endloop |
| 07-13-2008, 08:04 PM | #3 | |
Quote:
About your suggestion, you are trying to start the circle from outside and then complete its inner section, can you give me a more detailed example, I think that may be what I am looking for. I'll give +rep =S |
| 07-13-2008, 08:49 PM | #4 |
JASS:globals private constant real MAXRADIUS = 2000 private constant real MINRADIUS = 500 private real X private real Y endglobals blah blah blah private function Enum takes nothing returns boolean return IsUnitInRangeXY(GetFilterUnit(),X,Y,MAXRADIUS) and not IsUnitInRange(GetFilterUnit(),X,Y,MINRADIUS) endfunction blah blah blah private function blargh takes nothing returns nothing local location t=GetSpellTargetLoc() local group g=CreateGroup() set X=GetLocationX(t) set Y=GetLocationY(t) call GroupEnumUnitsInRange(g,X,Y,MAXRADIUS+200,Filter(function Enum)) endfunction EDIT: DAMN MY FAILURE TO READ!!!! |
| 07-13-2008, 09:09 PM | #5 |
Very well... JASS:// Made by Themerion // Requirements: none // function CreateCircleTimed takes: // // forPlayer -> Create the units for which player? // innerRadius -> The radius of the innermost circle // outerRadius -> The radius of the outmost circle // circleCount -> How many circles will there be? // x and y -> Origo of circles // fxcount -> How many effects will the @innermost circle@ consist of? // fxcountinc -> How many more effects will be used to build up the next cirlce? // time -> How long before the units of the circle dies? // unitid -> What unit-type does the circle consist of? // If you set fxcountinc=0, the units will appear to stand in a line. function CreateCircleTimed takes player forPlayer, real innerRadius, real outerRadius, integer circleCount, real x, real y, integer fxcount, integer fxcountinc, real time, integer unitid returns nothing local real r=innerRadius local real radiusInc=(outerRadius-innerRadius)/I2R(circleCount-1) local real phi=0 local real phiInc loop exitwhen r+0.001>=outerRadius set phi=0 set phiInc=2*bj_PI/I2R(fxcount) loop exitwhen phi+0.001>=2*bj_PI // We create the unit, and we want it destroyed instantly so... call UnitApplyTimedLife(CreateUnit(forPlayer,unitid,x+r*Cos(phi),y+r*Sin(phi),180+Rad2Deg(phi)),'BTLF',time) set phi=phi+phiInc endloop set r=r+radiusInc set fxcount=fxcount+fxcountinc endloop endfunction |
| 07-14-2008, 10:56 AM | #6 |
MMm Thx thermedion, but I won't use effects =S The circle will be used with dummy units not effects. Also is there a way to calculate the number of dummy units automatically ? Please change the code, If you do so, you will get + rep and be credited in the spell I will soon submit (yes, another one). |
| 07-14-2008, 11:11 AM | #7 |
Did you even read the code? He is using units, not effects. |
| 07-14-2008, 11:50 AM | #8 |
JASS:// fxcount -> How many effects will the @innermost circle@ consist of? // fxcountinc -> How many more effects will be used to build up the next cirlce? EDIT EDIT EDIT In fact, now I understand he likes units. Thx =) Just one thing, i don't like creating a unit every time a cicle is repeated. Is there a way to only kill the units from the circle, when do something like "call data.destroy" ?? EDIT EDIT EDIT Never mind, I am working on changing the code right now =) |
