Creating a spell that is automatically transferred to anothe

Post » Thu Jun 21, 2012 1:53 am

I want to create a spell that affects a single target when cast (thus FF Aimed), but after the duration expires this spell has to automatically jump to another close enemy, such as a spreading disease.

So, I have two questions regarding this implementation:

1) How can I get a valid close enemy without having to use, for example, a "while" calling "FindRandomActorFromRef()" many times till finding a close actor that is hostile and is alive?

2) After having the effect running on the first target and finding the next target, my goal is to call "DoCombatSpellApply()" to apply the spell to the next one. Do I have to create another "FF Self" spell to apply correctly to this second target, or can I just use the same "FF Aimed" spell I already have? (I want the spell to be directly applied, with no need to line of sight, crosshair direction, etc)
User avatar
Rik Douglas
 
Posts: 3385
Joined: Sat Jul 07, 2007 1:40 pm

Post » Wed Jun 20, 2012 6:57 pm

I've never used any of the FindxFromRef() functions, but from their wiki pages, they sound overly tedious/not ideally suited for this case.

Perhaps the method described in http://www.gamesas.com/topic/1349649-dynamically-attaching-scripts-to-actors-near-the-player/page__fromsearch__1 could be re-purposed for this situation.
User avatar
Ownie Zuliana
 
Posts: 3375
Joined: Thu Jun 15, 2006 4:31 am

Post » Thu Jun 21, 2012 2:32 am

Yeah, that method is probably what you want to use. It will not work for all NPCs (specifically: not for NPCs reserved by any quest), but should work on most.

As to point 2): NPCs fire aimed spells with pinpoint accuracy, and it does not seem to matter where they are facing, at least not if the spell is casted via script commnad (I used "spell.cast"). If you want the spell to be directly applied, target actors seems more like what you want to do though. And of course self spells are failproof. There could be a number of circumstances that make an NPC unable to hit someone with a spell, like bing paralyzed, or knocked down. I haven't done any testing on that though.
User avatar
Ashley Clifft
 
Posts: 3468
Joined: Thu Jul 26, 2007 5:56 am

Post » Wed Jun 20, 2012 5:03 pm

I created a rabies disease POC for one of the developers on the Blood of Hercine mod that might be of some use to you. Take a look at http://forums.nexusmods.com/index.php?/topic/565945-is-this-possible-to-make/page__p__4587096__hl__rabies__fromsearch__1#entry4587096 for starters.

-MM
User avatar
Sara Johanna Scenariste
 
Posts: 3381
Joined: Tue Mar 13, 2007 8:24 pm

Post » Wed Jun 20, 2012 6:48 pm

Couldn't you just do findclosestreffromlistnearref or whatever, then make the effect a constant effect that targets self, like an ability. Then just script in some onupdates to hardcode a duration into it and dispel() it and removespell() after x seconds. Then oneffectfinish do findclosestreffromlisttoref and then add the spell to whatever that function returns.
User avatar
Clea Jamerson
 
Posts: 3376
Joined: Tue Jun 20, 2006 3:23 pm


Return to V - Skyrim