Jump to content

Holo Companion Mod scripting


BlueBeard1983

Recommended Posts

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 Dies

Gets moved to death cell

Get resurrected

Gets moved back to player after a set period of time

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

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

  • Recently Browsing   0 members

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