Need Help with multiple NPCs from one spell

Post » Tue Jun 19, 2012 3:03 pm

Hello.

I'm trying to figure out how to get one conjuration spell to summon several NPCs at the same time - not relying on Twin Souls perk or anything else.

Basically, as an example.. say I'm trying to make a basic conjuration spell that will summon a pack of Skeevers. I want the spell to summon three skeevers at the same time, who will then act just like the basic familiar would.

I've tried making 3 different effects, using one skeever.
I've tried making 3 different effects, using three individual skeevers.

The effects are all listed on the spell itself.. but it only ever summons ONE skeever when I cast it in the game.


I saw that the Werewolf's howl ability thing has a special script for conjuring up three wolves at once... is that what is necessary to pull this off? You have to use a script?

If so, I have no idea how to script (for the most part). I'd also need to know where/how to attach the script. Could anyone help me out here?
User avatar
i grind hard
 
Posts: 3463
Joined: Sat Aug 18, 2007 2:58 am

Post » Tue Jun 19, 2012 3:24 pm

Bumpity.... nothing?
User avatar
Chloe Yarnall
 
Posts: 3461
Joined: Sun Oct 08, 2006 3:26 am

Post » Tue Jun 19, 2012 9:18 am

Slap a scripted ability on the player that listens for spell casting

http://www.creationkit.com/OnSpellCast_-_ObjectReference

For said script you'd want something like:

Event OnSpellCast(Form akSpell)  if akSpell == YourSummonSpell1   YourSummonSpell2.Cast(GetTargetActor())   YourSummonSpell2.Cast(GetTargetActor())  endifEndEvent
In this script YourSummonSpell1 is the spell in the players inventory, YourSummonSpell2 is a copy of that spell (to prevent an infinite OnSpellCast event?)

As far as beginner scripting stuff goes, take a look at the CK wiki if you haven't already and if anything below this sentence doesn't make sense to you feel free to say so.
You would attach that script to a Magic Effect (being sure to set up your properties for YourSummonSpell1/2 properly)
Then attach that Magic Effect to an Ability.
You could then write another script on a quest to give that ability to the player, or just do it through a perk (probably what you were going for anyway?)
User avatar
Taylor Bakos
 
Posts: 3408
Joined: Mon Jan 15, 2007 12:05 am

Post » Tue Jun 19, 2012 12:51 pm

The problem is that if you have the magic effect set to be a Summon Creature type, you can only have one of that magic effect type active at any time. You need to completely script the effect and change the type to Script or Spawn Scripted Ref. Alternatively, you can edit the character value that determines that max number of summoned creatures (Twin Souls perk modifies this same value).

I am currently working on a similar issue and ran into this problem last night.
User avatar
Emily Shackleton
 
Posts: 3535
Joined: Sun Feb 11, 2007 12:36 am

Post » Tue Jun 19, 2012 12:25 pm

The problem is that if you have the magic effect set to be a Summon Creature type, you can only have one of that magic effect type active at any time. You need to completely script the effect and change the type to Script or Spawn Scripted Ref. Alternatively, you can edit the character value that determines that max number of summoned creatures (Twin Souls perk modifies this same value).

I am currently working on a similar issue and ran into this problem last night.

snap didn't think about that. Could your summon have a summon? Could you set up a "chain" summon, so that the summoned creature script-casts a summon spell in an OnInit() event?

Edit: Question#2
What happens to active summoned creatures if you lower the max-summon-value? Lets say your summon spell adds a perk to the player temporarily that boosts the summon limit. Would those summons be banished if the limit was reset?

Edit#2:
I'm planning on messing with some conjuration stuff after I finish my destruction spells so these are all valuable questions. I would test some myself but I am le tired now, might try later.
User avatar
brandon frier
 
Posts: 3422
Joined: Wed Oct 17, 2007 8:47 pm

Post » Tue Jun 19, 2012 10:16 pm

Stumbled upon this and thought i'd share how i did mine.

I made a typical summon spell that summoned a "placeholder," which has a speed of one, is invisible, is muffled, nonaggressive, scale set to minimum, etc.

On this placeholder npc, i place a script which goes:
Spoiler

Scriptname Billychickenspawner25 extends ObjectReference

ACTORBASE PROPERTY billyschicken2 AUTO
globalvariable property BillyC25 auto
Float BillyC
int doOnce=1
import globalvariable

EVENT onLoad()
BillyC25.Getvalue()

IF(doOnce == 1 && SELF.is3DLoaded())
Utility.Wait(0.4)
BillyC25.Mod(1)
SELF.placeAtMe(billyschicken2)
SELF.placeAtMe(billyschicken2)
doOnce = 0
ENDIF

ENDEVENT

EVENT onUnLoad()
BillyC25.Getvalue()

IF(doOnce != -1)
BillyC25.Mod(-1)
doOnce = -1
IF (BillyC25.Getvalue() < 0)
BillyC25.Setvalue(0)
ENDIF
ENDIF

ENDEVENT

EVENT onDying(actor myKiller)
BillyC25.Getvalue()
IF (doOnce == 0)
BillyC25.Mod(-1)
doOnce = -1
IF (BillyC25.Getvalue() < 0)
BillyC25.Setvalue(0)
ENDIF
ENDIF
ENDEVENT

I have also created an intricate system that can detect if and when a summon is completed prematurely. For example, summoning a second creature without the twin souls perk. The first will die and the second will be called out. This is done through the setup of a global variable and the following script on all of the "summoned" (the ones that you can actually see) creatures (this also controls how long they will be out and them disappearing when killed):

Spoiler

Scriptname Billytimescript extends ACTOR

Int PROPERTY Time Auto
Float OV ;Original variable
Float UV ;Updated variable
Float CV ;Control variable
Float TV ;Tracking variable

BOOL doOnce=TRUE
bool bkeepUpdating = true

BOOL doOnce2=true

Globalvariable PROPERTY BillyC Auto

Import Globalvariable


EVENT onLoad()

BillyC.Getvalue()
OV = BillyC.Getvalue()
CV = OV

If (Doonce2 == true && OV == 1)
Utility.wait(0.1)
BillyC.Setvalue(1)
Doonce2 = False
ENDIF

RegisterForSingleUpdate(0.1) ; Give us an update

utility.wait(Time)

IF(doOnce && SELF.is3DLoaded())
bkeepUpdating = false
doOnce = FALSE
utility.wait(0.1)
disable()
utility.wait(2)
delete()
ENDIF

ENDEVENT

Event OnUpdate()

BillyC.Getvalue()
UV = BillyC.Getvalue()

IF (UV != CV)
If (UV > CV)
CV += (UV - CV)
Else
TV -= (UV - CV)
;Utility.Wait(0.1)
CV += (UV - CV)
ENDIF
ENDIF

IF (TV >= OV || UV <= (OV - OV))
bkeepUpdating = false
IF(doOnce && SELF.is3DLoaded())
doOnce = FALSE
utility.wait(0.1)
disable()
utility.wait(2)
delete()
ENDIF
Endif

if bkeepUpdating
RegisterForSingleUpdate(0.3)
endIf

ENDEVENT


EVENT onDying(actor myKiller)
bkeepUpdating = false
doOnce = FALSE
utility.wait(0.1)
disable()
utility.wait(2)
delete()
ENDEVENT


User avatar
Krystina Proietti
 
Posts: 3388
Joined: Sat Dec 23, 2006 9:02 pm


Return to V - Skyrim