Magekiller

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Magekiller
Lifecrafter
Member # 6193
Profile Homepage #0
I was planning on writing a script where an enemy would target whatever pc had the most priest skill, and put anti-magic clouds on that pc. Obviously this would eliminate the party's ability to heal.....

The framework for this script would be magekiller (by *i and edited by Kel). None of the three versions of this script that I have tested worked quite how I hoped. Namely; whenever a warrior gets close to the monster, it starts focusing on the melee fighters, not the casters. Since this monster will be shooting anti-magic clouds, this would pretty much ruin its effectiveness.

So this is my question, is there a way to stop my script from changing targets? Also, is there a call like get_target_location to find the target's (x,y) coordinates?

--------------------
Guaranteed to blow your mind.

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00
Infiltrator
Member # 5576
Profile Homepage #1
You can use char_loc_x(get_target()) and char_loc_y(get_target())
to find out the x and y coordinates of the target. I would recommend that you just have it check its target just before shooting fields to make sure that it is really aiming at a magic user. I have myself encountered some weird targeting difficulties, such as creatures temporarily targeting themselves. You can get around this kind of problem pretty well by storing the target in a variable of your own and making sure that the creature continues targeting the same target by using set_target to reset the target to your stored value.

--------------------
Überraschung des Dosenöffners!
"On guard, you musty sofa!"
Posts: 627 | Registered: Monday, March 7 2005 08:00
Off With Their Heads
Member # 4045
Profile Homepage #2
Those are Walker White's modifications, by the way. I was just the one who posted the scripts on the Codex, because WW was gone by that point.

I'm guessing that the reason that the monster is changing targets is the who_hit_me part of the targeting state. Find this code in the script and delete it:

// Have I been hit by nearby living creature? Strike back!
if (who_hit_me() >= 0) {
if (dist_to_char(who_hit_me()) <= 2 &&
char_ok(who_hit_me()) == TRUE) {
set_target(ME,who_hit_me());
set_state_continue(3);
}
}


--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
The Establishment
Member # 6
Profile #3
Feel free to try and improve the default one, the AI is rather fickle with respect to targeting.

[ Sunday, April 16, 2006 18:06: Message edited by: *i ]

--------------------
Your flower power is no match for my glower power!
Posts: 3726 | Registered: Tuesday, September 18 2001 07:00
Lifecrafter
Member # 6193
Profile Homepage #4
I had already tried taking out the who_hit_me part of the script, but I tried again and it still isn't working. The weird thing is that my pc isn't even attacking the monster, I just march him next to the monster and stand there.

I've used several different archer, ray, and breath type monsters, all of them decide to stop attacking the mage, and attack the melee fighter. They never refocus their attack back on the mage, which is pretty much the entire purpose of the edits in magekiller2.

Evidently the editor is just being, as *i said, fickle. I'll probably just take Niemand's solution and make a variable with the correct targets number in it. Don't be surprised if I have more questions on this script.

--------------------
Guaranteed to blow your mind.

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00
Agent
Member # 2820
Profile #5
So you want them to completely disregard any pummeling and only focus on the magic users? Maybe you already explained this, but I am guessing that your monster will have a nice ranged attack so that it can kill the magic users while they are in the antimagic cloud. But your wording seems to suggest that its only purpose is to create these clouds.

If the latter case is true, then it is completely fine to have the monster have separate targets; one for antimagic clouds and one for normal attacking. If the former is true, have you tried setting its strategy to 11?

--------------------
Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are.
====
Alorael: War and violence would end if we all had each other's babies!
====
Drakefyre: Those are hideous mangos.
Posts: 1415 | Registered: Thursday, March 27 2003 08:00
Lifecrafter
Member # 6193
Profile Homepage #6
The point is that when melee targets got close to it, it forgot all about its antimagic cloud attack.

This problem has been pretty much cleared up. I'm now using Kel's fieldshooter script (I think thats what it's called, I'm not on my normal computer.) The script uses variables to save targets like Niemand suggested, and with a few small changes it does what I want. Now I just have to get around to doing dialog for my scenario, I've been avoiding it.

--------------------
Guaranteed to blow your mind.

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00