pepperman35 Posted January 21, 2023 Share Posted January 21, 2023 (edited) Okay, I am currently working on adding an Hotelier to my settlement to facilitate renting a room or a penthouse to the player. I’d like to use the activator (Hotelbell) to summon the Hotelier to the counter instead of them standing there 24/7. I intent to use the NPCBarInvShopKeep at the hotel counter, and the hotel management office (Hotelier office/room) is located adjacent to the check-in area. Conceptually, I suppose the Hotelier could man the counter during core hours, and that he/she could be summoned outside of those core hours on bell activate. If the Hotelier typically hangs out in his/her room/office during the off hours, what would be the best way to summon them to the counter? I am thinking an NPC with voice lines, a quest, a script, and some AI packages could get the job done. I’m thinking the script would be placed on the bell and on activate summon the NPC to the counter if it is outside core hours (a sit package to load the character into the NPCBarInvShopKeep furniture, and start the NPC’s dialogue scene. The dialogue screen should take care of renting the penthouse (caps check, exchange of caps for a key card, etc). Am I missing anything or is there a better way to envision this. I suppose the Hotelier could hand out tasks (fetch or kill quests) to earn the rights to the Penthouse as an alternative to caps. Thoughts? Edited January 21, 2023 by pepperman35 Link to comment Share on other sites More sharing options...
pepperman35 Posted January 22, 2023 Author Share Posted January 22, 2023 Okay, ran into a little snag. So how do I force a package on the NPC via a script? I see things like GetCurrentPackage() and evaluatePackage() but I am not seeing anything like add package. Let me guess, this is something that will have to be done inside a quest. Link to comment Share on other sites More sharing options...
DieFeM Posted January 23, 2023 Share Posted January 23, 2023 Let me guess, this is something that will have to be done inside a quest. Well, at least you need a quest in which you have a reference alias that has such package. Then you can apply the package (and everything else) from the alias to the reference of the actor.ApplyToRef - ReferenceAlias - Creation Kit Link to comment Share on other sites More sharing options...
pepperman35 Posted January 23, 2023 Author Share Posted January 23, 2023 Thanks DieFem, much appreciated. Link to comment Share on other sites More sharing options...
LarannKiar Posted January 23, 2023 Share Posted January 23, 2023 If you'd like to keep track of your clerks, ForceRefTo (ReferenceAlias) and AddToRef (RefCollectionAlias) would make them temporarly persistent. Link to comment Share on other sites More sharing options...
pepperman35 Posted January 27, 2023 Author Share Posted January 27, 2023 Making progress. Okay I have created the NPC Hotelier and make two AI sit packages. One package sit the Hotelier to the counter where she works from 0800 to 1800. The other sit package takes her back to the office. A dialogue quest has been made and appropriate dialog (greeting and positive, negative, neutral and question response options) created. The Hotelier and player dialogue has been conditioned. When the player chooses the positive option, the Hotelier takes the players caps and give him the penthouse access card. All of these seems to work as designed. Working on the hotel bell (activator) now. Tried a few things so far but not been successful to date. Not sure if the existing AI packages is causing the NPC not to respond or what. I will continue reading to increase my understanding. Here is script on the bell as it currently stands. Scriptname SummomHotelierOnActivateScript extends ObjectReference {Script placed on the hotel bell. On activate it will summon the hotelier to the counter} ; ;-- Properties -------------------------------------- ; ReferenceAlias Property Alias_Cassie Auto Const ActorBase Property CassandraGallagher Auto Const float Property HotelierOpenTime = 8.0 auto {The time at which hotelier should be at the counter. Set to 8:00 am by default} float Property HotelierCloseTime = 18.0 auto {The time at which hotelier should leave the counter. Set to 6:00 pm by default} ObjectReference Property FO4_HotelShopKeep01 Auto Const ; ; Functions ; float Function GetCurrentHourOfDay() global {Returns the current time of day in hours since midnight} float Time = Utility.GetCurrentGameTime() Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit Time *= 24 ; Convert from fraction of a day to number of hours Return Time EndFunction Event OnActivate(ObjectReference akActionRef) float CurrentTime = GetCurrentHourOfDay() if (akActionRef == game.Getplayer() && ((CurrentTime >= HotelierCloseTime) || (CurrentTime < HotelierOpenTime))) ; Summon the Hotelier to the counter ;Debug.MessageBox("The conditions were met, Cassie is being summoned") Else ;Debug.MessageBox("The condition was not met, Cassie couldn't be summoned") EndIf EndEvent Link to comment Share on other sites More sharing options...
pepperman35 Posted January 27, 2023 Author Share Posted January 27, 2023 Was able to sort it out. I created a global variable FO4_HotelierSummonState. Created a third AI package to facilitate the return of the Hotelier to the counter outside of normal business hours. Used the global variable to condition two of the AI packages. Amended the script to make the change to the global and evaluate AI package. Seemed to work. Happy…happy…happy. Conceptually I could see someone being annoying and ringing the bell while the Hotelier was in position. In that case, I’d like to explore a dialogue line along the lines of “Enough with the @#$%^& bell already.” That would be funny. Scriptname SummomHotelierOnActivateScript extends ObjectReference {Script placed on the hotel bell. On activate it will summon the hotelier to the counter} ; ;-- Properties -------------------------------------- ; ReferenceAlias Property Alias_Cassie Auto Const ActorBase Property CassandraGallagher Auto Const float Property HotelierOpenTime = 8.0 auto {The time at which hotelier should be at the counter. Set to 8:00 am by default} float Property HotelierCloseTime = 18.0 auto {The time at which hotelier should leave the counter. Set to 6:00 pm by default} ObjectReference Property FO4_HotelShopKeep01 Auto Const GlobalVariable Property FO4_HotelierSummonState Auto Const Mandatory {set to 0 for not summoned; 1 for summoned} ; ; Functions ; float Function GetCurrentHourOfDay() global {Returns the current time of day in hours since midnight} float Time = Utility.GetCurrentGameTime() Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit Time *= 24 ; Convert from fraction of a day to number of hours Return Time EndFunction Event OnActivate(ObjectReference akActionRef) float CurrentTime = GetCurrentHourOfDay() if (akActionRef == game.Getplayer() && ((CurrentTime >= HotelierCloseTime) || (CurrentTime < HotelierOpenTime))) ; Summon the Hotelier to the counter ;Debug.MessageBox("The conditions were met, Cassie is being summoned") FO4_HotelierSummonState.SetValue(1 as float) Alias_Cassie.GetActorReference().EvaluatePackage() Else ;Debug.MessageBox("The condition was not met, Cassie couldn't be summoned") EndIf EndEvent Link to comment Share on other sites More sharing options...
Recommended Posts