Jump to content
  • entries
    55
  • comments
    179
  • views
    16469

When adding new scripts causes CK...


Storms of Superior

847 views

TO CRASH! Shit. Are the CK Wiki scripts actually working scripts? This is what I'm trying to use.

ScriptName RepeatableSummonEffectScript extends ActiveMagicEffectActor Property YourSummonREF Auto ; An ObjectReference will also work with the summon functionEvent OnEffectStart(Actor akTarget, Actor akCaster)        Summon(akCaster, YourSummonREF)EndEvent; GetFormFromFile below to enable 'Global' flagFunction 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 ; Shroud summon with portal                        arPortal = akSummon.PlaceAtMe(Game.GetFormFromFile(0x0007CD55, "Skyrim.ESM")) ; SummonTargetFXActivator disables and deletes itself shortly after stage 5                ElseIf aiStage == 2 ; Disable Summon                        akSummon.Disable()                ElseIf aiStage == 3 ; Move portal in front of summoner                        arPortal.MoveTo(akSummoner, Math.Sin(akSummoner.GetAngleZ()) * afDistance, Math.Cos(akSummoner.GetAngleZ()) * afDistance, afZOffset)                ElseIf aiStage == 4 ; Move summon to portal                        akSummon.MoveTo(arPortal)                ElseIf aiStage == 5 ; Enable summon as the portal dissipates                        akSummon.Enable()                EndIf                Utility.Wait(0.6)        EndWhileEndFunction

6 Comments


Recommended Comments

Guest Retired

Posted

This code snippet is just an example.

It is not supposed to do anything real.

 

It is a MagicEffect, so it is run when you (or a NPC) cast a spell.

 

The actual function Summon is a mere example and it misses some parts to be effective.

If you read the code, you can get an idea of what you can do.

 

But then you have to do it right. (...get out of here, and bring me some money too... c.f. Jessica Rabbit.)

Storms of Superior

Posted

YourSummonREF & ObjectReference. Do I decide what those are, as in naming them myself?

Guest Retired

Posted

Actor Property YourSummonREF Auto

 

is a property, its name does not really matter.

But you have to fill it with a valid actor.

 

ObjectReference akSummoner ???

 

This one is just a parameter, and it is filled with the actor that casts the spell.

Storms of Superior

Posted

So I can actually make the door an actor and use the graphic model of the door I want?

×
×
  • Create New...