Jump to content

Help with a Summon Script


iplo472

Recommended Posts

I'm trying to figure out how to write a basic script for summoning an item in the world with a spell and I'm a little lost. I found this example script on the wiki and it says to fill in properties with reference IDs, but I'm not sure what defines a property. So for example, if I wanted to summon a loaf of bread, what would I have to replace? And would I need to have a specific loaf of bread sitting somewhere in the world to use as a reference? I'm not sure I completely understand that concept. Thanks for the help!

 

Here's the template script:

 

 

ScriptName RepeatableSummonEffectScript extends ActiveMagicEffect

Actor Property YourSummonREF Auto ;

Event OnEffectStart(Actor akTarget, Actor akCaster)
Summon(akCaster, YourSummonREF)
EndEvent

Function Summon(ObjectReference akSummoner = None, ObjectReference akSummon = None, Float afDistance = 150.0, Float afZOffset = 0.0, ObjectReference arPortal = None, Int aiStage = 0) Global
While aiStage < 6
aiStage += 1
If aiStage == 1 ;
arPortal = akSummon.PlaceAtMe(Game.GetFormFromFile(0x0007CD55, "Skyrim.ESM")) ;
ElseIf aiStage == 2 ;
akSummon.Disable()
ElseIf aiStage == 3 ;
arPortal.MoveTo(akSummoner, Math.Sin(akSummoner.GetAngleZ()) * afDistance, Math.Cos(akSummoner.GetAngleZ()) * afDistance, afZOffset)
ElseIf aiStage == 4 ;
akSummon.MoveTo(arPortal)
ElseIf aiStage == 5 ;
akSummon.Enable()
EndIf
Utility.Wait(0.6)
EndWhile
EndFunction

 

Link to comment
Share on other sites

you'd have to make a dummy cell for your loaf of bread to be stored when not in use and then it would be linked by ref to your script. i think you could even eat it as the bread item would then disable giving you the effect. I'm assuming.

 

I'll take a look at this sometime within a week as I had an idea to make a spell rain down gold ingots on a target location, which I could then use to kill an enemy or make my own personal fort knox out of gold bricks, but as I've mentioned on a couple threads I'm in the process of moving so my time I can work is sporadic at best.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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