Wc3C.net (http://www.wc3c.net/forums.php)
-   vJass Spells (http://www.wc3c.net/forumdisplay.php?f=647)
-   -   Tripwire (http://www.wc3c.net/showthread.php?t=103561)

Anitarf 11-29-2008 03:24 AM

2 Attachment(s)
A spell that creates a tripwire between two target points. The first enemy ground unit to cross the wire will take damage and become stunned.

The spell requires the following resources:
TimerUtils, LineSegment, SimError, IsUnitSpellResistant, xe, ABuff

This spell was requested by Jazradel in the spell request thread.
Expand Spell code:

moyack 11-29-2008 04:13 AM

Could you post the code for the lazy people who don't want to open the WE.... like me... thanks :P

Vexorian 11-29-2008 04:16 AM

Moyack, you should already have had WarCiTy in your system.

Anitarf 11-29-2008 04:25 AM


Originally Posted by moyack
Could you post the code for the lazy people who don't want to open the WE.... like me... thanks :P


Jazradel 11-29-2008 04:41 AM

Very impressive.

Ammorth 11-29-2008 05:07 AM


//code shamelessly copied from Ammorth's Line Segments
Don't feel bad. In essence, all code is just a form of copying someone else's code.

Ps: for the record, you have permission :P

Anitarf 12-01-2008 08:18 PM


Originally Posted by Litany
The targeting itself doesn't seem to be very robust here either. It breaks without fail for me after selecting 3-4 invalid second targets.

That's odd, it works without fail for me; perhaps it's a framerate issue, have you tried increasing the CANCEL_MARGIN constant?

Rising_Dusk 12-03-2008 05:42 PM

So why did you shamelessly copy Ammorth's line segments instead of just using it?

Anitarf 12-03-2008 09:20 PM

I can't use it because his GroupEnumUnitsInRangeOfSeg function doesn't take unit's collision sizes into account and if I wanted to do that without inlining his code I'd have to deal with locations; so I inlined his code instead for the sake of efficiency.

Ammorth 12-04-2008 03:07 AM

Not asking for you to not in-line it, but wouldn't adding the correction factor to the range accomplish the exact same thing?

Collapse JASS:
GetEnumUnitsInRangeOfSeg(arguments..., distance + collisionCorrection)

In-lining is totally fine with me as performance with spells is important.

Rising_Dusk 12-04-2008 06:09 AM

CollisionCorrection as you have it would be unit-type dependent, something that can't be accessed in JASS without hardcoding it or using a processing-hog function. Performing IsUnitInRange..(...) checks guarantees that a unit's collision is properly factored.

Anyways, you should probably update LineSegments to include collision checks and I think Anitarf should then update this to use LineSegments. It seems counter-productive to shoot for modularity as a site scripting goal if we're just inlining other peoples' codes because they lack a very specific feature that they should have anyways.

Flame_Phoenix 12-15-2008 10:39 PM

1 Attachment(s)
Impressive in deed. However I fail to understand why it doesn't work sometimes ....
When I tested the spell, there was a time I had a unit in the wire and yet nothing happened. Problem is that this "there was a time" gets repeated quite often ...

here is the replay, I hope it helps:

Anitarf 01-02-2009 03:24 PM

Updated, the spell now uses the LineSegment library which also fixes the bug that Flame_Phoenix reported.

Rising_Dusk 01-02-2009 07:41 PM

Good, then consider this approved.

Anitarf 08-04-2009 11:18 PM

Updated the test map so it works in 1.24 (had to import the new Table and TimerUtils, everything else remains the same).

All times are GMT. The time now is 07:48 AM.

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services