Domhnall Posted August 3, 2009 Share Posted August 3, 2009 Returning to Oblivion after a few years off... I had a mod that used to work-- "Champions of Light" --CoL--. I do have 60 mods installed, and have SI with the Unofficial SI patch going. But in the past I also had at least 50 mods going on and may have had SI going. The mod is for the traditional Paladin/Priestly stuff, fighting against undead, black magic, etc. All of the spells are scripted. This one is targeting the Undead Faction and is supposed to cause Undead (just Skellies and Zombs) to flee 90% of the time. Now, however, it works on ALL enemies, regardless of their Faction: Scriptname DJRepulseUnholy1 begin ScriptEffectStart if GetInFaction UndeadFaction || GetInFaction MQ12Undead endif short random set random to getRandomPercent if random < 90 ForceFlee endif end So, 2 questions: 1) What is now wrong with this script so that it's now targeting ALL enemies, and 2) what I want is specific scripts that target the various Undead creatures in the game. I do not want these Paladin and Priest classes to ever summon, and therefore these characters have their Conjuration crashed down to -1000. This is why I went to Script usage in the fist place. SO--Is there a better way to ForceFlee these units other than GetInFaction? Thanks. Link to comment Share on other sites More sharing options...
Vagrant0 Posted August 4, 2009 Share Posted August 4, 2009 Your script is ALL wrong. You are declaring variables within blocks, and terminating conditions immediately after checking them. It should probably look something more like;Scriptname DJRepulseUnholy1 short random begin ScriptEffectStart set random to getRandomPercent if GetInFaction UndeadFaction || GetInFaction MQ12Undead if random < 90 ForceFlee endif endif end For your second part, you can't set skills to be negative, 0 is as low as it can go, and even then it can still be worked up using other conjuration spells. It's probably a better idea to just forget that part and leave it up to the player. Most NPCs of those classes don't have undead summoning skills anyway. If it really bothers you, you could add additional scripting that checks for the presence of known summoning effects on the player, and just force a high magnitude dispel. Although you can check specifically for undead type creatures using OBSE, that may be more trouble than it is worth. Link to comment Share on other sites More sharing options...
Domhnall Posted August 4, 2009 Author Share Posted August 4, 2009 Thanks. That scripts works. 2 new questions: 1) I need this script to do certain undead types while not doing others. At the moment this script is affecting all undead Factions (which includes other non-undead creatures (eg, Wolves). I would like to limit it to Creature type (EG, Skellies and Zombs for spell A-- Ghosts, Skellies, Zombs for spell B-- Vamps, Ghost, Skellies, & Zombs for spell C), but I cannot find a way to target creatures. Is this possible? --What about an "if X creature/faction, then ignore" function? 2) The ForceFlee lasts longer than I want. Is it possible to change the script to set a timer on the Fleeing? Thanks again. Link to comment Share on other sites More sharing options...
Khet Posted August 4, 2009 Share Posted August 4, 2009 http://cs.elderscrolls.com/constwiki/index.php/ForceFlee Take a look at that. Here's the important bit: If called with no parameters, the actor will choose where to flee and will decide when to stop fleeing in the same way that actors normally do. If there is not hostile threat to the actor, he will simply stand still for a few moments and then resume his normal AI package. Basically, unless you set a flee destination (which will be nigh impossible for what you're doing) then you cannot determine how long the actor will flee. To answer your faction question, there are a few factions to keep an eye out for. You have a VampireFaction, UndeadFaction, LichFaction. The problem? Well, many creatures are added to one of these factions to allow multiple critters in one area (you'll find Wolves standing right next to Liches and they won't attack) so there are two ways around this that I can think of off the top of my head. The first is to create an entirely new faction and manually add the undead you want affected by the spell to this faction(s) and call that faction in the script instead. HOWEVER, this won't work with custom made undead from other mods since they wouldn't be in the new factions. Second, remove the creatures from the undead factions. HOWEVER, this also won't work because of two reasons. The same as the one above, and you'll suddenly have rats and wolves attacking undead. Off the top of my head I can't really think of any easy way to do this as everything I'm coming up with would be incompatible with other mods that add custom deaders. Link to comment Share on other sites More sharing options...
Recommended Posts