k3v Man Posted January 16, 2007 Share Posted January 16, 2007 I was wondering if anyone knew a script or a command that allowed me to track an object. for example you drop and item at a certain place and you can know warp to that item from anywhere. even if it is in an inside a house. the reaseon why i want to know this was i wanted to make a mod where you "use a spell" and you make some kind of portal appear. then you go through the portal. but when you come on back through the portal the portal dissapears and you appear right where that object is. I was also wondering if anyone knew how to cast a spell and make an object appear in front of the player at a certain position (x,y,z etc.) EDIT: Merged your posts. Please don't double post - use the edit button. Thanks. - Switch Link to comment Share on other sites More sharing options...
Abramul Posted January 17, 2007 Share Posted January 17, 2007 I doubt that it is possible to create a true 2-way door from an arbitrary cell. However, I would point out this mod, which has a scripted spell that teleports the player to a specific cell, and when the spell expires, teleports the player back. Link to comment Share on other sites More sharing options...
k3v Man Posted January 17, 2007 Author Share Posted January 17, 2007 I doubt that it is possible to create a true 2-way door from an arbitrary cell. However, I would point out this mod, which has a scripted spell that teleports the player to a specific cell, and when the spell expires, teleports the player back. I think I just got a spark of knoledge cuz i was looking on the helpless CS site but i think i found a solution.I found this command that does this: (Door Markers Name).Moveto Player && HasMagicEffect (EffectID) That means that when a certain spell effect is activated on a certain player i can make a door marker move to the position of the player. I have not tested at all though but i am pretty sure that with certain scripting it might be possible to make that work. Link to comment Share on other sites More sharing options...
Abramul Posted January 17, 2007 Share Posted January 17, 2007 I'm not at all sure, but it may be that you should use an XMarker rather than a Door Marker. It should be fairly simple to set up the spell such that when it's cast, an activator with a teleport-on-activate script will appear in front of the player. Should also be possible to have it disappear when the player uses the fixed gateway. Link to comment Share on other sites More sharing options...
k3v Man Posted January 17, 2007 Author Share Posted January 17, 2007 I'm not at all sure, but it may be that you should use an XMarker rather than a Door Marker. It should be fairly simple to set up the spell such that when it's cast, an activator with a teleport-on-activate script will appear in front of the player. Should also be possible to have it disappear when the player uses the fixed gateway. lol. Ya know i can have the fun of scripting it and hoping it will work :happy: Link to comment Share on other sites More sharing options...
Vagrant0 Posted January 17, 2007 Share Posted January 17, 2007 You might be able to do it like you want if you use two markers, the marker.moveto player and then player.movetomarker. One spell controls each marker, Spell A moves Marker A to player, then player to Marker B. Spell B moves marker B to player, then player to marker A. Or you could do something like:If player.getfactionrank "" == 1 markerA.moveto player set Ax to player.getpos x set Ay to player.getpos y set Az to player.getpos z set player.factionrank "", 2 player.movetomarker markerB elseif player.getfactionrank "" == 2 markerB.moveto player set Bx to player.getpos x set By to player.getpos y set Bz to player.getpos z set player.factionrank "", 1 player.movetomarker markerB then just have one spell, using a null faction to control the logic of it. The short variables aren't needed, but could probably be used to add some redundancy or something should you run into problems. Link to comment Share on other sites More sharing options...
Abramul Posted January 17, 2007 Share Posted January 17, 2007 I was looking to add a spell to that mod I mentioned in order to be able to teleport to my Talos Plaza house (silly grave-robber). The relevant script is actually very simple:scn GenericTeleportScript ref MyRef begin ScriptEffectStart set MyRef to PlaceAtMe MyMarkerRef 1, 0, 0 player.MoveTo NamedReference end begin ScriptEffectFinish player.MoveTo MyRef MyRef.disable endThis script moves the player to a location when the spell is cast, and moves the player back when it expires. It should be noted that this keeps track of the "Move back to" location internally, and therefore may not be able to be split into 'Mark' and 'Recall' spells. However, it should be possible to put this script on, say, a ring, and substitute begin OnEquip and begin OnUnequip. It would also be possible to use a token, with another token added and removed by the corresponding spells (or, if you prefer, give the portals you were originally considering scripts that add and remove it. This would be indistinguishable from a door). The MasterToken script would be:scn GenericTeleportScript ref MyRef short InSanctuary begin GameMode if (InSanctuary == 0 && (player.getitemcount SlaveToken > 0) set MyRef to PlaceAtMe MyMarkerRef 1, 0, 0 player.MoveTo NamedReference set InSanctuary to 1 endif if(InSanctuary == 1 && (player.getitemcount SlaveToken == 0) player.MoveTo MyRef MyRef.disable set InSanctuary to 0 endif end Notes:MyMarkerRef is a static.NamedReference is an instance of an item to which you have given a unique identifier. To do this, double-click it in the render window (or right-click it in the Cell View Objects column and select Edit), and enter a name in the Reference Editor ID field. You'll probably want to use a door or a portal for this, for the sake of consistency. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.