Jump to content

Need Script to summon/ teleport follower


roldoi1911

Recommended Posts

Heyo, So I wanted to make a samurai follower with a spell so I can call on him at anytime. I can make the follower just fine, but for the life of me I don't have a clue how to make the script. either it does nothing or summons him as a summon (Pc name's Yadda) and I can't find any tutorials that give me a clear answer.

 

Example of what I want to do: Save the Babes WIP by tiger8u2

 

Thanks in advance for reading

Link to comment
Share on other sites

There are two approaches. The traditional version is simply to use a scripted effect that moves the follower to a spot directly in front of the player. It's the easiest way, but the character will always appear the same distance away and it doesn't work like other Skyrim summoning spells. The second way is used by SmartBlueCat for the Summon Inigo spell. It has the Skyrim summoning spell mechanic of making Inigo appear at the spot on the ground where the player is pointing while casting the spell.

 

For both versions you need a spell, a scripted magic effect, and a script.

 

For the traditional (and easiest) version:

  • The spell (or lesser power) is set up as a self-targeted, fire and forget type with no area, magnitude, or duration.
  • The magic effect uses the scripted effect base type and is also self-targeted, fire and forget.
  • The script could be as simple as this:

    ScriptName CDC_ActorSummonScript extends ActiveMagicEffect
    
    Actor Property PlayerREF Auto
    {auto-fill with the player reference}
    
    Actor Property ActorToSummon Auto
    {fill this property with the follower or other character you want to summon}
    
    Function OnEffectStart(Actor akTarget, Actor akCaster)
    	float az = PlayerRef.GetAngleZ()
    	ActorToSummon.SetAngle(0.0, 0.0, az + 180.0) ; so actor is facing player
    	ActorToSummon.MoveTo(PlayerREF, 200.0 * Math.sin(az), 200.0 * Math.cos(az), 0.0, false)
    EndFunction
    

  • If there are ever times you wouldn't want the actor to be summonable, you need to add conditions to the magic effect or spell or script.
  • The 200.0 values in the script are how far in front of the player the actor will appear.

 

For the Skyrim summoning effect version you'll also need an explosion and marker object:

  • The spell is set up as fire and forget, but aimed/targeted with a range of your choice (Inigo uses 90).
  • The magic effect needs the "Snap to Navmesh" flag, an area of 1, an Achtype of "Spawn Scripted Ref", and a custom explosion object.
  • The explosion object can use the empty art model but will need to place a custom marker object (activator).
  • The marker object is just a duplicate of the standard Xmarker with a script attached.
  • The script on the marker could be as simple as:

    ScriptName CDC_ActorSummonMarkerScript extends ObjectReference
    
    Actor Property ActorToSummon Auto
    {fill this property with the follower or other character you want to summon}
    
    Function OnLoad()
    	ActorToSummon.MoveTo(self)
    	Disable()	; the marker has served its purpose.
    	Delete()
    EndFunction
    

  • If there are ever times you wouldn't want the actor to be summonable, you need to add conditions to the magic effect or spell or script.
  • The complexity of positioning the actor is moved out of the script and handled by the explosion and marker.
  • If you really want to do this one, I recommend looking at how the spell, effect, explosion, and marker are setup in the Inigo.esp file.
Link to comment
Share on other sites

  • 1 year later...
  • 9 months later...

Heyo, So I wanted to make a samurai follower with a spell so I can call on him at anytime. I can make the follower just fine, but for the life of me I don't have a clue how to make the script. either it does nothing or summons him as a summon (Pc name's Yadda) and I can't find any tutorials that give me a clear answer.

 

Example of what I want to do: Save the Babes WIP by tiger8u2

 

Thanks in advance for reading

Thanks so much, was going to give up until I found this!

Link to comment
Share on other sites

  • 7 months later...

Cool, this still works in 2018. Found you with a Google search.


 

For future newbies reading, this helped me decode the following:

"Actor Property PlayerREF Auto
{auto-fill with the player reference}

Actor Property ActorToSummon Auto
{fill this property with the follower or other character you want to summon}"

After you attach the script to magiceffect, double click the script in magiceffect window to bring Properties window. You can fill and auto-fill properties/references there.

 

If you've never added a script in CK before (like me), then use this video for a basic tutorial:

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...

 

There are two approaches. The traditional version is simply to use a scripted effect that moves the follower to a spot directly in front of the player. It's the easiest way, but the character will always appear the same distance away and it doesn't work like other Skyrim summoning spells. The second way is used by SmartBlueCat for the Summon Inigo spell. It has the Skyrim summoning spell mechanic of making Inigo appear at the spot on the ground where the player is pointing while casting the spell.

 

For both versions you need a spell, a scripted magic effect, and a script.

 

For the traditional (and easiest) version:

  • The spell (or lesser power) is set up as a self-targeted, fire and forget type with no area, magnitude, or duration.
  • The magic effect uses the scripted effect base type and is also self-targeted, fire and forget.
  • The script could be as simple as this:

    ScriptName CDC_ActorSummonScript extends ActiveMagicEffect
    
    Actor Property PlayerREF Auto
    {auto-fill with the player reference}
    
    Actor Property ActorToSummon Auto
    {fill this property with the follower or other character you want to summon}
    
    Function OnEffectStart(Actor akTarget, Actor akCaster)
    	float az = PlayerRef.GetAngleZ()
    	ActorToSummon.SetAngle(0.0, 0.0, az + 180.0) ; so actor is facing player
    	ActorToSummon.MoveTo(PlayerREF, 200.0 * Math.sin(az), 200.0 * Math.cos(az), 0.0, false)
    EndFunction
    

  • If there are ever times you wouldn't want the actor to be summonable, you need to add conditions to the magic effect or spell or script.
  • The 200.0 values in the script are how far in front of the player the actor will appear.

 

For the Skyrim summoning effect version you'll also need an explosion and marker object:

  • The spell is set up as fire and forget, but aimed/targeted with a range of your choice (Inigo uses 90).
  • The magic effect needs the "Snap to Navmesh" flag, an area of 1, an Achtype of "Spawn Scripted Ref", and a custom explosion object.
  • The explosion object can use the empty art model but will need to place a custom marker object (activator).
  • The marker object is just a duplicate of the standard Xmarker with a script attached.
  • The script on the marker could be as simple as:

    ScriptName CDC_ActorSummonMarkerScript extends ObjectReference
    
    Actor Property ActorToSummon Auto
    {fill this property with the follower or other character you want to summon}
    
    Function OnLoad()
    	ActorToSummon.MoveTo(self)
    	Disable()	; the marker has served its purpose.
    	Delete()
    EndFunction
    

  • If there are ever times you wouldn't want the actor to be summonable, you need to add conditions to the magic effect or spell or script.
  • The complexity of positioning the actor is moved out of the script and handled by the explosion and marker.
  • If you really want to do this one, I recommend looking at how the spell, effect, explosion, and marker are setup in the Inigo.esp file.

 

 

 

Thank's!! It worked

Link to comment
Share on other sites

  • Recently Browsing   0 members

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