Jump to content

Making an NPC Companion Force Greet the Player


TheTuna

Recommended Posts

My custom companion mod is nearing completion, and I'm trying to add the finishing touches at the moment to get it ready for initial release. One problem I've been having is how to get the NPC to force greet the player and initiate a conversation.

 

The NPC's an Enclave companion, and I don't want him to equip his power armor until the player is level 20 for balance reasons. I want him to initiate a conversation regarding this so he doesn't just switch to randomly wearing power armor, which I could do with a trigger.

 

I've tried copying Veronica's ForceGreet AI package and changing the conditions to suit my needs, but it doesn't seem to fit. What do I need to do to get my NPC companion to initiate a conversation with the player once hired and the player has reached Level 20?

Link to comment
Share on other sites

Do you already have a quest or gamemode script for your companion? Have you done force greets before? Combining these is not too hard. In the quest or gamemode script, you can check "if player.getlevel > 20". To force greet, set up a conversation topic, and then execute "companionref.startconversation player yourtopic". It may be that using Veronica's script has introduced a lot of extra complications. It may be easier to start small, from scratch. If any more details are helpful, please let us know.
Link to comment
Share on other sites

Ah, I thought you had to make an AI package for that (damn you GECK wiki!) That makes a lot of sense, I can do that. Thanks for the help! :)

 

EDIT: Worked like a charm! Thank you! :)

Edited by TheTuna
Link to comment
Share on other sites

Ah, I thought you had to make an AI package for that (damn you GECK wiki!) That makes a lot of sense, I can do that. Thanks for the help! :)

 

You don't need to use an AI Package for it, but sometimes, if you try startconversation and you can't get it to work correctly, you can get addscriptpackage to work using an AI package. A package gives you more control over the situation, especially if there is something else going on at the same time in the game; a startconversation can (and does) get dumped sometimes and doesn't execute, although it could work the next time through the game, something that doesn't really happen to dialogue packages. And, then, the next level of control above addscriptpackage would be to evp the NPC onto the dialogue package completely (package in NPC's package list) so he wouldn't evp out of it (addscriptpackages could have that happen), and I do the NPCref.evp/package in the NPC list route in very important situations.

 

The script set up would mostly be the same for all the scenarios.

Link to comment
Share on other sites

Hmmm, one question; I've set up a variable to keep the conversation from repeating, and it works, except after exiting dialogue for the first time he will engage the player in his primary dialogue options once.
Link to comment
Share on other sites

Create the topic you want the NPC to use, or a custom greeting.

 

You can use any number of conditions to initiate the conversation, I like to use GetDetected so they can't greet me when I'm hidden.

 

If you use GetDetected, your script would look something like:

 

scn myscript

short   doonce

Begin GameMode

if mynpcref.getdetected player == 1
    mynpcref.startconversation player mynewtopic
    set doonce to 1
endif

End

 

If you are like davidallen and programming for your UNIVAC2 that only has 8 bits of RAM and don't want to use GameMode, use an OnTrigger block or something else instead, in which case you probably don't want use the getdetected bit.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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