Jump to content

Making a Companion Go to your Player Home


Artecus

Recommended Posts

I wouldn't use MoveToCell. Just use MoveTo player. MoveTo will move the NPC from wherever they are, even if they are in a different cell or a different worldspace. The one bad thing about it is that it literally moves them to where the player is, so the player and the NPC momentarily occupy the same space. Then the player and the NPC each step aside so that they aren't mushed on top of each other. It's a bit wonky. Using the slightly more complicated method that we outlined in the thread about moving an NPC in front of the player will prevent the NPC from teleporting into the player (though they might teleport into a nearby NPC).

 

There is more than one way to make a teleporter, but an easy way is to make it a clothing item, and put the script in an OnEquip block. I usually make it automatically unequip the item in the script.

 

Also, if you use a marker for the NPC's home package (like Nodevski did in his example), then changing the "home" for an NPC is as simple as moving the marker to wherever the player is currently located (MyNPCHomeMarker.moveto player).

 

I usually do an evp instead of a ResetAI. I've never had a problem with it.

Link to comment
Share on other sites

Aha! Thanks for clarifying the "MoveTo" function. I somehow missed the note about it working between cells in the previous discussion.

 

Also glad to hear I had the basics of the teleporter correct. But the nuances are always important as well.

 

-Dubious-

Link to comment
Share on other sites

@Nodevski: Nice tutorial. With your permission, I'd like to base a 'Tip' (with credit) on it for the wiki "Getting started creating mods using GECK" article.

 

I haven't seen any description on how to create a "companion teleporter" (though there are several mods that implement one), but would guess it's just a item with a "MoveToCell" of the Player (possibly followed by a "MoveTo" the Player's location), followed by an EVP in an "object script"?

 

-Dubious-

 

Hi, your'e welcome to use this on your site. I added a section on how to create teleporters.

Link to comment
Share on other sites

Thanks for the permission. (Just to be clear: that article is on the Nexus Wiki site, so it's governed by their rules.)

 

When you want to "automatically" close a menu, it is recommended that you fake a keypress using the "MenuTapKey 15" (<Tab>) function.

 

As for unequipping the "teleporter", that somewhat depends upon how you intend to trigger it. See the "OnActivate", "Activate", "OnEquip", and "UnEquipAlt" functions' respective notes sections.

 

But madmongo has the experience, so wait to hear what he has to say.

 

-Dubious-

Link to comment
Share on other sites

  • Recently Browsing   0 members

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