HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Two Major Spells!

02-24-2007, 03:00 AM#1
WNxCryptic
Alrighty, hit a big stump with my JASSing with angles and whatnot :|

Entrapment

Base Spell: Thunder Clap (needed spell w/o targetting)

Units are created at 500 units out in a 360 degree radius around the caster, trapping all units for 4/5/6 seconds.

I'm having difficulty with a number of things regarding this spell: The barrier units need to have collision, but need to be unselectable. I need to do this spell without lag and without mass creating 100s of units. AND I need the spell to destroy the units after the time for the spell has elapsed. Obviously, the barrier units only need to be created on pathable terrain.

ADDED BONUS: If the units can spawn one by one (approximately 45 degrees per second) in a nice fluid motion, starting with the direction the caster is facing, that would make it nicer (and maybe less laggy) than magically creating a circle of units.

-------------------------------------

Entangle

Base Spell: Breath of Fire (needed cone based spell)

Units within 750 units and within a cone approximately 300 units (45 degrees) wide are rooted into the ground and take periodic damage.

I can't select the units because Breath of fire does not have a trackable effect or buff, nor do any of the other cone type spells.

-------------------------------------

Any help on these two would be GREATLY appreciated!!
02-24-2007, 03:57 AM#2
st33m
Doesnt breath of frost?
02-24-2007, 04:00 AM#3
WNxCryptic
..No idea..I'll try rebasing the spell off that.
02-24-2007, 04:43 AM#4
Pyrogasm
For entrapment, you'll need to give the units locust and store them to a global unit group variable. Then, every X seconds of game time, run a check for each of those units to see if there are any other units near it. If so, you'll need to move them back.

I'm actually in the process of making a spell that utilizes this mechanic, and the thread regarding it can be found here.

For entangle, do something like this:
Collapse JASS:
function AngleBetweenPointsXY takes real X1, real Y1, real X2, real Y2 returns real
    return Atan2((Y2-Y1),(X2-X1))*bj_RADTODEG
endfunction

function Your_Function takes nothing returns nothing
    local unit U = GetTriggerUnit()
    local real X1 = GetUnitX(U)
    local real Y1 = GetUnitY(U)
    local group G = GroupEnumUnitsInRange(G, X1, Y1, 750.00, null)
    local group G2 = CreateGroup()
    local unit U2
    local real X2
    local real Y2
    local real A = GetUnitFacing(U)

    loop
        set U2 = FirstOfGroup(G)
        exitwhen U2 = null
        set X2 = GetUnitX(U2)
        set Y2 = GetUnitY(U2)
        if (AngleBetweenPointsXY(X1, Y1, X2, Y2) > A+22.5 or AngleBetweenPointsXY(X1, Y1, X2, Y2) < A-22.5 then
            call GroupAddUnit(G2, U2)
        endif
        call GroupRemoveUnit(G, U2)
    endloop
    //Do actions with G2 here.
endfunction
02-24-2007, 02:07 PM#5
WNxCryptic
Well, actually I realized in this map I already created a dummy buff "Unselectable" and created a trigger that force-deselects a unit whenever it's selected if it has such a buff.

Would that not work a little better without all the triggering?
02-24-2007, 02:30 PM#6
Ammorth
I was experimenting with setting the selection size to 0 or negative numbers in the object editor, by hold shift. See if you can get anything to work like that.
02-24-2007, 04:08 PM#7
WNxCryptic
It doesn't. The selection scale is only the size of the selection circle, and drag-selecting will always pick it.