[RESOLVED] Multi Unit Movement Dectection

This is where all discussion of WC3 mapmaking should be held. This forum exists particularly for mapmaking needs. If you have a question on how something works or have need for some code review, this is the place to put it.
Locked
User avatar
The Colonel
Letter Linguist
Posts: 547
Joined: Tue Jan 15, 2008 12:17 am
Location: NLO

[RESOLVED] Multi Unit Movement Dectection

Post by The Colonel » Wed Apr 16, 2008 5:25 pm

We know how to detect single unit movement, but not many. The spell we are trying to do is the following;

Ability 3: Aura of Exhaustion.
Icon's Location.
Image
Cool Down: 10 seconds. Mana Cost: 0. Effect: Activated/Deactivated ability. When ever this spell is active, every 2 seconds all moving targets have a 25% chance to fall asleep for 3 seconds. Drains 1.25 mana per second. Sleep is broken when damage is taken. Does not effect undead.

The question is, how can we detect the movement of any unit around the caster?
Image

User avatar
The Colonel
Letter Linguist
Posts: 547
Joined: Tue Jan 15, 2008 12:17 am
Location: NLO

Re: Multi Unit Movement Dectection

Post by The Colonel » Fri Apr 18, 2008 5:36 pm

Do you not know how to do it Dusky? Or are you just being mean?
Image

User avatar
Rising_Dusk
Chosen of the Intargweeb
Posts: 4031
Joined: Sat Dec 15, 2007 1:50 pm
Contact:

Re: Multi Unit Movement Dectection

Post by Rising_Dusk » Fri Apr 18, 2008 5:39 pm

I like how when I don't see a topic when it's first posted, people assume I'm being mean or that I'm incapable. (Even though a spell in DoE already detects movement...)
The question is, how can we detect the movement of any unit around the caster?
Group them, loop through group and store current X/Y positions, run a 0.01 second timer, loop through group and check current X/Y positions against stored ones. If they are the same, they aren't moving, otherwise they are.
"I'll come to Florida one day and make you look like a damn princess." ~Hep

User avatar
The Colonel
Letter Linguist
Posts: 547
Joined: Tue Jan 15, 2008 12:17 am
Location: NLO

Re: Multi Unit Movement Dectection

Post by The Colonel » Fri Apr 18, 2008 5:49 pm

Sorry, it was just sitting here for 2 days unreplied too.

That'll likely work... lemme test. Oh, and thanks.
Image

User avatar
Cold Phoenix
Keeper of the Keys
Posts: 449
Joined: Tue Jan 15, 2008 11:32 am

Re: Multi Unit Movement Dectection

Post by Cold Phoenix » Fri Apr 18, 2008 8:05 pm

How do you store the multiple variables for locations of the units in the unit group. Or do you not use variables? I'll assume that's what you meant by store but I can't be sure. >.>
Your move.

User avatar
Rising_Dusk
Chosen of the Intargweeb
Posts: 4031
Joined: Sat Dec 15, 2007 1:50 pm
Contact:

Re: Multi Unit Movement Dectection

Post by Rising_Dusk » Fri Apr 18, 2008 8:12 pm

How do you store the multiple variables for locations of the units in the unit group. Or do you not use variables? I'll assume that's what you meant by store but I can't be sure. >.>
Consider what a variable was created for in programming languages -- To store things.
"I'll come to Florida one day and make you look like a damn princess." ~Hep

User avatar
Cold Phoenix
Keeper of the Keys
Posts: 449
Joined: Tue Jan 15, 2008 11:32 am

Re: Multi Unit Movement Dectection

Post by Cold Phoenix » Fri Apr 18, 2008 8:28 pm

Let me reword that.

How can you assign each unit in the group to a different variable to be later checked?
Your move.

User avatar
Rising_Dusk
Chosen of the Intargweeb
Posts: 4031
Joined: Sat Dec 15, 2007 1:50 pm
Contact:

Re: Multi Unit Movement Dectection

Post by Rising_Dusk » Fri Apr 18, 2008 9:19 pm

You add a unit to a group and then ForGroup through the group later on. You'll use some unit indexing system to store the parameters to array entries at indexes corresponding to your units. I trust you have some kind of unit indexing system, otherwise you'll need one or this will be harder than you can do in GUI.

You could load all units affected to an array and synchronize that array with another two arrays corresponding to their original X and Y values, then index through the arrays later. This kills MUI, but will work. For MUI, see my first paragraph.
"I'll come to Florida one day and make you look like a damn princess." ~Hep

User avatar
Rising_Dusk
Chosen of the Intargweeb
Posts: 4031
Joined: Sat Dec 15, 2007 1:50 pm
Contact:

Re: Multi Unit Movement Dectection

Post by Rising_Dusk » Mon Apr 28, 2008 9:43 pm

This topic has been locked and declared resolved.
If you would like to re-open this topic for further discussion, please PM a moderator and explain why.
"I'll come to Florida one day and make you look like a damn princess." ~Hep

Locked

Return to “Custom Map Creation”