HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

New ability, dont know how to go about creating.

04-20-2007, 04:46 AM#1
substance
Im making an ability that creates a unit (base) at a target location facing the direction that the caster is facing then a 'laser' should extend from the base in the direction of the base untill it intersects with a wall. The base and laser will stay there untill a certain duration or untill someone destroys the base. Anyone who intersects with the 'laser' should take damage. I made the ability and got it working but the way i made it has too many problems and isnt optimized at all so I need ideas for a new approach at making this ability.

Right now the method im using creates units in a line, beforehand checking if the location is pathable (to tell if its hitting a wall) then giving that unit the AOE mine ability which deals damage to anyone who comes into range. But as I said, this method sucks because of a bunch of problems (not to mention it doesnt lok good either).

As far as a new way, I was thinking maybe when i create the base I could use polar projection to find the location of where the laser would hit a wall then create an effect that extends from the base point to the wall point. I dont know how to do that though, not to mention how i would damage units touching just the effect.

Suggestions?
04-20-2007, 05:03 AM#2
wussupallies
Well you could create the laser effect, and then have a unit at the starting point of the laser continually cast small/fast shockwaves towards the endpoint. Just an idea.
04-20-2007, 05:11 AM#3
Pyrogasm
I would suggest just having a dummy unit cast shockwave or carrion swarm in the direction of the laser, as wussupallies has said.

Additonally, you could make all of your effect units have Permanent Immolation. But that could do variable amounts of damage and/or not work with the time the effect units are present.
04-20-2007, 05:46 AM#4
substance
Wouldnt that cause as much cpu usage as setting up an event every .5 seconds or so to do damage to whatever units?

Well, even if that works I still dont know how i'd create the actual effect.
04-20-2007, 05:54 AM#5
Pyrogasm
Quote:
Originally Posted by substance
Wouldnt that cause as much cpu usage as setting up an event every .5 seconds or so to do damage to whatever units?
Which method are you saying will cause lag?
04-20-2007, 06:53 AM#6
substance
Either way, that's not my big issue here =p.

I can worry about damage later, but thats a good idea regardless.
04-20-2007, 08:53 AM#7
Zwan
are you asking how to project the units in the proper directions? Or how to check for terrain?
04-20-2007, 09:29 AM#8
substance
Quote:
Originally Posted by Zwan
are you asking how to project the units in the proper directions? Or how to check for terrain?

Niether, I know how to do those things, but like I said above.. that is the old method that doesnt work to well. I need a new way of making the ability.
04-20-2007, 02:04 PM#9
Zwan
well I assume you have a laser model already, you can use units with immolation that have thier model file set to the laser model.

or possibly use dummy units and edit the projectile art for life drain to the laser and have them target each other with a slowed down missle speed. I think it would work if thier aquisition range was maxed out. I dont recall if life drain's missle is instant or not though.
04-21-2007, 03:28 AM#10
substance
Well I found decent way of visually showing the laser, simple using AddLighting from the laser base to the wall (or max laser length).

Quote:
I would suggest just having a dummy unit cast shockwave or carrion swarm in the direction of the laser, as wussupallies has said.

That would work PERFECTLY but I would somehow have to change the range of the dummy ability since the laser's length would be different dependant on where it was put and im pretty sure that's not possible.

So I guess I'll have to go with the method of creating a bunch of units in a line and giving them immolation. This would mean that making it so that if the base is killed, the laser dies as well will be a bit more difficult.
04-21-2007, 03:32 AM#11
Dil999
you could just make an ability with oh, say, 1000 levels, each going up by 5 distance. Then just set the level of the shockwave for the unit to distance between point 1 and 2 /5
04-21-2007, 04:59 AM#12
substance
Haha, I'll keep that idea in mind.
04-21-2007, 05:52 AM#13
darkwulfv
No, bad idea. 1000 level spells take bitch-long to load. Even 1 could slow down the load time to the point where it's retarded.
04-21-2007, 06:43 AM#14
Zwan
well now that you have the effect your getting closer. Are you still using units for the actual laser or are you leaving the lightning effects in place?
04-21-2007, 06:57 AM#15
substance
Quote:
Originally Posted by Zwan
well now that you have the effect your getting closer. Are you still using units for the actual laser or are you leaving the lightning effects in place?

I'm using the lighting as the effect, but still creating the units. So now it's back to how it can deal the damage. Also have to keep in mind that eventually i want it so that if the base is destroyed, the laser will die (effect and all).

Here's what I have (not paying attention to leaks or anything) :

Collapse JASS:
function Laser takes nothing returns nothing 
    local unit Triggerer = GetTriggerUnit() 
    local location CasterPosition = GetUnitLoc(Triggerer) 
    local real castOffset = 80 
    local location castPoint 
    local unit caster 
    local unit baseu 
    local boolean base = false    
    local integer max = 1500 
    local boolean end = false 
    local lightning laser 

    loop 
        exitwhen end == true 
        set castPoint=PolarProjectionBJ(GetUnitLoc(Triggerer),castOffset,GetUnitFacing(Triggerer)) 

        if base == false then 
        set baseu = CreateUnit(GetOwningPlayer(Triggerer),'u00E',GetLocationX(castPoint),GetLocationY(castPoint),GetUnitFacing(Triggerer)+90) 
        set laser = AddLightning("AFOD",true,GetUnitX(baseu),GetUnitY(baseu),GetLocationX(castPoint),GetLocationY(castPoint)) 
        set base = true 
        endif   

        set castOffset = castOffset + 90.00 

        if castOffset >= max then 
        set end = true 
        call RemoveLocation(castPoint) 
        else 
        call MoveLightning(laser,true,GetUnitX(baseu),GetUnitY(baseu),GetLocationX(castPoint),GetLocationY(castPoint)) 
        set caster = CreateUnit(GetOwningPlayer(Triggerer),'u00D',GetLocationX(castPoint),GetLocationY(castPoint),GetUnitFacing(Triggerer)) 
        endif 

        call RemoveLocation(castPoint) 
    endloop 
endfunction