Basic teleport spell to cocmarker

Post » Tue Jun 19, 2012 2:41 am

As someone who has little knowledge of scripting, I've been somewhat bemused by my search on here for a solution to my query.

Basically, I would like to be able to set up a book that teaches the user a spell that teleports them to a specific coc marker. It would be great if the spell could use an existing spell effect but I'm really just looking for a way to accomplish the basic teleport.

Anyone help me out here?
User avatar
Alan Whiston
 
Posts: 3358
Joined: Sun May 06, 2007 4:07 pm

Post » Mon Jun 18, 2012 5:36 pm

I can help later :D. In the mesh time search for QOWYs Mark and Recall and see how he did it :D. The same theory will apply to you, but you cab ignore the Mark spell and just look at the Recall spell, and place a marker in the game world where you want the player to teleport to.
User avatar
Kat Ives
 
Posts: 3408
Joined: Tue Aug 28, 2007 2:11 pm

Post » Mon Jun 18, 2012 9:29 pm

I did this recently with a movable xmarker. I created a custom magic effect with archetype "Script" and added an ActiveMagicEffect script to it. The script simply does a akTarget.moveTo(marker) in the OnEffectFinish event. You will need to define a property for the marker pointing to your specific destination. And of course if you want fancy visual effects that will need to be done separately.
User avatar
Invasion's
 
Posts: 3546
Joined: Fri Aug 18, 2006 6:09 pm

Post » Mon Jun 18, 2012 9:15 pm

Thanks for the replies. I have looked at QOWY but am unable to open the recall script as the CK won't open the properties dialog. If I can't work out a more simple solution, I will ask the author.

Sirtaj.. your solution sounded ideal but I can get so far as creating a new magic effect with archtype script and I finally found ActiveMagicEffect by checking the Hidden tickbox but I'm afraid my lack of scripting knowledge threw me after that. The ActiveMagicEffect script has no properties and I couldn't find any reference to the rest of your advice. Can you expand on the part after 'The script simply does...'?
User avatar
james kite
 
Posts: 3460
Joined: Sun Jul 22, 2007 8:52 am

Post » Tue Jun 19, 2012 8:13 am

Well this is more generic scripting advice than anything specific to the effect:
  • On the Papyrus Scripts list in the effect page, click add, new script and specify a script name (it should already be set to inherit activescripteffect).
  • Your source might look something like this (not verified but should be the general idea):
Scriptname MyTeleportEffect extends activemagiceffectObjectReference Property destinationMarker AutoEvent OnEffectFinish(Actor akTarget, Actor akCaster)    akTarget.moveTo(destinationMarker)EndEvent

Now you should save your script and set the value of your destinationMarker property to your coc marker.
User avatar
Everardo Montano
 
Posts: 3373
Joined: Mon Dec 03, 2007 4:23 am

Post » Mon Jun 18, 2012 10:01 pm

I used this:

Scriptname BouldersTeleport extends activemagiceffect
ObjectReference Property destinationMarker Auto
Event OnEffectFinish(Actor akTarget, Actor akCaster)
akTarget.moveTo(destinationMarker)
EndEvent

However, the script failed to compile so I'm obviously not doing something I ought to :)
User avatar
Bethany Watkin
 
Posts: 3445
Joined: Sun Jul 23, 2006 4:13 pm

Post » Tue Jun 19, 2012 5:44 am

I wrote that all out and it compiled just fine.

What does the error say?
User avatar
flora
 
Posts: 3479
Joined: Fri Jun 23, 2006 1:48 am

Post » Tue Jun 19, 2012 3:44 am

What was the compile failure message?
User avatar
JUan Martinez
 
Posts: 3552
Joined: Tue Oct 16, 2007 7:12 am

Post » Mon Jun 18, 2012 6:31 pm

I get this:

Starting 1 compile threads for 1 files...
Compiling "BouldersTeleport"...
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(337,25): script property NewProperty already defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(337,25): script variable ::NewProperty_var already defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(337,25): script property NewProperty already has a get function defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(337,25): script property NewProperty already has a set function defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(339,18): script property NewProperty already defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(339,18): script variable ::NewProperty_var already defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(339,18): script property NewProperty already has a get function defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(339,18): script property NewProperty already has a set function defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(341,23): script property NewProperty already defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(341,23): script variable ::NewProperty_var already defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(341,23): script property NewProperty already has a get function defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(341,23): script property NewProperty already has a set function defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(343,14): script property NewProperty already defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(343,14): script variable ::NewProperty_var already defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(343,14): script property NewProperty already has a get function defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ActiveMagicEffect.psc(343,14): script property NewProperty already has a set function defined
No output generated for BouldersTeleport, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on BouldersTeleport
User avatar
Terry
 
Posts: 3368
Joined: Mon Jul 09, 2007 1:21 am

Post » Tue Jun 19, 2012 12:21 am

I looked at the activeMagicEffect script at the lines and there was a property I must have inadvertently added. I removed them and when I try to recompile, I no longer get a compiling error but I do get an usnspecifiied error. This is the current content of the BouldersTeleport script psc

Scriptname BouldersTeleport extends activemagiceffect
{Scriptname BouldersTeleport extends activemagiceffect
ObjectReference Property destinationMarker Auto
Event OnEffectFinish(Actor akTarget, Actor akCaster)
akTarget.moveTo(destinationMarker)
EndEvent

}
User avatar
Alisha Clarke
 
Posts: 3461
Joined: Tue Jan 16, 2007 2:53 am

Post » Tue Jun 19, 2012 9:25 am

It looks to me like you've typed the entire script into the description field (the curly braces).
User avatar
Jaylene Brower
 
Posts: 3347
Joined: Tue Aug 15, 2006 12:24 pm

Post » Tue Jun 19, 2012 9:19 am

Just a suggestion... we can probably help you get this particular script working with a few more back-and-forths, but I strongly recommend going through the Papyrus tutorials on the CK wiki. It is important that you understand how/why this is all working, otherwise you're bound to get some sort of unfixable problem in your mod down the track.
User avatar
Lucky Boy
 
Posts: 3378
Joined: Wed Jun 06, 2007 6:26 pm

Post » Mon Jun 18, 2012 7:57 pm

I typed it into the documentation string box
User avatar
Leah
 
Posts: 3358
Joined: Wed Nov 01, 2006 3:11 pm

Post » Tue Jun 19, 2012 8:31 am

Just a suggestion... we can probably help you get this particular script working with a few more back-and-forths, but I strongly recommend going through the Papyrus tutorials on the CK wiki. It is important that you understand how/why this is all working, otherwise you're bound to get some sort of unfixable problem in your mod down the track.

I will have another go at it
User avatar
Rudi Carter
 
Posts: 3365
Joined: Fri Sep 01, 2006 11:09 pm

Post » Tue Jun 19, 2012 7:26 am

I typed it into the documentation string box
nah, don't write out your scripts there. What goes there is a description of what the script does.
When you save it, it will be added to the magic effect. You then, right click on it, and chose edit source. A new window will open. Well the compiler is the bottom white field. You know the rest.

Since this uses properties, you need to define where the destination will be. So, click the button properties and a box will appear. (or you can right click and choose Edit Properties). Select the property in that window, in this case destinationMarker, and then click on the button Edit Value. Another box appears with a drop down. Cell, and the Cell reference. The reference is the destination that your script will send you to. The Cell is where this destination is held.

Im just covering everything just incase you missed something.

Edit: That script is correct. Just remove the {}
User avatar
oliver klosoff
 
Posts: 3436
Joined: Sun Nov 25, 2007 1:02 am

Post » Mon Jun 18, 2012 5:05 pm

Try this

Scriptname YourScriptNameHere extends activemagiceffectObjectReference property teleDest autoEvent OnEffectFinish(Actor target, Actor caster)target.MoveTo(teleDest)EndEvent  

It's what I used for a scroll that teleports you to Xmarker.
User avatar
NO suckers In Here
 
Posts: 3449
Joined: Thu Jul 13, 2006 2:05 am

Post » Mon Jun 18, 2012 6:08 pm

Brilliant... I can now enter the cocmarker in properties. The script that I can now edit looks like this:

Scriptname BouldersTeleport extends activemagiceffect
ObjectReference Property destinationMarker Auto
Event OnEffectFinish(Actor akTarget, Actor akCaster)
akTarget.moveTo(destinationMarker)
EndEvent

as it should be (I think). Sartaj is right though, I need to study the scripting wiki more. Thanks for everyone's patience. I will see how the rest of it goes.
User avatar
Catharine Krupinski
 
Posts: 3377
Joined: Sun Aug 12, 2007 3:39 pm

Post » Mon Jun 18, 2012 5:13 pm

Just to conclude on this... the script worked first time and the player can now learn a spell that directly transports them to the COC. Thanks for everyone's patience and time.... now I jsut have to work on one for the followers :blush:
User avatar
Pumpkin
 
Posts: 3440
Joined: Sun Jun 25, 2006 10:23 am

Post » Tue Jun 19, 2012 5:25 am

If you're trying to get followers to cast the spell in general or on command, the same effect and script should work fine for you without changes. If you're just trying to get followers and thralls to follow the player on teleport, I found in my teleport spell that they did that by default. I'm not sure if a navigable (without teleport) route to the destination is required for this to work though.
User avatar
BEl J
 
Posts: 3397
Joined: Tue Feb 13, 2007 8:12 am

Post » Mon Jun 18, 2012 8:09 pm

I used Lydia to test and she didn't follow with the teleport. She did follow with fast travel to Shadowgreen Cavern but wouldn't fast travel to the map marker in my tower. I need to try a few more things to find out why she doesn't come into the tower. I think it's more likely to be a navmesh issue rather than the teleport although I thought the navmesh was ok. I will try the navigable route approach first (without teleport).
User avatar
Kayla Bee
 
Posts: 3349
Joined: Fri Aug 24, 2007 5:34 pm

Post » Mon Jun 18, 2012 11:20 pm

It seems like it was initially a navmesh issue. I scrapped the old one and redid by hand and I can now use the teleport pads in the houses to get companions into the house. However, the teleport spell doesn't bring followers in. Although it's not a major issue, I'd be interested if anyone has any suggestions.
User avatar
Princess Johnson
 
Posts: 3435
Joined: Wed Feb 07, 2007 5:44 pm

Post » Mon Jun 18, 2012 11:20 pm

Err maybe even the navmesh bug will stop them from teleporting with you if its a cell with an altered mesh.
User avatar
K J S
 
Posts: 3326
Joined: Thu Apr 05, 2007 11:50 am

Post » Tue Jun 19, 2012 4:47 am

Err maybe even the navmesh bug will stop them from teleporting with you if its a cell with an altered mesh.

Wouldn't that also cause issues if coming into the house through a load door?
User avatar
Steve Smith
 
Posts: 3540
Joined: Sat Jun 30, 2007 10:47 am

Post » Tue Jun 19, 2012 8:39 am

I think you need to finalize the navmesh in the interior and exterior for NPCs to be able to navigate into an interior. You have to get the little green highlights on the triangles under the doors.
User avatar
Destinyscharm
 
Posts: 3404
Joined: Sun Jul 23, 2006 6:06 pm

Post » Tue Jun 19, 2012 7:22 am

akTarget.moveTo(destinationMarker)
What kind of object should be destinationMarker ?
Can it be some other than Heading or COCMarker (XMarker, plain object like a barrel, for example) ?
User avatar
Peter lopez
 
Posts: 3383
Joined: Mon Sep 10, 2007 5:55 pm

Next

Return to V - Skyrim