Back up target variable

Posted by This_Guy on Thu 30 Dec 2010 04:02 AM — 6 posts, 20,956 views.

#0
I'm trying to build a variable that would feed my target variable a new target if the world sends me one of the following messages:

You do not see that individual here.

I do not recognize anything called that here.

You detect nothing here by that name.


How exactly would I go about this?
Australia Forum Administrator #1
What do you mean by "feed my target variable a new target"? What would the new target be?
#2
Say I kill a guy by the name of Dias, and i don't notice and someone name Ivellios is wailing on me. I want to be able to have someway to have Ivellios automatically targeted in case there is too much text coming at me to make anything out.
#3
I think I'd find your particular goal a difficult one to meet. You might find it easier to conceptualize if you instead target the core of the problem.

I wouldn't think of this as a problem of switching variables, but one of tracking your combat opponents. Can you identify specific messages that would begin (or simply indicate continuing combat with) opponents and also their deaths/fleeing?

If those messages are fairly well defined, it'd be a reasonable task to create a plugin that would automatically cycle through your current combatants as you kill them one by one. You'll use a series of triggers that view combatants entering (or continuing) combat with you and send them to a function that adds each of them to an array. You'll have a series of triggers that capture your kills and removes those opponents from the array. When your current target is removed from the array, you'll choose your target again as the first element of that array. (A more crude but more direct method of selecting a new target is to have a third set of triggers on the messages you mentioned in your last post so that you only switch targets when you attempt to swing at something that doesn't exist. Actually, you could do away with the death triggers if you don't mind those messages after each and every kill).

It may be slightly more difficult to handle multiple combatants of the same name or description.
#4
I have an echo set for opponent deaths, but if one flees or if there is a mob of them and i can't see which one is hitting me things tend to get nasty pretty quick
Australia Forum Administrator #5
You could easily make a trigger that matches:


You do not see that individual here.


That could set the target variable to an empty string. That doesn't however tell you who the new target is.

Without knowing your triggers it is hard to be more specific, but assuming you have some sort of trigger that detects if you are being attacked, and sets the target variable to whoever is attacking you, then that should cut in shouldn't it?