Jump to content

Making a Companion Go to your Player Home


Artecus

Recommended Posts

Alright, so someone requested that I make it possible to "send your companions to the shack and they will walk around the house and go inside it" for this mod [spoilerhttps://rd.nexusmods.com/newvegas/mods/64034?tab=posts

The first thing I thought of was to tell him I'm going to start work on that feature.

 

One issue, I have no idea how to go about it.

 

Things I do know:

-How to set up a very basic script

-How to edit dialouge

-How to edit/create cells

-How to make doors, custom activators/new activators

-How to make a basic NPC

-How to make a note, key and terminal

-How to create a new item (consumable, weapon/armor)

 

Things I do not know:

-How to make a basic quest, unmarked or not

-How to make a more beginner script

-How to make navmeshes

-How to make LODs

-How to put water into landscape

-How to make more advanced functions/triggers

 

Anyone willing to help? I'm looking at other methods besides dialouge with companions, if it comes to that.

 

Link to comment
Share on other sites

Please see the wiki "Getting started creating mods using GECK" article. It provides links to tutorials on most of those subjects. Though scripting is basically "simple programming", so if you don't have any background in that you should take a formal beginners class. After that it's just a matter of adjusting to the peculiar nature (and frustrations) of the GECK.

 

-Dubious-

Link to comment
Share on other sites

Please see the wiki "Getting started creating mods using GECK" article. It provides links to tutorials on most of those subjects. Though scripting is basically "simple programming", so if you don't have any background in that you should take a formal beginners class. After that it's just a matter of adjusting to the peculiar nature (and frustrations) of the GECK.

 

-Dubious-

 

Ok, worth a shot. I'll get back to you

Link to comment
Share on other sites

As far as I know, for that kind of feature you'd have to either edit dialogue or add new dialogue lines for each companion with result scripts telling them to stay at this shack when dismissed, which can be quite tricky if you're messing with default NPCs. It may be possible to use some conditions in the dialogue to try and work your way around it, but I don't really think it would be a good project for a beginner I'm afraid :( Good luck nonetheless! :)

Link to comment
Share on other sites

So, I've looked into this and was really surprised. They seem to use AI packages, not scripts. I did a cursory look at Arcade, and it seems they just reset his AI in the result sctipt when you dismiss him, which basically just tells him to find a new AI package, though it's a bit more forceful than the EVP command. So, what that does is it makes him look for the first package that he can use. If you open up his NPC file in the G.E.C.K. and go to the AI packages, the Mormon Fort sandboxing one is the last one, meaning he'll only use that if none of the others will work. If you open up his Lucky 38 package and check the conditions, you'll see a few, which I didn't look at but I would imagine they just refer to the in-game requirements you're used to for being able to send companions there. I would just mimic what they did with the Lucky 38 packages but make some for your shack.

 

Disclaimer: I have not dismissed a companion to the Lucky 38 in this game since 2010 and don't really remember how it works, so I may have missed something. I'm just assuming that once you have discovered the location and been told you can use it, your companions automatically go there on dismissal. I wasn't looking for anything more than that and I didn't spend a huge amount of time on it. But if I'm wrong, I'd say it's still a good starting point for you.

Edited by EPDGaffney
Link to comment
Share on other sites

DubiousIntent, Jokerine, EDPGaffney; Thanks. Dubious, I got lost in that link you sent me, so I'm sorry, but it didn't really help me that much. If only I had a Bethesda IT guy right about now. Jokerine, I may drop the thought completely at the risk of conflicting with other greater mods. I'm willing to learn though, so being a beginner doesn't really intimidate me that much :smile:

EDPGaffney, even though you claim you haven't used the feature in 7 years, you may be on to something. I'm going to try something with already existing Lucky 38 stuff, although I doubt it will work that easy, since the GECK is a pain in the donkey.

Edited by Artecus
Link to comment
Share on other sites

Well, unless you're meant to get a choice when you dismiss a companion, you should be able to copy it pretty much exactly. If there's no message box with options for the Lucky 38, and it's all just the same dismissal dialogue choice regardless of where your companion will be going (which I'm really almost certain is the case), I'd say it's as simple as making a Sandbox AI package with the location set to your shack's interior and adding it to all companions at the top of their AI Package lists. This is simple. Use the conditions from the Lucky 38 packages and it should work fine, with the exception that the {NPCname}L38 conditions refer to the Lucky 38, so remove those from your Sandbox package.

 

The sole problem posed by this is that they will now always go there on dismissal, even if a player has not discovered the shack yet. If you want to change this, you need a very basic quest script. So, you will go to the Quest section in the G.E.C.K., right-click one, and choose new.

https://prnt.sc/hambhm

 

Then put in the ID and save it. Just don't choose a name that starts with a number. I forget the specifics but that can lead to stuff not working in your scripts. Press OK and save your mod, then open up your quest again, and then click the ... near the Script button. Note that everything else can be left at the default and you don't need a name for your quest, just an ID. The name is more important for a quest that a player will actually see, but this quest isn't really a quest, as much as a way of letting us declare and call on variables.

https://prnt.sc/hamcgm

 

Then, you click Script, and from that menu click New, and now you write your very basic script:

scn YourScript

short ShackDiscovered

That's the first script. You have to make sure that on the top where it says Script Type, you choose Quest from the dropdown menu. Save it now. Save everything a lot, actually. You are dealing with crashy software.

 

Now let's drop a Trigger into a spot that a player will absolutely have to walk through to open the door. The Trigger button is the cube with a T in it on the top toolbar. Don't worry about getting it perfect right away as you can adjust it any time you like (and remember you can press F to make sure it goes to the floor).

https://prnt.sc/hamh3l

 

On releasing the mouse button, it will bring up a menu. Where it gives you the ID, there's a tickbox that is unticked and says New. Click that and type in a new ID, like ShackTrigger or something. Click OK and save everything, then double-click your trigger (in the worldspace render window) to bring back the menu. Everything can stay default if I'm not mistaken, but now you need to write one more quick script. So click on the ellipsis again (the ...) and start a new script.

 

This script is:

scn ShackTriggerScript

Begin OnTriggerEnter
Set YourScript.ShackDiscovered to 1
End

Note that in the above script I used my example name of the previous script and the example of the variable we declared in it.

 

And finally, when you set the conditions on that AI package, where the Lucky 38 packages have VNPCFollowersQuest (as seen here)

https://prnt.sc/hamklx

you can now just grab your quest script and its variable, which will be listed in the dropdown menu.

------------------------------------------------------------------------------------------------

 

The other, kind of weird but easier way to do it would be to put down a note or something that the player picks up, and use that in your condition for the package.

 

I've never tested any of this, but it should work. Let me know if you have any problems.

Link to comment
Share on other sites

If making changes to the actors (adding packages) isn't something you're concerned about, there's also this:

 

https://www.nexusmods.com/fallout3/mods/22142/?

 

That you could use as a sort of road map. The benefit to using this method is that it won't override the L38 option. Just ignore (or don't) the bit that moves the marker and remember that ED-e is 3 different forms/refs.

Link to comment
Share on other sites

  • 1 year later...

How to make a follower travel to a place and start relaxing on arrival.

 

This is my Fired configuration for custom companions and it works perfectly:

 

First, add some variable declarations like "short MyNPCRelaxing", "short MyNPCHasBeenFired" and "short HasBeenHired" to the NPC's script.

 

Make a home marker (with the render window) for the NPC, like MyNPCREFHomeMarker.

 

Place a reference to your NPC in the world (in the render window) if not already there. Give it a name like MyNPCREF.

 

Make a SANDBOX AI package and set the destination as "near current location" and add a radius. The bigger the radius the harder it will be to find the NPC. Check the relevant checkboxes. Add a condition: MyNPCRelaxing 1.

 

Make a TRAVEL AI package (go home or fired) for the NPC and set the home marker as destination, radius 0. Add a condition: MyNPCHasBeenFired 1. Under Begin/End/Change put "Set MyNPCREF.MyNPCRelaxing 1" in the "On End" field. This wil make your NPC execute the sandbox relax package on arrival. Be sure that the sandbox package is above the travel package in the package list order.

 

If you want to be notified when the NPC arrived home you could create a message like MyNPCArrivedHome, and put something like "My dear follower arrived home." in there. Then, in the "On End" field of the TRAVEL package you should add "Showmessage MyNPCArrivedHome".

 

If you have an NPC with teleporter(s) (optional, see below) you can remove the teleporter(s), this should be done also in the "On End" travel section (optionally create a message first):

ShowMessage MyNPCTeleportersRemoved
player.RemoveItem MyNPCTeleporterNPCToPlayer 1 1
player.RemoveItem MyNPCTeleporterPlayerToNPC 1 1

This way the teleporter is removed only on arrival, and you can use the teleporter as long as the travel package is active. That might come in handy if the NPC gets lost or stuck in the gameworld.

 

Now make a relevant dialog topic in the NPC's quest if not already there. For instance MyNPCFired.

Add an INFO to the topic or edit an existing one, and edit the result script something like this:

set MyNPCREF.IsFollowingDefault to 0
set MyNPCREF.IsFollowingLong to 0
set MyNPCREF.Waiting to 0
set MyNPCREF.MyNPCRelaxing to 0
set MyNPCREF.HasBeenHired to 0
set MyNPCREF.MyNPCHasBeenFired to 1
MyNPCREF.SetPlayerTeammate 0
MyNPCREF.SetAV Assistance 0
MyNPCREF.ResetAI

SetPlayerTeammate 0 is very important. If you do not set this to zero the NPC will travel back to you when you change cells and will start to travel home all over again. The downside is that you have no way of knowing where your NPC is located on the map while travelling so I would advise to make a teleporter for the NPC, in case it never arrives at home (stuck somewhere).

 

This will make the NPC travel home when fired, and start relaxing on arrival. You can modify this to make a GoHomeAndRelax package, but figure that one out yourself.

 

######### OPTIONAL: How to make Teleporters ##########

 

Take an item in the GECK, something like sunglasses, rename the "ID" field to MyNPCTeleporterNPCToPlayer, change the "Name" field to something like "< Teleport MyNPC to me >", mark it as a quest item, and save it as a new form.

 

Do the same for a reverse teleporter: rename the sunglasses to MyNPCTeleporterPlayerToNPC, edit name, mark as quest item and save as new form.

 

Create a new object script and put in the following code:

scn MyNPCTeleportNPCToPlayerScript

;Teleports companion to player

Begin OnEquip

    set MyNPCREF.IsFollowingDefault to 0
    set MyNPCREF.IsFollowingLong to 0
    set MyNPCREF.Waiting to 1
    MyNPCREF.MoveTo Player

End

Create a second object script and put in the following code:

scn MyNPCTeleportPlayerToNPCScript

;Teleports player to companion

Begin OnEquip

    Player.MoveTo MyNPCREF

End

Open the Teleporter objects again and set the Script field to use the new Teleport scripts.

 

Optionally create messages to notify if the teleporters have been added or removed on hire or arriving home.

 

MyNPCTeleportersAdded: put in text like "NPC Teleporters added to your inventory."

MyNPCTeleportersRemoved: put in text like "NPC Teleporters removed from your inventory."

 

In the hired or hiredyes Topics info result script of the NPC's quest, add:

ShowMessage MyNPCTeleportersAdded
Player.Additem MyNPCTeleporterNPCToPlayer 1 1
Player.Additem MyNPCTeleporterPlayerToNPC 1 1

Set MyNPCREF.HasBeenHired to 1
Set MyNPCREF.MyNPCHasBeenFired to 0
MyNPCREF.SetPlayerTeammate 1
MyNPCREF.EvaluatePackage

For the Teleporters removal code, see above.

 

The Teleporters will show up in the Pip-Boy and when you select one of them, teleporting starts.

 

This is the main framework, however there could be some small mistakes or typos in here. If so, I expect you to figure that out yourself.

Edited by Nodevski
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-

Link to comment
Share on other sites

  • Recently Browsing   0 members

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