2-way Portal Spell Discussion

Post » Sun Nov 18, 2012 12:51 am

Idea: A spell which will summon a visual portal that will transport the player to a stationary portal in an exterior cell, and then will allow the player to use the portal to get back to wherever they came from.

Why?: Personally I find myself filling up my inventory a lot as I save the world. I'm not a huge "don't break immersion" type of player so I occasionally fast travel back to my hoarding house when I get close to my storage limit. But I am just about finished with my Fallen Star mod which will add a castle in the sky. The Oblivion version of this mod had a summon-able portal spell...however it only went to the house, but the castle was conveniently positioned above a body of water so you could just jump off.You can see in http://i.imgur.com/r6b1G.jpg my character happily in the castle courtyard, but at the moment the only way to legitimately get back to solid ground is to jump like I could do in Oblivion. Sadly the plains to the west of Whiterun have very little water to fall into and you can see http://i.imgur.com/gpBp0.jpg. There is also the time when you might be adventuring in a particularly long dungeon or in a place like the Soul Cairn/Blackreach and you need to drop loot just to get out of the place.

Goal: To get a working spell that can realize the idea above. But also to have in the end a tutorial or collection of methods that could help others in the future who might want the same feature in there own house mod, or any other type of mod for that matter.

What I have:

For the visual art of the portal itself I am using the nif used for the FXDA14PortalDoor. For travel between the two points I thought I could use two AutoLoadDoors.

In my search of the forums I found that what I could do is have the movable end of the portal be stored in a "storage cell" and then move it to the player. I have no idea if the link between the two AutoLoadDoors would stay so I am open using something else besides that. The spell I have now is "fire and forget", with a "target location" delivery. For the magic effect I am assuming I will want "script" for effect archetype and Conjuration for the magic skill since that makes sense to me, casting and delivery type are the same as the spell in case you were wondering. On this magic effect I am also using an explosion to place a x-marker object that I made that I think I would need to be able to tell the portal where to go. For now I am using a banner as the placed object in the explosion since I wouldn't be able to see the marker but for some reason it is not showing up.

Next is the script and to warn you I am very much a noob on this topic, for the moment. I understand that moveto will be what I want to use in order to move these portal parts around. Beyond that I have not found out what I need to do.


If you have gotten this far thank you, I have been working on this for close to two weeks now and it is the last major hurtle for this mod. Any help/suggestions are greatly appreciated. As the discussion progresses I'll update this post so we can have some organization.

Thank you again! :mage:
User avatar
ZANEY82
 
Posts: 3314
Joined: Mon Dec 18, 2006 3:10 am

Post » Sun Nov 18, 2012 10:04 am

I made a mark/recall spell a while back and it crashed when I tried to teleport between worldspaces (I think... I scrapped it, but I distictly remember teleporting from Skyrim world to Whiterun world and getting a consistent crash). All that said, I forgot that you were going to use doors rather than just teleportation, that might fix the whole thing I was just babbling about. Point is, a solution to your falling problem might be to use the perk entry point "Modify Falling Damage" set to 0. Set up a trigger area around the castle that adds the no fall damage perk. When the player leaves this trigger area, wait 30s and then remove the perk, allowing the player to jump from the castle and rocket down to earth without taking damage. Kinda badass in my opinion. As for the portals, at the moment everything you said is making sense and I am not sure why your banner is not showing up. My first thought on how I would solve this problem would be to use the "snap to navmesh" flag on your portal magic effect. That would ensure that the portal almost always appears in a viable location (though I have had summons fail to appear due to navmesh issues). To figure out why your banner isn't appearing, attach a different explosion to the spell (an actual visible explosion) and make sure it goes off. If it does, post your code attached to the explosion and I may be able to find your problem. Another thought: make the portal only work once in each direction, as in: the player summons a portal and heads up to the castle, does their business and steps back through the portal which dispels the portal. A condition on the stationary side to make sure it doesn't work unless the portal is not in the storage cell would be good too. Just my 2 cents, feel free to disregard :D . Best of luck.
User avatar
Jennie Skeletons
 
Posts: 3452
Joined: Wed Jun 21, 2006 8:21 am

Post » Sun Nov 18, 2012 4:12 pm

I'll try a vanilla explosion to see what happens. Are there any explosions that place objects that I could take a look at? As for code, there is none at the moment; there is a Placed Object field with a drop-down list of objects in the explosion window.

A check to see if the summoned end of the portal is in the storage cell is definitely something I'll add once this thing is working.
User avatar
Jessica White
 
Posts: 3419
Joined: Sun Aug 20, 2006 5:03 am

Post » Sun Nov 18, 2012 1:11 pm

the problem with summonable doors is that you cannot move the teleport marker. it will work perfectly fine on the way up, but using the same teleport to go back into skyrim will not work (it will just send you to the original editor location of the door teleport marker)

unfortunately in this case you will have to use a player.moveto if you want to return back to your original location. moveto is fine, except it does not bring your followers with you, so you would need to do additional stuff to make sure they come along.

the way i did the amethyst beacon in my mod is pretty much exactly what you are describing.



instead of a portal i use a potion when you drink it, it basically runs a script that is a simple door.activate. in your case, your magic effect will use a moveto to move the door from the storage cell into the player's current position. if you want it to be a target hit, it may be a bit more complicated. you wont be able to summon the door using the magic effect's event, since it needs to collide with an actor for that effect to start. if you do a FF Self, it would be much easier, and instead of bringing the door to the location of the crosshair it will just slam it up against your face as it moves to your exact x,y,z coordinates (i guess you can use an offset if you want).

in any case, for simplicity's sake i would suggest using an FF Self instead of a target hit. on your effectstart block just call moveto on the door as well a xmarkerheader on the same spot, so they both land in the same spot next to the player. in the CK your door should actually be in tamriel. find the most BFE remote location in skyrim that still has a navmesh on it, and finalize your door on the navmesh with the teleport marker pointing to your sky castle's door (wherever you want the portal to dump you out on). once you have your door marker placed in tamriel and the navmesh is green, move the physical door mesh clipped into the landscape so it is not visible. you can also place your xmarker header right next to the door if you want (you dont even need a purgatory cell at all)

after calling moveto on your magiceffect script, you should call movetomyeditorlocation to send the door back to its original location (probably need to do this in the OnActivate event on a separate script on the door object). the main caveat with the door portal setup is that you may run into the Is3DLoaded glitch where the script will refuse to run the moveto command because of the lack of the door's 3D being loaded (which is a load of horse **** since the door is a permanently persistent object by default). if you do come across this glitch, you may need to use a purgatory cell afterall. go back to your tamriel door and change the teleporter to point to a purgatory cell (which will need a navmesh in it, and another load door that points to your castle). the reason for this extra layer of doors is so that followers will have a physical point A to B path directly traced to your castle. when you access the remote door, they will follow you out the other side. without the navmesh, followers have no idea how to follow you into your secret remote door.

in the CK in your castle, your load door that is linked to this whole mickey mouse rube goldberg mousetrap should also be hidden from view, since you do not want to access this door directly (but the teleport marker should be placed exactly on the navmesh where you want the player to appear). to get back into tamriel, you need to make an activator object that runs a script that calls moveto on the player to move them to the xmarkerheader that is still sitting in the location in tamriel you left off. in order to get your follower to come with you during the moveto, you will need to create a HUGE triggerbox that completely surrounds all accessible area near the portal activator. set the trigger to initially disabled, and call enable at the same time as the moveto. now you will need yet another script on the trigger box that calls akActionRef.moveto to follow the player. you may need to throw a bunch of conditions in there so only followers are caught in the trigger box when it appears. you dont want to net dolphins when reeling in tuna. akActionRef as Actor and IsPlayerTeammate should suffice.

caveat #2, you may get the Sithis tea party glitch, where after the moveto you are stuck in the Void unable to do anything but stare at eternal blackness. if this happens, you will have to do a double moveto by first sending the player and akActionref to the purgatory cell, then to the xmarkerheader immediately after.
User avatar
Tinkerbells
 
Posts: 3432
Joined: Sat Jun 24, 2006 10:22 pm

Post » Sun Nov 18, 2012 11:05 am

Why not have the portal activate disabled and give it a custom onActivate? You can place your own xmarkers for moveto and move between them.
User avatar
cassy
 
Posts: 3368
Joined: Mon Mar 05, 2007 12:57 am

Post » Sun Nov 18, 2012 10:35 am

Thanks for the replies you two.

I have changed the spell to cast on Self, no need for this to get any more complicated :biggrin:

That's quite a bit of information AD so I'll just start with a small question first. If I am reading this right than the FXDA14PortalDoor(the visual aspect of the portal) needs to be an activator so the player can interact with it and that will start the behind-the-scenes magic. The issue I am having now is that the model does not have collision so it does not work as an activator, unless I'm missing a simple check box or something.

So should I also make a trigger, most likely sphere shaped, which is what the player will actually interact with?
User avatar
LuBiE LoU
 
Posts: 3391
Joined: Sun Jun 18, 2006 4:43 pm

Post » Sun Nov 18, 2012 2:33 pm

So I have a FF Self spell with a magic effect that has the following script. I wanted to make a quick little script to see if I could get something to move to the location of the caster. Turns out I couldn't :biggrin:. PortalFX is pointing to a static object that I made, and is placed in a holding cell.

Scriptname rayPortalSummon extends activemagiceffect{Brings portal objects to caster.}ObjectReference property PortalFX autoEvent OnEffectStart(Actor akTarget, Actor akCaster)If (akTarget==Game.GetPlayer())  PortalFX.MoveTo(Game.GetPlayer())EndIfendEvent

EDIT: Pardon me for I am but a humble fool, changed the object to the actual portal effect and it works fine. It also moves the trigger and xmarker to the caster.
User avatar
gemma king
 
Posts: 3523
Joined: Fri Feb 09, 2007 12:11 pm


Return to V - Skyrim