BlueBeard1983 Posted December 15, 2016 Share Posted December 15, 2016 I'm revisiting one my New Vegas mods, trying to get it to work as intended. The issue I'm running into now is that I'm not sure what scripting I need to get a certain function to work. What I want to do is once the Hologram Companion's HP reaches 0 and the companion dies I want the body to move to a different cell (such as the developers room or one I can make for this purpose) and resurrect. After 2 in game days I want the companion to be moved back to the player and become an active companion again. I also understand that this may be messed up if the player takes another companion while the holo companion is recharging, so I may make the time limit go to when combat ends. Simply put:Holo Companion DiesGets moved to death cellGet resurrectedGets moved back to player after a set period of time Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
Ladez Posted December 15, 2016 Share Posted December 15, 2016 The following example is pretty basic and probably has some issues that need attention, but it's only intended to give you a general idea of how to proceed. Place an XMarker in the death cell and give it an editor ID. Move the NPC to this marker and resurrect it when it dies. Create a quest that you start when the NPC dies, which runs a countdown and moves the NPC back when finished.NPC OnDeath block: begin OnDeath MoveTo HoloDeathCellMarkerRef ;Move to XMarker in death cell HoloCompanionRef.ResurrectActor 1 set HoloCompanionRecharging.lastDeath to GameDaysPassed ;Set the companions last registered death to right now StartQuest HoloCompanionRecharging ;Begin the countdown ;Do companion firing stuff here... end Quest script for recharging: scriptname HoloCompanionRechargingScript float lastDeath begin Gamemode if lastDeath + 2 < GameDaysPassed ;Has 2 in-game days passed? HoloCompanionRef.MoveTo player ;Move back to player. May want to do some extra positioning after this StopQuest HoloCompanionRecharging ;Stop the countdown ;Do companion rehiring stuff here. endif end Rehiring the companion could potentially also be done via dialogue, by having it start conversation when it returns. Link to comment Share on other sites More sharing options...
BlueBeard1983 Posted December 15, 2016 Author Share Posted December 15, 2016 Awesome! thank you, this is exactly what I was looking for. And I'm glad you didn't post pristine scripts, gives me a chance to tweak them and learn more scripting :D EDIT: Almost got it working. only problem is the companion returns immediately... Link to comment Share on other sites More sharing options...
Recommended Posts