HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Frost disease cloud? Optimization.

02-26-2007, 05:11 PM#1
Conquestor
Hello, I registered a while ago (Before the site went off), but never asked anything, since I used the search feature.

Ok. I am making a TD to learn how to use triggered abilities better, and am wondering if this is a good way to make a tower.

The tower is supposed to

-Shoots, and makes a "Frost cloud" (Disease cloud with a frost affect, instead of poisen.)

-Frost cloud lasts for 4 seconds

I am at work, so i can't use code tags right now, but here is the basic code.

Events
-Unit gains a buff

Conditions
-Buff equal to Frost cloud

Events
- Pick Buffed unit
-Create 1 Frost dummy (Unit with a 0 damage/animationless frost nova) at position of picked unit
-Order last created unit to Nova Dummy (The 0 damage frost nova) picked unit
- Add expiration timer to last created unit
- Clean up variables (1 unit 1 point)

Is that good, or is there a better way of doing this?

Also, I don't know JASS that well, but would it be more effecient to do that?
02-26-2007, 05:26 PM#2
Szythe
This can be divided into two triggers:

TRIGGER 1
Event - Unit Enters Region(Playable Map Area)
Condition - Unit-type is equal to (Frost Disease Cloud unit)
Action - Trigger: Add Event to (TRIGGER 2), whenever a unit comes within 150 range of (Triggering Unit)

TRIGGER 2
Event - None
Condition - None
Action - Create a Dummy caster at position of (Triggering Unit)
Action - Order Last Created Unit to Frost Nova (Triggering Unit)

It's been a while since I've used GUI, so sorry if these aren't the exact names of the functions.
Hope this helps :)
02-26-2007, 05:38 PM#3
Conquestor
But the "comes within range" would also have units currently slowed get nova'd again, right?

Would it still be worth it to do that, if you add a

Condition - Unit does not have Buff

?

This is for a basic tower, with quite a few creeps (I wanted to see when they start getting that "move bug", where they get stuck for a bit), so there can many of them at once.

*EDIT* + rep, also. *EDIT*
02-26-2007, 05:41 PM#4
The)TideHunter(
Szythe, i would say that is a poor trigger, it will leak a trigger event everytime the unit attacks, which will add up.
If units are already in the range, it will not fire, so another downfall there.

To be honest, i think, Conquestor, your original idea is a good idea.
See if it works, if it dosent, post it here, oh, and dont use code tags anyway, use [trigger] tags, like this: [trigger]CODE[/trigger].
02-26-2007, 08:06 PM#5
Szythe
Tide, I'm aware that it leaks, i was just outlining the logic of it. Also, if it is a tower defense map, then there aren't going to be any units just standing in the middle of a disease cloud, since the units are constantly moving, so there is no need to fire again on units which are already in range. His original idea would not work because such an event as "-Unit gains a buff" does not exist.

And yes, Conquestor, it would cast a new nova on any unit which comes within range, regardless of whether it is already slowed.
02-26-2007, 10:01 PM#6
Conquestor
I just got home.

Szythe, wouldn't this do it?

Trigger:
Frost cloud
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
((Triggering unit) has buff Frost ) Equal to True
Actions

Or does "starts the effect of an ability" not work?.
02-27-2007, 02:47 PM#7
The)TideHunter(
Quote:
Originally Posted by Szythe
Tide, I'm aware that it leaks, i was just outlining the logic of it. Also, if it is a tower defense map, then there aren't going to be any units just standing in the middle of a disease cloud, since the units are constantly moving, so there is no need to fire again on units which are already in range. His original idea would not work because such an event as "-Unit gains a buff" does not exist.

And yes, Conquestor, it would cast a new nova on any unit which comes within range, regardless of whether it is already slowed.

Um. You obviously don't understand the event, A unit Comes in range.
If you notice, it isent a unit is in range, its a unit COMES within range.
So if you were actually smart enough to realise, once the unit has attacked, it is in the range, but it doesnt come in range, so it will not slow the attacked unit or any units within the range.
And the "Unit gains buff" event is easily solvable by giving a period event or timer, that enums all units and checks for the buff, your idea will not work, period.
02-27-2007, 08:31 PM#8
Szythe
Correct me if I'm wrong, but from his original post this is what I think that he wants:

He wants a tower which shoots, and upon attacking creates a disease cloud unit at the point which the projectile hit. I gather that he has already completed this part by adding the meat wagon disease cloud ability to the tower.

The next part, is that he has units which move along a set path, from point A to point B, and the tower attacks them along the way. When the disease cloud is initially spawned, and the unit enters, and the event is added to the second trigger, all units inside the range initially will register the event for coming into range. I know that this is not logical, but this is the way that blizzard's triggers work. Obviously you did not take the 5 seconds to test this, and it is also obvious that you don't understand the event, A unit Comes in range. If you want to talk memory usage, then even though both mine and your methods work, I would much rather add an event which I cant clean up, than pick every single unit on the map every 0.1 seconds or so.

I'm sorry this had to turn into such a flamefest, but somebody shooting down my idea with no evidence to back it up, especially if they could have just tested it in 5 mins, really pisses me off. Back to the topic of helping the original poster, I've taken the time to make a demo map showing exactly what the triggers you will need are.
Attached Files
File type: w3xFrost Cloud Demo.w3x (18.2 KB)
02-27-2007, 08:47 PM#9
The)TideHunter(
Ehum, you would rather have a perminant leak than a inch of a milisecond process, sounds you really took this into thought.

And i don't normally need evidence, my memory normally serves me well, but i did test it, to find you were right, which i did not get one bit, as i remember it not registering units already in range, or units that blink, or somehow get into the radius without passing through the circumference.

Anyway, i would still rather not have an perminant event everytime the unit attacks, i seriously dont think thats a good idea.
02-27-2007, 09:00 PM#10
Szythe
I could create a Jass version which creates a new trigger every time a unit enters and destroy the trigger when it dies, instead of just adding an event to a currently existing trigger, but I have a feeling that Jass is a little out of the original poster's comprehension right now.
02-28-2007, 12:40 AM#11
Conquestor
Its not that JASS is out of my comprehension (I know 2 languages pretty good), its just that I didn't want to learn another one just for a hobby. But it looks like I will end up going with JASS afterall. Thanks for your help.
02-28-2007, 02:51 AM#12
Feroc1ty
How about have an ability on the unit, and every time he attacks a unit, order the unit to cast the spell.