wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 03-15-2011, 10:40 PM   #1
Ignitedstar
Moderator
 
Ignitedstar's Avatar


RP Section Moderator
 
Join Date: Jul 2005
Posts: 1,755

Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)

Send a message via MSN to Ignitedstar Send a message via Yahoo to Ignitedstar
Default Detecting a rooted unit?

This may be an oversight upon my part, but alas I am running out of time before I have to do stuff.

I know that you can detect when a unit uses the root and unroot order ids, but is possible to detect whether or a unit is already rooted? I have a passive ability that should only work if the Ancient is rooted. Any help is much appreciated. Thanks, guys.
__________________
Current Activity: It's a secret, now.
Evaluation: I actually logged in?!?!
"If I speak in the tongues of men and of angels, but have not love,
I am only a resounding gong or a clanging cymbal.
If I have the gift of prophecy and can fathom all mysteries and all knowledge,
and if I have a faith that can move mountains, but have not love, I am nothing."

1 Corinthians 13:1-2

Current Works:
None.
Ignitedstar is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 03-16-2011, 05:13 AM   #2
Fledermaus
default string
 
Fledermaus's Avatar
 
Join Date: May 2006
Posts: 705

Submissions (1)

Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)

Send a message via MSN to Fledermaus
Default

Assuming all the units will either come into the game as rooted or unrooted, set a boolean array (e.g. called Rooted) to true or false accordingly when they're created. Update it whenever they root/unroot. Then you can just check the array.
Fledermaus is offline   Reply With Quote
Old 03-16-2011, 06:37 AM   #3
Ignitedstar
Moderator
 
Ignitedstar's Avatar


RP Section Moderator
 
Join Date: Jul 2005
Posts: 1,755

Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)

Send a message via MSN to Ignitedstar Send a message via Yahoo to Ignitedstar
Default

Yes, of course... I've done that so many times that it should have come naturally. Oh well. Thank you.
__________________
Current Activity: It's a secret, now.
Evaluation: I actually logged in?!?!
"If I speak in the tongues of men and of angels, but have not love,
I am only a resounding gong or a clanging cymbal.
If I have the gift of prophecy and can fathom all mysteries and all knowledge,
and if I have a faith that can move mountains, but have not love, I am nothing."

1 Corinthians 13:1-2

Current Works:
None.
Ignitedstar is offline   Reply With Quote
Old 03-16-2011, 06:46 PM   #4
chobibo
100% Genuine Retard!
 
chobibo's Avatar
 
Join Date: Jan 2007
Posts: 797

chobibo has a spectacular aura about (101)chobibo has a spectacular aura about (101)chobibo has a spectacular aura about (101)chobibo has a spectacular aura about (101)

Send a message via Yahoo to chobibo
Default

Try ordering the unit to move, I guess it will return false (IssuePointOrder).
chobibo is offline   Reply With Quote
Old 03-16-2011, 09:47 PM   #5
Fledermaus
default string
 
Fledermaus's Avatar
 
Join Date: May 2006
Posts: 705

Submissions (1)

Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)

Send a message via MSN to Fledermaus
Default

Then you need LastOrder and setup something to catch the move order and issue the previous order so stuff doesn't get messed up. Also I'd assume that since it's a passive it'd be called a lot, so seems simpler to me to just use the boolean array.
Fledermaus is offline   Reply With Quote
Old 03-17-2011, 01:56 AM   #6
Nuclear Arbitor
Reputation Leech
 
Nuclear Arbitor's Avatar
 
Join Date: May 2007
Posts: 1,235

Submissions (1)

Nuclear Arbitor has a spectacular aura about (83)Nuclear Arbitor has a spectacular aura about (83)Nuclear Arbitor has a spectacular aura about (83)

Default

chobibo's works if some start rooted and some start not though. and you might be able to call it once on particular units to set the true/false for that particular unit.
Nuclear Arbitor is offline   Reply With Quote
Old 03-17-2011, 03:57 AM   #7
chobibo
100% Genuine Retard!
 
chobibo's Avatar
 
Join Date: Jan 2007
Posts: 797

chobibo has a spectacular aura about (101)chobibo has a spectacular aura about (101)chobibo has a spectacular aura about (101)chobibo has a spectacular aura about (101)

Send a message via Yahoo to chobibo
Default

Can't you get the current order by using the GetUnitCurrentOrder? Also using a boolean is fast, but that value needs to get attached to the said unit, so you would need to index units, or use the hashtable to attach the boolean data to the unit.

It's not as simple as you think, no offense dude.

Another way to do this is by making a dummy ability, base it on something like item armor bonus and clear the bonuses, detect when a unit is ordered to "root" then add the said ability to the unit. To check if a unit is rooted, check if the dummy has the ability. Don't forget to remove the dummy ability once the unit is ordered to "unroot".
chobibo is offline   Reply With Quote
Old 03-17-2011, 05:37 AM   #8
Nuclear Arbitor
Reputation Leech
 
Nuclear Arbitor's Avatar
 
Join Date: May 2007
Posts: 1,235

Submissions (1)

Nuclear Arbitor has a spectacular aura about (83)Nuclear Arbitor has a spectacular aura about (83)Nuclear Arbitor has a spectacular aura about (83)

Default

i don't have a clue how simple its, my experience with programing is pretty limited; I'm just spewing ideas and bumping my post count.
Nuclear Arbitor is offline   Reply With Quote
Old 03-17-2011, 05:55 AM   #9
Ignitedstar
Moderator
 
Ignitedstar's Avatar


RP Section Moderator
 
Join Date: Jul 2005
Posts: 1,755

Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)

Send a message via MSN to Ignitedstar Send a message via Yahoo to Ignitedstar
Default

Quote:
Originally Posted by chobibo
Can't you get the current order by using the GetUnitCurrentOrder? Also using a boolean is fast, but that value needs to get attached to the said unit, so you would need to index units, or use the hashtable to attach the boolean data to the unit.
This will work, because only one type of this particular Ancient can be put on the map at any point in time. He obtains an index the instantly it is made. The passive not only checks for the boolean, but whether or not the unit type of the index is the said Ancient because that same unit index is used for a multitude of units.

Even though that's true, it's still not working. It works in the fact that it works, but it's not working the right way. This is not worth the time I thought it was going to take.

EDIT: Hmm... Maybe I can just remove the passive ability when he's rooted? But then I'd need another variable to keep track of the level of the passive... It would work, though. I think.
__________________
Current Activity: It's a secret, now.
Evaluation: I actually logged in?!?!
"If I speak in the tongues of men and of angels, but have not love,
I am only a resounding gong or a clanging cymbal.
If I have the gift of prophecy and can fathom all mysteries and all knowledge,
and if I have a faith that can move mountains, but have not love, I am nothing."

1 Corinthians 13:1-2

Current Works:
None.

Last edited by Ignitedstar : 03-17-2011 at 06:03 AM.
Ignitedstar is offline   Reply With Quote
Old 03-17-2011, 02:06 PM   #10
chobibo
100% Genuine Retard!
 
chobibo's Avatar
 
Join Date: Jan 2007
Posts: 797

chobibo has a spectacular aura about (101)chobibo has a spectacular aura about (101)chobibo has a spectacular aura about (101)chobibo has a spectacular aura about (101)

Send a message via Yahoo to chobibo
Default

So what's not working properly?

EDIT: I stand corrected, Fledermaus' solution would be better since you're already using an indexer. Oh and sorry Nuclear Arbitor, I was replying to Fledermaus' post, I wasn't implying anything about yours.

Last edited by chobibo : 03-17-2011 at 02:18 PM.
chobibo is offline   Reply With Quote
Old 03-17-2011, 06:55 PM   #11
Ignitedstar
Moderator
 
Ignitedstar's Avatar


RP Section Moderator
 
Join Date: Jul 2005
Posts: 1,755

Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)

Send a message via MSN to Ignitedstar Send a message via Yahoo to Ignitedstar
Default

The passive is working in the fact that the effect is working. It just doesn't only work when the Ancient is rooted.
I will try using LastOrder and will tell the results when I get them.
__________________
Current Activity: It's a secret, now.
Evaluation: I actually logged in?!?!
"If I speak in the tongues of men and of angels, but have not love,
I am only a resounding gong or a clanging cymbal.
If I have the gift of prophecy and can fathom all mysteries and all knowledge,
and if I have a faith that can move mountains, but have not love, I am nothing."

1 Corinthians 13:1-2

Current Works:
None.

Last edited by Ignitedstar : 03-17-2011 at 06:55 PM.
Ignitedstar is offline   Reply With Quote
Old 03-17-2011, 08:43 PM   #12
chobibo
100% Genuine Retard!
 
chobibo's Avatar
 
Join Date: Jan 2007
Posts: 797

chobibo has a spectacular aura about (101)chobibo has a spectacular aura about (101)chobibo has a spectacular aura about (101)chobibo has a spectacular aura about (101)

Send a message via Yahoo to chobibo
Default

could you post the code you're using, maybe I could help.
chobibo is offline   Reply With Quote
Old 03-17-2011, 09:30 PM   #13
PurgeandFire111
User
 
PurgeandFire111's Avatar
 
Join Date: Dec 2006
Posts: 253

PurgeandFire111 will become famous soon enough (58)PurgeandFire111 will become famous soon enough (58)

Default

Is your ancient able to create units? If so, an easy method would be to see if its rally point is null. If it is not null, it is rooted. Else it is unrooted.

Otherwise, it is a bit more complicated to detect it. You would probably use Fledermaus' method, but since you can't detect when the actual root is taking place, you would need to run something along the lines of a timer to detect if it has reached the area or not, and cancel the timer if it is issued another order.

The LastOrder library works for the most part, but when issuing the order, it will lose its recursiveness and fail. IssueLastOrder() doesn't get reset as the last order, afaik, so then the next last order will point to the "testing" issue you made. So overall, this method might become pretty complicated as well.

Buffs also do not work, as it doesn't apply buffs on the unit when it casts the root ability. It is weird. :(
PurgeandFire111 is offline   Reply With Quote
Old 03-17-2011, 09:42 PM   #14
Ignitedstar
Moderator
 
Ignitedstar's Avatar


RP Section Moderator
 
Join Date: Jul 2005
Posts: 1,755

Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)

Send a message via MSN to Ignitedstar Send a message via Yahoo to Ignitedstar
Default

Bleh... I tried debugging and it looks like the trigger doesn't even trigger when Root is used.

Okie... This is not worth the time to get this to work. It's alright, you guys. I'll just nerf the ability and make it work 24/7. Thanks for the help, though.
__________________
Current Activity: It's a secret, now.
Evaluation: I actually logged in?!?!
"If I speak in the tongues of men and of angels, but have not love,
I am only a resounding gong or a clanging cymbal.
If I have the gift of prophecy and can fathom all mysteries and all knowledge,
and if I have a faith that can move mountains, but have not love, I am nothing."

1 Corinthians 13:1-2

Current Works:
None.
Ignitedstar is offline   Reply With Quote
Old 03-18-2011, 02:01 AM   #15
Nuclear Arbitor
Reputation Leech
 
Nuclear Arbitor's Avatar
 
Join Date: May 2007
Posts: 1,235

Submissions (1)

Nuclear Arbitor has a spectacular aura about (83)Nuclear Arbitor has a spectacular aura about (83)Nuclear Arbitor has a spectacular aura about (83)

Default

oh, lol. and i thought i could finally RAGE
Nuclear Arbitor is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 05:23 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

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