[RESOLVED] Multi Unit Movement Dectection
- The Colonel
- Letter Linguist
- Posts: 547
- Joined: Tue Jan 15, 2008 12:17 am
- Location: NLO
[RESOLVED] Multi Unit Movement Dectection
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.
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?
Ability 3: Aura of Exhaustion.
Icon's Location.
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?
- The Colonel
- Letter Linguist
- Posts: 547
- Joined: Tue Jan 15, 2008 12:17 am
- Location: NLO
Re: Multi Unit Movement Dectection
Do you not know how to do it Dusky? Or are you just being mean?
- Rising_Dusk
- Chosen of the Intargweeb
- Posts: 4031
- Joined: Sat Dec 15, 2007 1:50 pm
- Contact:
Re: Multi Unit Movement Dectection
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...)
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.The question is, how can we detect the movement of any unit around the caster?
"I'll come to Florida one day and make you look like a damn princess." ~Hep
- The Colonel
- Letter Linguist
- Posts: 547
- Joined: Tue Jan 15, 2008 12:17 am
- Location: NLO
Re: Multi Unit Movement Dectection
Sorry, it was just sitting here for 2 days unreplied too.
That'll likely work... lemme test. Oh, and thanks.
That'll likely work... lemme test. Oh, and thanks.
- Cold Phoenix
- Keeper of the Keys
- Posts: 449
- Joined: Tue Jan 15, 2008 11:32 am
Re: Multi Unit Movement Dectection
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.
- Rising_Dusk
- Chosen of the Intargweeb
- Posts: 4031
- Joined: Sat Dec 15, 2007 1:50 pm
- Contact:
Re: Multi Unit Movement Dectection
Consider what a variable was created for in programming languages -- To store things.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. >.>
"I'll come to Florida one day and make you look like a damn princess." ~Hep
- Cold Phoenix
- Keeper of the Keys
- Posts: 449
- Joined: Tue Jan 15, 2008 11:32 am
Re: Multi Unit Movement Dectection
Let me reword that.
How can you assign each unit in the group to a different variable to be later checked?
How can you assign each unit in the group to a different variable to be later checked?
Your move.
- Rising_Dusk
- Chosen of the Intargweeb
- Posts: 4031
- Joined: Sat Dec 15, 2007 1:50 pm
- Contact:
Re: Multi Unit Movement Dectection
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.
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
- Rising_Dusk
- Chosen of the Intargweeb
- Posts: 4031
- Joined: Sat Dec 15, 2007 1:50 pm
- Contact:
Re: Multi Unit Movement Dectection
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.
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