Jump to content

Help spawning actors on trigger


BonePsycopath

Recommended Posts

I'm trying to make a mod where when the player shouts as a werewolf, X number of NPCs are spawned. I'm new to the creation kit so please explain simply.

 

 

You could go to the specific shout magic effect, add a script to it, and in the script put

 

ObjectReference NPC1

ObjectReference NPC2

ObjectReference NPC3

 

Event OnEffectStart(Target, Caster)

NPC1 = Caster.PlaceAtMe.(NPCtoSpawn)

NPC2 = Caster.PlaceAtMe.(NPCtoSpawn)

NPC3 = Caster.PlaceAtMe.(NPCtoSpawn)

EndEvent

 

 

That will spawn 3. To spawn more, simple add more variables, one for each that you want to spawn.

 

They will remain in your game forever though, so you need a way to get rid of them. Use Disable() to make them dissapear, and Delete() right after to remove them. Disable() still leaves data in the game that will clog up you save files if you don't take care of it.

 

 

For more examples of good ways to implement this to spawn NPCs, click the gameplay dropdown menu at the top, then click Papyrus Script Manager. In the box that opens, type "skeletonlegion." The script that appears is a very simple one, but it should get you started.

Link to comment
Share on other sites

I've never messed with shouts, but don't forget to add

 

Actor Property NPCtoSpawn

 

to the top of the code above and it should do pretty fine.

 

If the OnEffectfinish or end or whatever the function is, is called after the duration you specify for the effect in the editor, it should work ok to then put:

 


Event OnEffectFinish(Actor akTarget, Actor akCaster)

NPC1.Delete()
NPC2.Delete()
NPC3.Delete()

endEvent

 

 

This would act more like a summons, and i'm not certain it would work, but it's an idea. I haven't tried to make any new spells but it's cool that quite a few people around here are :D

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...