Spellpack Random Spells

~AMARANT~

New Member
Reaction score
0
I wanted to import Sanity's Eclipse spell but I have 1 error:
scope SanitysEclipse initializer InitTrig - this row
Unexpected "initializer InitTrig" - this error
 

Red Bars

New Member
Reaction score
2
You need the NewGen for the spells. It says that it uses vJass, means you need the NewGen for them, NewGen is another sort of WE. You can download it here. After you did that, you have to downgrade the patch, read more about it here.
__________________
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif

reputationnegwy6.gif
If you find my posts useful or if I helped you, I would a apperciate
downloadxd9.gif
reputationnegwy6.gif

reputationnegwy6.gif
Or if you just find my posts amusing or disturbing, please give me
downloadxd9.gif
reputationnegwy6.gif

reputationnegwy6.gif
Well, I would't mind if you with absolutely no reasons at all gave me
downloadxd9.gif
reputationnegwy6.gif

reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
reputationnegwy6.gif
 

~AMARANT~

New Member
Reaction score
0
I have New Gen, I have many vJASS spells in my map. But this error appear only in this spellpack. :(
 

Kenny

Back for now.
Reaction score
202
I have New Gen, I have many vJASS spells in my map. But this error appear only in this spellpack. :(

I don't see anything wrong with the spell, however, you can try this:

JASS:
scope SanitysEclipse initializer InitTrig // Remove the 'initializer InitTrig' part


then down the bottom of the spell:

JASS:
private function InitTrig takes nothing returns nothing // make the private at the start public, so public function InitTrig etc etc...
	local trigger trig = CreateTrigger()
	call TriggerRegisterAnyUnitEvent(trig,EVENT_PLAYER_UNIT_SPELL_EFFECT)
	call TriggerAddCondition(trig,Condition(function Conditions))
	call TriggerAddAction(trig,function Actions)
    call Preload("Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl")
endfunction


Then see what happens, but it should be working anyway.

I might update these spells if i have the time, thanks for reminding me they still existed. :p
 

hoihoi8

New Member
Reaction score
0
Hi, I like your spells, but the flamewall is causing a memory crash.

It works when:
I use it anywhere with no enemies around.
I use it when I'm fighting enemies alone.

Crashes:
When an enemy is around, I have units attacking that enemy and the hero casts flamewall.

Any ideas what my problem is? I didn't copy over any variables. Is that needed?
 

hoihoi8

New Member
Reaction score
0
:banghead:/facepalm
of course you need the freaking variables. :rolleyes:
:banghead:/facepalm

Well the install instructions were pretty specific, and they didn't mention any variables. There are only 4 variables and they don't look like they belong to the spells.

My problem still stands.
 

hoihoi8

New Member
Reaction score
0
This may help.

When I disable and enable the Firewall trigger I get this message.

"The trigger "Firewall" must have an initialization function called "InitTrig_Firewall"

When I disable and enable the TT trigger I get this message.

"The trigger "TT" must have an initialization function called "InitTrig_TT"

EDIT: Firewall still crashes to the desktop with a memory erro when it hits multiple enemies at the same time. Does anyone know how to fix this?
 

hoihoi8

New Member
Reaction score
0
I've narrowed down the line of code.

Anytime I cast firewall on top of multiple targets, this line crashes my game with a memory error

static method create takes nothing returns Data
....
set d.flame = CreateUnit(GetOwningPlayer(d.caster),Unit_id,d.locx,d.locy,0.00)

I'm 99.99% sure I have the spell setup correctly.
 

Kenny

Back for now.
Reaction score
202
No one else has had troubles with these spells, and after looking through the script for Firewall again, there doesn't look to be anything that would cause it to give you an error.

And why would that line give you an error?

The only reason i can think that it would give you an error, is if you havent used the proper unit for the wall, or if you've given that unit some type of wierd ability.

I might try updating these spells soon.
 

Kenny

Back for now.
Reaction score
202
Major Update!

  • Re-wrote all the script to each spell.
  • Each spell is now independant, meaing you no longer need any systems for them to work.
  • Configuration has been made easier.
  • Found a massive flaw with Magnetic field, which cause it to leak like crazy, it is now fixed.
  • Made the spells more efficient, and the scripts easier to read.

Feedback is definately welcome as always. Enjoy! :D

For TERRYperfect:

Only works on enemy units now (well it should):

JASS:
//------------------------------------------------------------------------------------\\
//                               Magnetic Field [v2]                                  \\
//                                   by kenny!                                        \\
//                            Constructed using vJASS                                 \\
//                               Requires NewGen WE                                   \\
//------------------------------------------------------------------------------------\\

scope MagneticField2

    globals
        // Configurables:
        private constant integer Abil_id = 'A001'          // Raw code of the Magnetic Field ability.
        private constant integer Dummy_id = 'u001'         // Raw code of the dummy unit used to destroy trees.
        private constant real Interval = 0.03125           // Used in the periodic timer to move units.
        private constant real Collision = 100.00           // Area around the moving units in which trees will be destroyed.
        private constant string Casted_sfx = "Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl"   // Special effect that is attached to the caster.
        private constant string Casted_point = "origin"    // where the special effect is attached to the caster.
        private constant boolean Destroy_trees = true      // Whether or not to allow destroying trees.
        private constant boolean Allow_preload = true      // Whether or not to allow preloading of effects.
    endglobals

    private function Duration takes integer lvl returns real
        return 6.00 * lvl
    endfunction

    private function Distance takes integer lvl returns real
        return 20.00 + (0.00 * lvl)
    endfunction

    private function Radius takes integer lvl returns real
        return 225.00 + (50.00 * lvl)
    endfunction

    //=======================================================================\\
    //   DO NOT TOUCH PAST THIS POINT UNLESS YOU KNOW WHAT YOUR ARE DOING!   \\
    //=======================================================================\\
    
    private struct Data
    
        unit cast     = null
        effect sfx    = null
        real time     = 0.00
        integer lvl   = 0
        
        static Data array D
        static integer DT           = 0
        static rect Rect1           = null
        static timer Timer          = null
        static group Group          = null
        static unit Tree_dummy      = null
        static boolexpr True_filt   = null
        static boolexpr Tree_filt   = null
        static boolexpr Unit_filt   = null
        static real Game_maxX       = 0.00
        static real Game_minX       = 0.00
        static real Game_maxY       = 0.00
        static real Game_minY       = 0.00
        
        static method pathability takes real x, real y returns boolean
            return IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY)
        endmethod

        static method bounds takes real x, real y returns boolean
            return x >= .Game_minX and x <= .Game_maxX and y >= .Game_minY and y <= .Game_maxY    // Checks for map boundaries
        endmethod
        
        static method truefilt takes nothing returns boolean
            return true
        endmethod
        
        static method destroyenumtrees takes nothing returns nothing
            call KillDestructable(GetEnumDestructable())
        endmethod
        
        static method treefilt takes nothing returns boolean
            local destructable dest = GetFilterDestructable()
            local boolean result
            
            if GetDestructableLife(dest) > 0.405 then
                call ShowUnit(.Tree_dummy,true)
                call SetUnitX(.Tree_dummy,GetWidgetX(dest))
                call SetUnitY(.Tree_dummy,GetWidgetY(dest))
                
                set result = IssueTargetOrder(.Tree_dummy,"harvest",dest)
                call IssueImmediateOrder(.Tree_dummy,"stop")
                call ShowUnit(.Tree_dummy,false)
                
                set dest = null
                return result
            endif
            
            set dest = null
            return false
        endmethod
        
        static method unitfilt takes nothing returns boolean
            return GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) == false
        endmethod
        
        private method onDestroy takes nothing returns nothing
            call DestroyEffect(.sfx)
            set .sfx = null
            set .cast = null
        endmethod
        
        static method update takes nothing returns nothing
            local Data d      = 0
            local integer i   = 1
            local unit u      = null
            local real castx  = 0.00
            local real casty  = 0.00
            local real angle  = 0.00
            local real sin    = 0.00
            local real cos    = 0.00
            local real ux     = 0.00
            local real uy     = 0.00
            
            loop
                exitwhen i > .DT
                
                set d = .D<i>
                
                set castx = GetUnitX(d.cast)
                set casty = GetUnitY(d.cast)
                
                if d.time &gt;= Duration(d.lvl) or GetWidgetLife(d.cast) &lt; 0.405 then
                    call d.destroy()
                    set .D<i> = .D[.DT]
                    set .DT = .DT - 1
                    set i = i - 1
                else
                    call GroupEnumUnitsInRange(.Group,castx,casty,Radius(d.lvl),.Unit_filt)
                    call GroupRemoveUnit(.Group,d.cast)
                    loop
                        set u = FirstOfGroup(.Group)
                        exitwhen u == null
                        call GroupRemoveUnit(.Group,u)
                        if IsUnitEnemy(u,GetOwningPlayer(d.cast)) then
                            set ux = GetUnitX(u)
                            set uy = GetUnitY(u)
                            set angle = Atan2((uy - casty),(ux - castx))
                            set sin = Sin(angle)
                            set cos = Cos(angle)
                            set ux = ux + Distance(d.lvl) * cos
                            set uy = uy + Distance(d.lvl) * sin
                            if .pathability(ux,uy) or .bounds(ux,uy) then
                                call SetUnitPosition(u,ux,uy)
                                if Destroy_trees then
                                    call SetRect(.Rect1,ux - Collision,uy - Collision,ux + Collision,uy + Collision)
                                    call EnumDestructablesInRect(.Rect1,.Tree_filt,function Data.destroyenumtrees)
                                endif                            
                            endif
                        endif
                    endloop
                    
                    set d.time = d.time + Interval
                endif
                
                set i = i + 1
            endloop
            
            if .DT &lt;= 0 then
                call PauseTimer(.Timer)
                set .DT = 0
            endif               
                
            set u = null
        endmethod
        
        static method actions takes nothing returns nothing
            local Data d = Data.create()
            
            set d.cast = GetTriggerUnit()
            set d.lvl = GetUnitAbilityLevel(d.cast,Abil_id)
            set d.sfx = AddSpecialEffectTarget(Casted_sfx,d.cast,Casted_point)
            
            set .DT = .DT + 1
            if .DT == 1 then
                call TimerStart(.Timer,Interval,true,function Data.update)
            endif
            set .D[.DT] = d
        endmethod

        static method conditions takes nothing returns boolean
            return GetSpellAbilityId() == Abil_id
        endmethod

        static method onInit takes nothing returns nothing
            local trigger trig = CreateTrigger()
            local integer i = 0
            
            set .Timer = CreateTimer()
            set .Group = CreateGroup()
            set .Rect1 = Rect(0.00,0.00,1.00,1.00)
            set .True_filt = Filter(function Data.truefilt)
            set .Tree_filt = Filter(function Data.treefilt)
            set .Unit_filt = Filter(function Data.unitfilt)
            
            set .Game_maxX = GetRectMaxX(bj_mapInitialPlayableArea) - 64.00
            set .Game_maxY = GetRectMaxY(bj_mapInitialPlayableArea) - 64.00
            set .Game_minX = GetRectMinX(bj_mapInitialPlayableArea) + 64.00
            set .Game_minY = GetRectMinY(bj_mapInitialPlayableArea) + 64.00

            loop 
                call TriggerRegisterPlayerUnitEvent(trig,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,.True_filt)
                set i = i + 1
                exitwhen i == bj_MAX_PLAYER_SLOTS
            endloop
            
            call TriggerAddCondition(trig,Condition(function Data.conditions))
            call TriggerAddAction(trig,function Data.actions)
            
            set .Tree_dummy = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),Dummy_id,0.00,0.00,0.00)
            call SetUnitPathing(.Tree_dummy,false)
            call ShowUnit(.Tree_dummy,false)
            
            if Allow_preload then
                call DestroyEffect(AddSpecialEffect(Casted_sfx,0.00,0.00))
            endif
        endmethod
    
    endstruct

endscope

</i></i>
 

TERRYperfect

New Member
Reaction score
0
Major Update!

  • Re-wrote all the script to each spell.
  • Each spell is now independant, meaing you no longer need any systems for them to work.
  • Configuration has been made easier.
  • Found a massive flaw with Magnetic field, which cause it to leak like crazy, it is now fixed.
  • Made the spells more efficient, and the scripts easier to read.

Feedback is definately welcome as always. Enjoy! :D

For TERRYperfect:

Only works on enemy units now (well it should):

JASS:


//------------------------------------------------------------------------------------\\
//                               Magnetic Field [v2]                                  \\
//                                   by kenny!                                        \\
//                            Constructed using vJASS                                 \\
//                               Requires NewGen WE                                   \\
//------------------------------------------------------------------------------------\\

scope MagneticField2

    globals
        // Configurables:
        private constant integer Abil_id = &#039;A001&#039;          // Raw code of the Magnetic Field ability.
        private constant integer Dummy_id = &#039;u001&#039;         // Raw code of the dummy unit used to destroy trees.
        private constant real Interval = 0.03125           // Used in the periodic timer to move units.
        private constant real Collision = 100.00           // Area around the moving units in which trees will be destroyed.
        private constant string Casted_sfx = &quot;Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl&quot;   // Special effect that is attached to the caster.
        private constant string Casted_point = &quot;origin&quot;    // where the special effect is attached to the caster.
        private constant boolean Destroy_trees = true      // Whether or not to allow destroying trees.
        private constant boolean Allow_preload = true      // Whether or not to allow preloading of effects.
    endglobals

    private function Duration takes integer lvl returns real
        return 6.00 * lvl
    endfunction

    private function Distance takes integer lvl returns real
        return 20.00 + (0.00 * lvl)
    endfunction

    private function Radius takes integer lvl returns real
        return 225.00 + (50.00 * lvl)
    endfunction

    //=======================================================================\\
    //   DO NOT TOUCH PAST THIS POINT UNLESS YOU KNOW WHAT YOUR ARE DOING!   \\
    //=======================================================================\\
    
    private struct Data
    
        unit cast     = null
        effect sfx    = null
        real time     = 0.00
        integer lvl   = 0
        
        static Data array D
        static integer DT           = 0
        static rect Rect1           = null
        static timer Timer          = null
        static group Group          = null
        static unit Tree_dummy      = null
        static boolexpr True_filt   = null
        static boolexpr Tree_filt   = null
        static boolexpr Unit_filt   = null
        static real Game_maxX       = 0.00
        static real Game_minX       = 0.00
        static real Game_maxY       = 0.00
        static real Game_minY       = 0.00
        
        static method pathability takes real x, real y returns boolean
            return IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY)
        endmethod

        static method bounds takes real x, real y returns boolean
            return x &gt;= .Game_minX and x &lt;= .Game_maxX and y &gt;= .Game_minY and y &lt;= .Game_maxY    // Checks for map boundaries
        endmethod
        
        static method truefilt takes nothing returns boolean
            return true
        endmethod
        
        static method destroyenumtrees takes nothing returns nothing
            call KillDestructable(GetEnumDestructable())
        endmethod
        
        static method treefilt takes nothing returns boolean
            local destructable dest = GetFilterDestructable()
            local boolean result
            
            if GetDestructableLife(dest) &gt; 0.405 then
                call ShowUnit(.Tree_dummy,true)
                call SetUnitX(.Tree_dummy,GetWidgetX(dest))
                call SetUnitY(.Tree_dummy,GetWidgetY(dest))
                
                set result = IssueTargetOrder(.Tree_dummy,&quot;harvest&quot;,dest)
                call IssueImmediateOrder(.Tree_dummy,&quot;stop&quot;)
                call ShowUnit(.Tree_dummy,false)
                
                set dest = null
                return result
            endif
            
            set dest = null
            return false
        endmethod
        
        static method unitfilt takes nothing returns boolean
            return GetWidgetLife(GetFilterUnit()) &gt; 0.405 and IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) == false
        endmethod
        
        private method onDestroy takes nothing returns nothing
            call DestroyEffect(.sfx)
            set .sfx = null
            set .cast = null
        endmethod
        
        static method update takes nothing returns nothing
            local Data d      = 0
            local integer i   = 1
            local unit u      = null
            local real castx  = 0.00
            local real casty  = 0.00
            local real angle  = 0.00
            local real sin    = 0.00
            local real cos    = 0.00
            local real ux     = 0.00
            local real uy     = 0.00
            
            loop
                exitwhen i &gt; .DT
                
                set d = .D<i>
                
                set castx = GetUnitX(d.cast)
                set casty = GetUnitY(d.cast)
                
                if d.time &gt;= Duration(d.lvl) or GetWidgetLife(d.cast) &lt; 0.405 then
                    call d.destroy()
                    set .D<i> = .D[.DT]
                    set .DT = .DT - 1
                    set i = i - 1
                else
                    call GroupEnumUnitsInRange(.Group,castx,casty,Radius(d.lvl),.Unit_filt)
                    call GroupRemoveUnit(.Group,d.cast)
                    loop
                        set u = FirstOfGroup(.Group)
                        exitwhen u == null
                        call GroupRemoveUnit(.Group,u)
                        if IsUnitEnemy(u,GetOwningPlayer(d.cast)) then
                            set ux = GetUnitX(u)
                            set uy = GetUnitY(u)
                            set angle = Atan2((uy - casty),(ux - castx))
                            set sin = Sin(angle)
                            set cos = Cos(angle)
                            set ux = ux + Distance(d.lvl) * cos
                            set uy = uy + Distance(d.lvl) * sin
                            if .pathability(ux,uy) or .bounds(ux,uy) then
                                call SetUnitPosition(u,ux,uy)
                                if Destroy_trees then
                                    call SetRect(.Rect1,ux - Collision,uy - Collision,ux + Collision,uy + Collision)
                                    call EnumDestructablesInRect(.Rect1,.Tree_filt,function Data.destroyenumtrees)
                                endif                            
                            endif
                        endif
                    endloop
                    
                    set d.time = d.time + Interval
                endif
                
                set i = i + 1
            endloop
            
            if .DT &lt;= 0 then
                call PauseTimer(.Timer)
                set .DT = 0
            endif               
                
            set u = null
        endmethod
        
        static method actions takes nothing returns nothing
            local Data d = Data.create()
            
            set d.cast = GetTriggerUnit()
            set d.lvl = GetUnitAbilityLevel(d.cast,Abil_id)
            set d.sfx = AddSpecialEffectTarget(Casted_sfx,d.cast,Casted_point)
            
            set .DT = .DT + 1
            if .DT == 1 then
                call TimerStart(.Timer,Interval,true,function Data.update)
            endif
            set .D[.DT] = d
        endmethod

        static method conditions takes nothing returns boolean
            return GetSpellAbilityId() == Abil_id
        endmethod

        static method onInit takes nothing returns nothing
            local trigger trig = CreateTrigger()
            local integer i = 0
            
            set .Timer = CreateTimer()
            set .Group = CreateGroup()
            set .Rect1 = Rect(0.00,0.00,1.00,1.00)
            set .True_filt = Filter(function Data.truefilt)
            set .Tree_filt = Filter(function Data.treefilt)
            set .Unit_filt = Filter(function Data.unitfilt)
            
            set .Game_maxX = GetRectMaxX(bj_mapInitialPlayableArea) - 64.00
            set .Game_maxY = GetRectMaxY(bj_mapInitialPlayableArea) - 64.00
            set .Game_minX = GetRectMinX(bj_mapInitialPlayableArea) + 64.00
            set .Game_minY = GetRectMinY(bj_mapInitialPlayableArea) + 64.00

            loop 
                call TriggerRegisterPlayerUnitEvent(trig,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,.True_filt)
                set i = i + 1
                exitwhen i == bj_MAX_PLAYER_SLOTS
            endloop
            
            call TriggerAddCondition(trig,Condition(function Data.conditions))
            call TriggerAddAction(trig,function Data.actions)
            
            set .Tree_dummy = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),Dummy_id,0.00,0.00,0.00)
            call SetUnitPathing(.Tree_dummy,false)
            call ShowUnit(.Tree_dummy,false)
            
            if Allow_preload then
                call DestroyEffect(AddSpecialEffect(Casted_sfx,0.00,0.00))
            endif
        endmethod
    
    endstruct

endscope

</i></i>



Thank you for your timely help~
T.T moving~;)
 

Kenny

Back for now.
Reaction score
202
Update, Version 3 for all spells are out. Update includes:

  • 12 April, 09 - Semi-major update.
    • All spells now require GTrigger by Jesus4Lyf. Don't worry, this doesn't mean they are 1000 times more complicated. You just have to copy and paste the GT trigger into your map to use these spells. I use GTrigger because it is much more efficient, and very easy to use.
    • Standardised all the spells, again. They now follow the basic standards of JASS, hopefully.
    • And there are a few small coding updates to improve efficiency and stuff.

Have fun :D.
 

ShadourazeR

New Member
Reaction score
0
Newgen got a Syntax error... my fault?

JASS:
            call GT_AddStartsEffectAction(function s__MagneticField2___Data_actions , MagneticField2___ABIL_ID)


Well, suddenly worked... =P THank you, it was a huge help.
 

SanKakU

Member
Reaction score
21
bump. i'm a newb at graphics but i updated the spell. i think i made improvement in other area too, perhaps...criticism? cheers?
here it is(cjass :/(most of it isn't cjass though))
JASS:
//------------------------------------------------------------------------------------\\
//                               Magnetic Field [v3]                                  \\
//                                   by kenny!                                        \\
//                            Constructed using vJASS                                 \\
//                         Requires NewGen WE &amp; GTrigger                              \\
//                   Edited by SanKakU to have a visual boundary                      \\
//                            Constructed using cJASS                                 \\
//                            Model by JetFangInferno                                 \\
//          <a href="http://www.hiveworkshop.com/forums/models-530/divinering-50484" target="_blank" class="link link--external" rel="nofollow ugc noopener">http://www.hiveworkshop.com/forums/models-530/divinering-50484</a>            \\
//------------------------------------------------------------------------------------\\

scope ShieldCK initializer onInit
globals
// Configurables:
private constant integer ABIL_ID=&#039;A07V&#039;// Raw code of the Magnetic Field ability.
private constant integer DUMID=&#039;e00K&#039;// Raw code of the dummy unit circle that shows boundary.
private constant integer DUMMY_ID=&#039;u00Q&#039;// Raw code of the dummy unit used to destroy trees.
private constant real INTERVAL=0.03125// Used in the periodic timer to move units.
private constant real COLLISION=150.00// Area around the moving units in which trees will be destroyed.
private constant real DISTANCE=75.00 // DISTANCE for checking pathability. Should be at least 25.00 distance less than COLLISION!!!
private constant string  CASTED_SFX= &quot;Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl&quot;   // Special effect that is attached to the caster.
private constant string  CASTED_POINT  = &quot;origin&quot;  // where the special effect is attached to the caster.
private constant boolean DESTROY_TREES = true  // Whether or not to allow destroying trees.
private constant boolean ALLOW_PRELOAD = true  // Whether or not to allow preloading of effects.
endglobals
private real Radius (integer lvl){return 330.00 + (110.00 * lvl)}//MEASURED AGAINST MODEL SIZE
//SHOULD BE 110.00 FOR EVERY 1.00 OF MODEL SIZE...
private real scalex (integer lvl){return 3.00 + (1.00 * lvl)}//WIDTH
private real scaley (integer lvl){return 3.00 + (1.00 * lvl)}//LENGTH
//NEEDS SOME MINOR ADJUSTMENT...
private real scalez (integer lvl){return 1.00 + (0.00 * lvl)}//HEIGHT
private real Duration (integer lvl){return 2.00 + (3.00 * lvl)}//CHANGE AS DESIRED
private real Move_dist (integer lvl){return 20.0 + (0.00 * lvl)}//WOULDN&#039;T ADVISE TOUCH THIS ONE
//END OF CONFIGURABLES

    
    public struct Data
    
        unit dum=null
        unit    cast    = null
        effect  sfx     = null
        real    time    = 0.00
        integer lvl     = 0
        
        static Data     array D
        static item     array Hidden
        static integer  Hidden_max   = 0
        static integer  DT           = 0
        static rect     Rect1        = null
        static timer    Timer        = null
        static group    Group        = null
        static unit     Tree_dummy   = null
        static item     Item         = null
        static boolexpr Tree_filt    = null
        static boolexpr Unit_filt    = null
        static real     Game_maxX    = 0.00
        static real     Game_minX    = 0.00
        static real     Game_maxY    = 0.00
        static real     Game_minY    = 0.00
        static real     Max_range    = 10.00

        static method hide takes nothing returns nothing
            if IsItemVisible(GetEnumItem()) then
                set .Hidden[.Hidden_max] = GetEnumItem()
                call SetItemVisible(.Hidden[.Hidden_max],false)
                set .Hidden_max = .Hidden_max + 1
            endif
        endmethod

        static method pathability takes real x1, real y1 returns boolean
            local real x2 = 0.00
            local real y2 = 0.00
            
            call SetRect(.Rect1,0.00,0.00,128.00,128.00)
            call MoveRectTo(.Rect1,x1,y1)
            call EnumItemsInRect(.Rect1,null,function Data.hide)

            call SetItemPosition(.Item,x1,y1)
            set x2 = GetItemX(.Item)
            set y2 = GetItemY(.Item)
            call SetItemVisible(.Item,false)

            loop
                exitwhen .Hidden_max &lt;= 0
                set .Hidden_max = .Hidden_max - 1
                call SetItemVisible(.Hidden[.Hidden_max],true)
                set .Hidden[.Hidden_max] = null
            endloop

            return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) &lt; .Max_range * .Max_range
        endmethod

        static method safex takes real x returns real
            if x &lt; .Game_minX then
                return .Game_minX
            elseif x &gt; .Game_maxX then
                return .Game_maxX
            endif
            return x
        endmethod

        static method safey takes real y returns real
            if y &lt; .Game_minY then
                return .Game_minY
            elseif y &gt; .Game_maxY then
                return .Game_maxY
            endif
            return y
        endmethod
        
        static method destroyenumtrees takes nothing returns nothing
            call KillDestructable(GetEnumDestructable())
        endmethod
        
        static method treefilt takes nothing returns boolean
            local destructable dest   = GetFilterDestructable()
            local boolean      result = false
            
            if GetDestructableLife(dest) &gt; 0.405 then
                call ShowUnit(.Tree_dummy,true)
                call SetUnitX(.Tree_dummy,GetWidgetX(dest))
                call SetUnitY(.Tree_dummy,GetWidgetY(dest))
                
                set result = IssueTargetOrder(.Tree_dummy,&quot;harvest&quot;,dest)
                call IssueImmediateOrder(.Tree_dummy,&quot;stop&quot;)
                call ShowUnit(.Tree_dummy,false)
                
                set dest = null
                return result
            endif
            
            set dest = null
            return result
        endmethod
        
        static method unitfilt takes nothing returns boolean
            return GetWidgetLife(GetFilterUnit()) &gt; 0.405 and IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) == false
        endmethod
        
        private method onDestroy takes nothing returns nothing
            call DestroyEffect(.sfx)
            RemoveUnit(.dum)
            set .sfx = null
            set .cast = null
        endmethod
        
        static method update takes nothing returns nothing
            local Data    d      = 0
            local integer i      = 1
            local unit    u      = null
            local real    castx  = 0.00
            local real    casty  = 0.00
            local real    angle  = 0.00
            local real    sin    = 0.00
            local real    cos    = 0.00
            local real    ux     = 0.00
            local real    uy     = 0.00
            
            loop
                exitwhen i &gt; .DT
                
                set d = .D<i>
                
                set castx = GetUnitX(d.cast)
                set casty = GetUnitY(d.cast)
                call SetUnitPosition(d.dum,castx,casty)
                
                if d.time &gt;= Duration(d.lvl) or GetWidgetLife(d.cast) &lt; 0.405 then
                    call d.destroy()
                    set .D<i> = .D[.DT]
                    set .DT = .DT - 1
                    set i = i - 1
                else
                    call GroupEnumUnitsInRange(.Group,castx,casty,Radius(d.lvl),.Unit_filt)
                    call GroupRemoveUnit(.Group,d.cast)
                    loop
                        set u = FirstOfGroup(.Group)
                        exitwhen u == null
                        call GroupRemoveUnit(.Group,u)
                        set ux = GetUnitX(u)
                        set uy = GetUnitY(u)
                        set angle = Atan2((uy - casty),(ux - castx))
                        set sin = Sin(angle)
                        set cos = Cos(angle)
                        if .pathability(ux + DISTANCE * cos,uy + DISTANCE * sin) then
                            set ux = .safex(ux + Move_dist(d.lvl) * cos)
                            set uy = .safey(uy + Move_dist(d.lvl) * sin)
                            call SetUnitPosition(u,ux,uy)
                            if DESTROY_TREES then
                                call SetRect(.Rect1,ux - COLLISION,uy - COLLISION,ux + COLLISION,uy + COLLISION)
                                call EnumDestructablesInRect(.Rect1,.Tree_filt,function Data.destroyenumtrees)
                            endif                            
                        endif
                    endloop
                    
                    set d.time = d.time + INTERVAL
                endif
                
                set i = i + 1
            endloop
            
            if .DT &lt;= 0 then
                call PauseTimer(.Timer)
                set .DT = 0
            endif               
                
            set u = null
        endmethod
        
        static method actions takes nothing returns boolean
            local Data d = Data.create()
            
            set d.cast = GetTriggerUnit()
            set d.lvl  = GetUnitAbilityLevel(d.cast,ABIL_ID)
           set d.sfx  = AddSpecialEffectTarget(CASTED_SFX,d.cast,CASTED_POINT)
           set d.dum = CreateUnit(GetOwningPlayer(d.cast),DUMID,GetUnitX(d.cast),GetUnitY(d.cast),GetUnitFacing(d.cast))
           SetUnitScale(d.dum,scalex(d.lvl),scaley(d.lvl),scalez(d.lvl))
           
           
            
            set .DT = .DT + 1
            set .D[.DT] = d
            if .DT == 1 then
                call TimerStart(.Timer,INTERVAL,true,function Data.update)
            endif
            
            return false
        endmethod

        static method onInit takes nothing returns nothing
            set .Timer     = CreateTimer()
            set .Group     = CreateGroup()
            set .Rect1     = Rect(0.00,0.00,1.00,1.00)
            set .Tree_filt = Filter(function Data.treefilt)
            set .Unit_filt = Filter(function Data.unitfilt)
            
            set .Game_maxX = GetRectMaxX(bj_mapInitialPlayableArea) - 64.00
            set .Game_maxY = GetRectMaxY(bj_mapInitialPlayableArea) - 64.00
            set .Game_minX = GetRectMinX(bj_mapInitialPlayableArea) + 64.00
            set .Game_minY = GetRectMinY(bj_mapInitialPlayableArea) + 64.00
            
            // Register event.
            call GT_AddStartsEffectAction(function Data.actions,ABIL_ID)
            
            set .Tree_dummy = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),DUMMY_ID,400,-400,0.00)
            call SetUnitPathing(.Tree_dummy,false)
            call ShowUnit(.Tree_dummy,false)
            
            set .Item  = CreateItem(&#039;ciri&#039;,400,-400)
            call SetItemVisible(.Item,false)
            
            if ALLOW_PRELOAD then
                call DestroyEffect(AddSpecialEffect(CASTED_SFX,400,-400))
            endif            
        endmethod
    
    endstruct

endscope</i></i>
 

mr subs

New Member
Reaction score
0
Hi! Let me first apologize for the following wall of text and let you know that I am very impressed with your helix. AMAZING

Could you please, please, please make a noob friendly form of the Elemental Helix for me? I'll give you huge credit all over the place in my map. I just started working on it again. I have been working on it weeks/months at a time for years, (the break time has been equally large, of course). I am never really satisfied enough to release it, but I have played it with 4 out of 8 players online once and 2 player several times when I was young and dumb and thought it was ready to be seen. The only critique one guy had was that it needed more unique custom spells. Its a Knights of the Round Table theme. For some reason I couldn't ever host a full game, I think I must have missed an old firewall when I turned my firewalls off, or perhaps I just need a custom map screen to get people to join.

I have really been looking into JASS language, but I still can't really read it. Also, I downloaded NewGen, GTrigger, and JASShelper 0.A.2.B, but downloading them is as far as I have gotten so far. I also don't know if I can even use JASS with my map since it is already started. I don't even know why it may or may not be possible.

Anyway, I can handle custom scripts and dummy units. So, again, any chance I could get a compatible helix for my capabilites?

Thanks for your time! I look forward to posting my map here on TH.net soon, since I included a help wanted section in the trigger editor and would love to get more people working on it and/or making it into a campaign, depending on how much love it gets. The map is 164x192, has 7880 doodads, 81 triggers, and over 500 custom units that I am currently finding skins and model files for. I just don't have time to make them anytime soon. So close, yet so far... I haven't even started the story.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top