BloodSyndicate Posted August 8, 2007 Share Posted August 8, 2007 I find the games enemy AI, and combat behavior, to be very boring. I know how to change their combat behavior with scripting, but now I want to force them to cast spells. Ive tried alot of things and so far, target spells only work in close range when you force actors to cast.I dont think there is a way around this, so im working on an alternative. I found 2 possible alternatives 1: Force a casting animation. And script the effects on their targetProblem: They only play the animation. The effect is lost. And if i do use the function playmagiceffectvisualsit plays it as if the actor is the one being effected. So basically they lose the light effect around their hands when casting, which takes away alot. 2: Create complex scripts which remove and add spells on the reference, forcing them to cast certain spells.Problem: This doesent even work when theyre in combat for some reason. I might be able to disable combat on them temporarily to add and remove the spells, but I kindof doubt that would work well... I know this is a tough problem to tackle but if anyone has any ideas I would really appreciate it, thank you. Link to comment Share on other sites More sharing options...
Vagrant0 Posted August 9, 2007 Share Posted August 9, 2007 You can use self.cast XXXXXXXX target to force them to cast that spell under those specific conditions (such as target.get distance, self.getav health, target.hasmagiceffect). If the conditions aren't something you can really check for, you can still use a random percent along with some more basic conditions to add some further variation to combat. For getting the target, you can use either the actor, or self.getconbattarget. They don't actually need that spell in their spell list to use that spell, but they may need to meet the certain skill or magicka requirements for it. With combining both scripted elements and combat styles, you should be able to do what you want to do. It's only when you can't add those scripting elements (like when using standard NPCs who probably already have scripting) that things become difficult. Link to comment Share on other sites More sharing options...
BloodSyndicate Posted August 9, 2007 Author Share Posted August 9, 2007 With combining both scripted elements and combat styles, you should be able to do what you want to do. It's only when you can't add those scripting elements (like when using standard NPCs who probably already have scripting) that things become difficult. Well, Im not so sure about that. I want them to cast a target spell. If you look on the wiki it even tells you this function is bugged. If they arnt at touch range (which i dont think is defined by combat style) they will either try and get within touch range and cast the spell, or they will ignore the function entirely. The only thing in combat style that might work is their standoffdistance.. But Ive already been using this against a mage actor while he was in ranged mode and it still works the same way. His standoff may be far away but he tries to run into touch range to cast the spell. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.