Guest Sancdar Posted June 15, 2007 How about making the color change actually do something? At least changing the damage type would be nice, but maybe also some minor special abilities associated with each element? E-Splash, F-DoT, L-slow, D-range, N-higher damage, and a W-quick attack? Right now, the tower is surprisingly bland for being the most colorful. Go to top Share this post Link to post
0rb3r Posted June 15, 2007 I think its a really great idea, it would make the tower more unpredictable, which is exactly the role it has. E-Splash, F-DoT, L-slow, D-range, N-higher damage, and a W-quick attack L-high Range, D-High damage, N-slow sounds to me more logical, but despite of that its a really nice improvement on my side. I would also like to sintonize furter towers after the first, so that they use same spectrum and attack at the same time. Go to top Share this post Link to post
Guest mrchak Posted June 15, 2007 The original idea was to change the attack element on each attack Red - Fire Orange - Earth Yellow - Light Green - Nature Blue - Water Purple - Darkness The only way to do that as far as we could figure was to have 6 towers and cycle between them constantly. There was a concern that this would create a lot of laggy problems. Of course, you can do ANYTHING with JASS, right? Go to top Share this post Link to post
Cisz Posted June 15, 2007 So basically what you are are going at is to randomify rainbow? So that it will leak every 7th creep and do overkill to another 7th? And as a result the tower would be as unreliable as dino, but without the splash? More like another lightning? Remind me - who uses lightning on vh? Go to top Share this post Link to post
Guest GkJ-mo Posted June 15, 2007 on the other hand: rainbow is definitly overpowered right now, you can win vh with rainbow and well Go to top Share this post Link to post
Guest Sancdar Posted June 15, 2007 So basically what you are are going at is to randomify rainbow? So that it will leak every 7th creep and do overkill to another 7th? And as a result the tower would be as unreliable as dino, but without the splash? More like another lightning? Remind me - who uses lightning on vh? Ideally, I don't think you'd be expecting to 1-shot creeps with the tower in the first place. I figure the abilities would help to counteract the difference in effectiveness of each attack, although I realize that "range" isn't really helpful. But come on, Rainbow's just boring. We have two other single-target damage triples already, and nobody really uses any of them. Go to top Share this post Link to post
Cisz Posted June 15, 2007 We have two other single-target damage triples already, and nobody really uses any of them. We have? Or do you mean long range single target towers? Long range towers suck ofc. Rainbow and gold are the only short/med range single target towers with composite damage. Go to top Share this post Link to post
Karawasa Posted June 15, 2007 To be frank, I think Rainbow as an idea might get the axe. I don't see a way to salvage it, rather I would like to brainstorm a new idea and replace it altogether. That is why I cannot emphasize enough the Tower Ability Wishlist thread. Getting a pool of potential abilities and characteristics is essential to move forward. Go to top Share this post Link to post
Guest mrchak Posted June 15, 2007 Since the period tower is sortof like a morphing rainbow tower as things stand, I guess Fire, Water, Nature can be something else... Although I like the eye candy of the pretty colors(sure that's a stupid reason, so sue me). By the way, do pro players use that periodic tower ever? I think its a great addition to the game, but I am not a professional Element TD player, just a recreational player; Do pros ever use the Periodic tower? Go to top Share this post Link to post
Guest Sancdar Posted June 16, 2007 I use it, but just because it looks tight. That and sometimes on random you really don't have jack besides all 6 elements. Go to top Share this post Link to post
Guest The)TideHunter( Posted June 17, 2007 The original idea was to change the attack element on each attackRed - Fire Orange - Earth Yellow - Light Green - Nature Blue - Water Purple - Darkness The only way to do that as far as we could figure was to have 6 towers and cycle between them constantly. There was a concern that this would create a lot of laggy problems. Of course, you can do ANYTHING with JASS, right? Its quite easy to do that with Jass. Using Type Casting, you can store the current element of the tower in a integer to that tower, then when the unit attacks, add the morph into next tower, order it to use it, then remove the ability. You can't do everything with Jass, but you have alot more capabilities. And there is a truely amazing thing with Jass, the new language which was made by Vexorian, called vJass. There is vJass and vJass compiler, you can use new, special syntax in Jass, then when you save the map, vJass parser changes all the vJass code into real Jass code, so you can do a stupid amount of new things, dynamically and easy. For example, i could make my own new handle type, called Projectile, which has damage, speed, target, model, attacker, etc all stored into this one handle, like a unit. I can then make functions that take this new handle, like: function StartProjectile takes projectile p, target t returns nothing ... endfunction It is truely amazing. A while ago i started to make my CF functions, which we intended to be a huge range of functions that can make your mapping life so much easier, as a open source resource for anybody to use. I'll show my CFEffectHandler here. There might be some problems, havnt updated it in months, didnt have the time. Ok, first is my CF Engine which is needed to run CF modules. Each of these codes should go in seperate triggers. The CF Engine is: //! library CFEngine initializer InitCFEngine//***************************************************************************************//*//* Casual Functions Engine v.1.0.1//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯//*//* Requires://* - vJass Preprocessor to parse this code//* - A dummy unit with Vexorian's dummy model//*//* Note://* This Engine is only used to run all other Casual Functions modules.//* This Engine does nothing on its own.//***************************************************************************************globals gamecache cfcache = null constant string COLOUR_RED = "ff0000" constant string COLOUR_BREAK = "|r" constant string COLOUR_START = "|c00" string array error boolean array errorread boolean CFEffectHandler_enabled=true boolean CFHeightModifier_enabled=trueendglobals//=======================================================================================// Constantsconstant function DummyUnitRawcode takes nothing returns integer return 'h000'endfunctionconstant function MorphAbilityRawcode takes nothing returns integer return 'amrf'endfunction//=======================================================================================// Run to initialize CFEngineprivate function InitCFEngine takes nothing returns nothing call FlushGameCache(InitGameCache("cfcache")) set cfcache = InitGameCache("cfcache") set error[0]="Dummy Unit Rawcode constant is not set up in the CFEngine library." set error[1]="Morph Ability Rawcode constant is not set up in the CFEngine library." set error[2]="CFEffectHandler is not enabled" set error[3]="CFProjectileHandler is not enabled"endfunction//=======================================================================================// Errorfunction CFError takes integer i returns string local string s = COLOUR_START+COLOUR_RED+"CASUAL FUNCTIONS ERROR #"+I2S(i)+" - "+error[i-1]+COLOUR_BREAK if(not errorread[i])then set errorread[i]=true if(i==1)then set CFEffectHandler_enabled=false return s+" Action taken while ingame: Disabled CFEffectHandler Disabled CFProjectileHandler" elseif(i==2)then set CFHeightModifier_enabled=false return s+" Action taken while ingame: Disabled all CF that use height modification" endif return s endif return " "endfunction//=======================================================================================// Trigfunction LocXOffset takes real x, real distance, real angle returns real return x+distance*Cos(angle*bj_DEGTORAD)endfunctionfunction LocYOffset takes real y, real distance, real angle returns real return y+distance*Sin(angle*bj_DEGTORAD)endfunctionfunction DistanceBetweenXY takes real ax, real ay, real bx, real by returns real local real a=bx-ax local real b=by-ay return SquareRoot(a*a-b*b)endfunction//=======================================================================================// Safe X/Yfunction IsXSafe takes real x returns boolean return (x<GetRectMaxX(bj_mapInitialPlayableArea) and x>GetRectMinX(bj_mapInitialPlayableArea))endfunctionfunction IsYSafe takes real y returns boolean return (y<GetRectMaxY(bj_mapInitialPlayableArea)and y>GetRectMinY(bj_mapInitialPlayableArea))endfunctionfunction IsLocSafe takes real x, real y returns boolean return IsXSafe(x) and IsYSafe(y)endfunctionfunction SetUnitXY takes unit u, real x, real y returns nothing if(IsLocSafe(x,y))then call SetUnitX(u,x) call SetUnitY(u,y) endifendfunction//=======================================================================================// Print to all playersfunction Print takes string msg returns nothing if(not (msg==" "))then call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,msg) endifendfunction//=======================================================================================// Colour's and Hex (Thanks Pitzermike)function ColourToInteger takes integer r, integer g, integer b, integer a returns integer return r+g*0x100+b*0x10000+a*0x1000000endfunctionfunction IntegerGetRed takes integer i returns integer if i<0 then return ModuloInteger(i + 0x80000000, 0x100) endif return ModuloInteger(i, 0x100)endfunctionfunction IntegerGetGreen takes integer i returns integer if i<0 then return ModuloInteger((i + 0x80000000) / 0x100, 0x100) endif return ModuloInteger(i / 0x100, 0x100)endfunctionfunction IntegerGetBlue takes integer i returns integer if i<0 then return ModuloInteger((i + 0x80000000) / 0x10000, 0x100) endif return ModuloInteger(i / 0x10000, 0x100)endfunctionfunction IntegerGetAlpha takes integer i returns integer if i<0 then return (i + 0x80000000) / 0x1000000 + 0x80 endif return i / 0x1000000endfunction//=======================================================================================// Return Bugfunction h2i takes handle H returns integer return H return 0endfunctionprivate function i2u takes integer I returns unit return I return nullendfunctionprivate function i2e takes integer I returns effect return I return nullendfunctionprivate function i2i takes integer I returns image return I return nullendfunctionprivate function i2s takes integer I returns sound return I return nullendfunctionprivate function i2d takes integer I returns destructable return I return nullendfunction//=======================================================================================// Gamecache Storagefunction AttachInteger takes integer i, handle h, string k returns nothing local string s = I2S(h2i(h)) if(i!=0)then call StoreInteger(cfcache,s,k,i) else call FlushStoredInteger(cfcache,s,k) endifendfunctionfunction AttachReal takes real r, handle h, string k returns nothing local string s = I2S(h2i(h)) if(r!=0.)then call StoreReal(cfcache,s,k,r) else call FlushStoredReal(cfcache,s,k) endifendfunctionfunction AttachString takes string a, handle h, string k returns nothing local string s = I2S(h2i(h)) if(a!="")then call StoreString(cfcache,s,k,a) else call FlushStoredString(cfcache,s,k) endifendfunctionfunction AttachBoolean takes boolean b, handle h, string k returns nothing local string s = I2S(h2i(h)) if(b)then call StoreInteger(cfcache,s,"::boolean::"+k,1) else call FlushStoredInteger(cfcache,s,"::boolean::"+k) endifendfunctionfunction AttachHandle takes handle a, handle h, string k returns nothing local string s = I2S(h2i(h)) if(a!=null)then call StoreInteger(cfcache,s,k,h2i(a)) else call FlushStoredInteger(cfcache,s,k) endifendfunctionfunction GetAttachedInteger takes handle h, string k returns integer return GetStoredInteger(cfcache,I2S(h2i(h)),k)endfunctionfunction GetAttachedReal takes handle h, string k returns real return GetStoredReal(cfcache,I2S(h2i(h)),k)endfunctionfunction GetAttachedString takes handle h, string k returns string return GetStoredString(cfcache,I2S(h2i(h)),k)endfunctionfunction GetAttachedBoolean takes handle h, string k returns boolean if(GetStoredInteger(cfcache,I2S(h2i(h)),"::boolean::"+k)==1)then return true endif return falseendfunctionfunction GetAttachedUnit takes handle h, string k returns unit local integer i = GetStoredInteger(cfcache,I2S(h2i(h)),k) if(i!=0)then return i2u(i) endif return nullendfunctionfunction GetAttachedEffect takes handle h, string k returns effect local integer i = GetStoredInteger(cfcache,I2S(h2i(h)),k) if(i!=0)then return i2e(i) endif return nullendfunctionfunction GetAttachedImage takes handle h, string k returns image local integer i = GetStoredInteger(cfcache,I2S(h2i(h)),k) if(i!=0)then return i2i(i) endif return nullendfunctionfunction GetAttachedSound takes handle h, string k returns sound local integer i = GetStoredInteger(cfcache,I2S(h2i(h)),k) if(i!=0)then return i2s(i) endif return nullendfunctionfunction GetAttachedDestructable takes handle h, string k returns destructable local integer i = GetStoredInteger(cfcache,I2S(h2i(h)),k) if(i!=0)then return i2d(i) endif return nullendfunctionfunction FlushHandle takes handle h returns nothing call FlushStoredMission(cfcache,I2S(h2i(h)))endfunction//! endlibrary// WE Trigger (Lets this code Parse)function InitTrig_CFEngine takes nothing returns nothingendfunction Then, one of my modules, which was CF Effect handler. I thought this was a cool way of making effects. Say you create a special effect, you are limited to 2/3 options, location and model. With my Effect handler, you can do much much more. You can: Pause effects, set their size, set their colour, set their co-ordinates x/y, you can set their height (coord z), you can set which way its facing, you can hide/show it, and set its animation speed. Here is my CFEffect module: //! library CFEffectHandler needs CFEngine//***************************************************************************************//*//* Casual Functions Effect Handler v.1.0//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯//*//* Requires://* - vJass Preprocessor to parse this code//* - Casual Functions Engine//*//* Note://* These functions cannot be used on any old effect, they have to be created via//* the create effect functions provided in this Handler pack.//***************************************************************************************//=======================================================================================// A struct used to carry all infomation used for the effects, thanks to vJass, it makes// life alot easier.globals constant integer SFXPROPERTY_COLOUR_RED=0 // 0-255 constant integer SFXPROPERTY_COLOUR_GREEN=1 // 0-255 constant integer SFXPROPERTY_COLOUR_BLUE=2 // 0-255 constant integer SFXPROPERTY_COLOUR_ALPHA=3 // 0-255 constant integer SFXPROPERTY_SIZE=4 // 0.01-10 constant integer SFXPROPERTY_SPEED=5 // 0.01-10endglobalsstruct sfx real x = 0 real y = 0 real z = 0 static unit u = null integer c = 0 real s = 0 string p = "" static effect e = null real f = 0 integer v = 0 boolean m real t = 0 method Init takes real x, real y, real z, unit u, integer c, real s, string p, effect e, real f, integer v, real t, boolean m returns nothing set .x=x set .y=y set .z=z set .u=u set .c=c set .s=s set .p=p set .e=e set .f=f set .v=v set .m=m set .t=t endmethod method SetEffectX takes real x returns nothing if(IsXSafe(x))then set .x=x call SetUnitX(.u,x) endif endmethod method SetEffectY takes real y returns nothing if(IsYSafe(y)) then set .y=y call SetUnitY(.u,y) endif endmethod method SetEffectZ takes real z returns nothing if(not CFHeightModifier_enabled)then call SetUnitFlyHeight(.u,z,0.) set .z=z endif endmethod method SetFace takes real face returns nothing call SetUnitFacing(.u,face) set .f=face endmethod method SetRed takes integer red returns integer local integer g=IntegerGetGreen(.c) local integer b=IntegerGetBlue(.c) local integer a=IntegerGetAlpha(.c) call SetUnitVertexColor(.u,red,g,b,a) return ColourToInteger(red,g,b,a) endmethod method SetGreen takes integer green returns integer local integer r=IntegerGetRed(.c) local integer b=IntegerGetBlue(.c) local integer a=IntegerGetAlpha(.c) call SetUnitVertexColor(.u,r,green,b,a) return ColourToInteger(r,green,b,a) endmethod method SetBlue takes integer blue returns integer local integer r=IntegerGetRed(.c) local integer g=IntegerGetGreen(.c) local integer a=IntegerGetAlpha(.c) call SetUnitVertexColor(.u,r,g,blue,a) return ColourToInteger(r,g,blue,a) endmethod method SetAlpha takes integer alpha returns integer local integer r=IntegerGetRed(.c) local integer g=IntegerGetGreen(.c) local integer b=IntegerGetBlue(.c) call SetUnitVertexColor(.u,r,g,b,alpha) return ColourToInteger(r,g,b,alpha) endmethod method SetSize takes real size returns real call SetUnitScale(.u,size,size,size) return size endmethod method Hide takes nothing returns nothing call ShowUnit(.u,false) endmethod method Show takes nothing returns nothing call ShowUnit(.u,true) endmethod method Freeze takes nothing returns nothing call SetUnitTimeScale(.u,0.) set .m=true endmethod method Unfreeze takes nothing returns nothing call SetUnitTimeScale(.u,1.) set .m=false endmethod method SetSpeed takes real r returns nothing if(not .m) then call SetUnitTimeScale(.u,r) set .t=r endif endmethodendstructstruct sfxgroup group g method AddEffect takes sfx e returns nothing call GroupAddUnit(.g,e.u) endmethod method RemoveEffect takes sfx e returns nothing call GroupRemoveUnit(.g,e.u) endmethod method ClearGroup takes nothing returns nothing call GroupClear(.g) endmethod method EnumInRange takes real x, real y, real r returns nothing local group p local unit u call GroupEnumUnitsInRange(p,x,y,r,null) loop set u=FirstOfGroup(p) exitwhen u==null if(SubString(GetStoredString(cfcache,I2S(h2i(u)),"CF"),10,11)=="EFFECTDUMMY")then call GroupAddUnit(.g,u) endif call GroupRemoveUnit(p,u) endloop call DestroyGroup(p) set p = null set u = null endmethodendstruct//=======================================================================================// CFEffectHandler allowancefunction CFEffectHandlerOn takes nothing returns boolean return CFEffectHandler_enabledendfunction//=======================================================================================// A simple function, gets a new sfx struct, sets loads of stuff, stores it to the effectfunction CreateEffect takes real x, real y, string path returns sfx local sfx e=sfx.create() local integer abil = MorphAbilityRawcode() local location l local integer i = DummyUnitRawcode() if(IsLocSafe(x,y) and CFEffectHandlerOn())then if(i==0)then call Print(CFError(1)) call sfx.destroy(e) set i = 0 else if(abil==0)then call Print(CFError(2)) call sfx.destroy(e) set i = 0 else set l = Location(x,y) call StoreString(cfcache,I2S(h2i(e.u)),"CF","EFFECTDUMMY::"+I2S(e)) call UnitAddAbility(e.u,abil) call UnitRemoveAbility(e.u,abil) call e.Init(x,y,GetLocationZ(l),CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),i,x,y,bj_UNIT_FACING),ColourToInteger(255,255,255,0),1.,path,AddSpecialEffectTarget(path,e.u,"origin"),bj_UNIT_FACING,0,1.,false) endif endif else call sfx.destroy(e) return 0 endif return eendfunction//=======================================================================================// Remove a effectfunction RemoveEffect takes sfx e returns nothing call DestroyEffect(e.e) call FlushHandle(e.e) call FlushHandle(e.u) call RemoveUnit(e.u) call sfx.destroy(e)endfunction//=======================================================================================// A ton of setting functionsfunction SetEffectX takes sfx e, real x returns nothing if(CFEffectHandlerOn())then call e.SetEffectX(x) endifendfunctionfunction SetEffectY takes sfx e, real y returns nothing if(CFEffectHandlerOn())then call e.SetEffectY(y) endifendfunctionfunction SetEffectZ takes sfx e, real z returns nothing if(CFEffectHandlerOn())then call e.SetEffectZ(z) endifendfunctionfunction SetEffectFace takes sfx e, real angle returns nothing if(CFEffectHandlerOn())then call e.SetFace(angle) endifendfunctionfunction SetEffectRed takes sfx e, integer r returns nothing if(CFEffectHandlerOn())then set e.c=e.SetRed(r) endifendfunctionfunction SetEffectGreen takes sfx e, integer g returns nothing if(CFEffectHandlerOn())then set e.c=e.SetGreen(g) endifendfunctionfunction SetEffectBlue takes sfx e, integer b returns nothing if(CFEffectHandlerOn())then set e.c=e.SetBlue(b) endifendfunctionfunction SetEffectAlpha takes sfx e, integer a returns nothing if(CFEffectHandlerOn())then set e.c=e.SetAlpha(a) endifendfunctionfunction SetEffectColour takes sfx e, integer r, integer g, integer b, integer a returns nothing if(CFEffectHandlerOn())then set e.c=e.SetRed(r) set e.c=e.SetGreen(g) set e.c=e.SetBlue(b) set e.c=e.SetAlpha(a) endifendfunctionfunction SetEffectSize takes sfx e, real s returns nothing if(CFEffectHandlerOn())then set e.s=e.SetSize(s) endifendfunctionfunction SetEffectValue takes sfx e, integer v returns nothing if(CFEffectHandlerOn())then set e.v=v endifendfunctionfunction SetEffectPlaySpeed takes sfx e, real r returns nothing if(CFEffectHandlerOn())then call e.SetSpeed(r) endifendfunction//=======================================================================================// A ton of getting functionsfunction GetEffectX takes sfx e returns real return e.xendfunctionfunction GetEffectY takes sfx e returns real return e.yendfunctionfunction GetEffectZ takes sfx e returns real return e.zendfunctionfunction GetEffectFace takes sfx e returns real return e.fendfunctionfunction GetEffectRed takes sfx e returns integer return IntegerGetRed(e.c)endfunctionfunction GetEffectGreen takes sfx e returns integer return IntegerGetGreen(e.c)endfunctionfunction GetEffectBlue takes sfx e returns integer return IntegerGetBlue(e.c)endfunctionfunction GetEffectAlpha takes sfx e returns integer return IntegerGetAlpha(e.c)endfunctionfunction GetEffectColour takes sfx e returns integer return e.cendfunctionfunction GetEffectSize takes sfx e returns real return e.sendfunctionfunction GetEffectValue takes sfx e returns integer return e.vendfunctionfunction GetEffectSpeed takes sfx e returns real return e.tendfunction//=======================================================================================// Show/Hide Effectfunction HideEffect takes sfx e returns nothing if(CFEffectHandlerOn())then call e.Hide() endifendfunctionfunction ShowEffect takes sfx e returns nothing if(CFEffectHandlerOn())then call e.Show() endifendfunction//=======================================================================================// Freeze/Unfreeze effect (completly pauses the effect's animation)function FreezeEffect takes sfx e returns nothing if(CFEffectHandlerOn())then call e.Freeze() endifendfunctionfunction UnfreezeEffect takes sfx e returns nothing if(CFEffectHandlerOn())then call e.Unfreeze() endifendfunction//=======================================================================================// Effect Groupsfunction CreateEffectGroup takes nothing returns sfxgroup if(CFEffectHandlerOn())then return sfxgroup.create() endif return 0endfunctionfunction DestroyEffectGroup takes sfxgroup g returns nothing call DestroyGroup(g.g) call sfxgroup.destroy(g)endfunction//=======================================================================================// Add/Remove effects from effect groupsfunction AddEffectToGroup takes sfx e, sfxgroup g returns nothing if(CFEffectHandlerOn())then call g.AddEffect(e) endifendfunctionfunction RemoveEffectFromGroup takes sfx e, sfxgroup g returns nothing if(CFEffectHandlerOn())then call g.RemoveEffect(e) endifendfunction//=======================================================================================// Comparisonfunction IsEffectInGroup takes sfx e, sfxgroup g returns boolean return IsUnitInGroup(e.u,g.g)endfunctionfunction IsEffectProperty takes sfx e, integer property, real r returns boolean if(property==0)then return GetEffectRed(e)==R2I(r) elseif(property==1)then return GetEffectGreen(e)==R2I(r) elseif(property==2)then return GetEffectBlue(e)==R2I(r) elseif(property==3)then return GetEffectAlpha(e)==R2I(r) elseif(property==4)then return e.s==r elseif(property==5)then return e.t==r endif return falseendfunction//=======================================================================================// Effect Group controllingfunction ClearEffectGroup takes sfxgroup g returns nothing if(CFEffectHandlerOn())then call g.ClearGroup() endifendfunctionfunction GetFirstEffectOfGroup takes sfxgroup g returns sfx local string s = GetStoredString(cfcache,I2S(h2i(FirstOfGroup(g.g))),"CF") return S2I(SubString(s,13,StringLength(s)))endfunctionfunction EnumAllEffects takes sfxgroup g returns nothing local group p = CreateGroup() local unit u if(CFEffectHandlerOn())then call GroupEnumUnitsInRect(p,bj_mapInitialPlayableArea,null) loop set u = FirstOfGroup(p) exitwhen u==null if(SubString(GetStoredString(cfcache,I2S(h2i(u)),"CF"),0,11)=="EFFECTDUMMY")then call GroupAddUnit(g.g,u) endif call GroupRemoveUnit(p,u) endloop endif call DestroyGroup(p) set p = null set u = nullendfunction function EnumEffectsInRange takes sfxgroup g, real x, real y, real r returns nothing if(CFEffectHandlerOn())then call g.EnumInRange(x,y,r) endifendfunctionfunction EnumEffectsWithProperty takes sfxgroup g, integer property, real r returns nothing local sfxgroup p = sfxgroup.create() local sfx e if(CFEffectHandlerOn())then call EnumAllEffects(p) loop set e = GetFirstEffectOfGroup(p) exitwhen e==0 if(IsEffectProperty(e,property,r))then call AddEffectToGroup(e,g) endif call RemoveEffectFromGroup(e,p) endloop endif call DestroyGroup(p.g) call sfxgroup.destroy(g)endfunctionfunction DestroyAllEffects takes nothing returns nothing local sfxgroup g = sfxgroup.create() local sfx s if(CFEffectHandlerOn())then call EnumAllEffects(g) loop set s = GetFirstEffectOfGroup(g) exitwhen s==0 call RemoveEffectFromGroup(s,g) call RemoveEffect(s) endloop endif call sfxgroup.destroy(g)endfunction//! endlibrary// WE Trigger (Lets this code Parse)function InitTrig_CFEffectHandler takes nothing returns nothingendfunction And, towards the end of my Module, i added Effect Groups, so you can track effects much easier. You could for example, make a new effect group and add all effects in a spell, then once the spell has finished destroy the effects in the group using a loop and GetFirstEffectOfGroup. If you have any questions of what new things can be done, how to add CF into your map, or anything Jass related, don't hesitate to ask. Go to top Share this post Link to post
Guest Sancdar Posted June 17, 2007 Well done! I didn't notice any problems, and I'm glad that you made it easy to destroy effects. I can't stand maps with memory issues or splits due to sloppy effect coding, like some of the old Cube Defense maps. Go to top Share this post Link to post
Guest The)TideHunter( Posted June 19, 2007 Thanks, took me quite a while. If i finished it with some more modules i would release it. And seen as Wc3c went down, i didnt have much support. Its nice to recieve some feedback though, thanks. Reading over it, i actually made a leak, and thats in the CreateEffect function, i wrote "set l = Location(x,y)" and never destroyed the location. Dumb mistake, but never the less i doubt it will ever be used. Go to top Share this post Link to post