NPC initiating conversation via a timer

Post » Sat May 28, 2011 4:32 pm

I searched the forums, but may not have had the right keywords to find what I'm looking for. I'm not new to modding as I've modded Morrowind and Oblivion.

I'm trying to make a romance mod where the NPC will romance the player.

Once the NPC is a companion follower, I would like to have the NPC start dialogue with the player after he sleeps (when I know the player won't be in combat) at so many game seconds after sleeping (to give the player time to get oriented and moving).

I looked through the script variables list on the wiki, but couldn't find a game variable for time or a timer type thing.

Would there be a better way to set this up? I want the player to feel like the NPC is romancing him/her, not the other way around where the player has to initiate everything. I want the NPC to start conversations during downtime (which would be after sleeping -- couldn't find any script variables that referred to player sitting).
User avatar
Jonathan Montero
 
Posts: 3487
Joined: Tue Aug 14, 2007 3:22 am

Post » Sat May 28, 2011 2:09 pm

Well you can use http://geck.gamesas.com/index.php/IsPCSleeping to find out when the player starts sleeping. And a timer is simply this. You declare a variable called something like 'timer' then set it to itself - the time that has passed every frame using http://geck.gamesas.com/index.php/GetSecondsPassed.

float timerIf Timer > 0  Set Timer to (Timer - GetSecondsPassed)EndIf


That timer would count down to 0 from whatever you set it to. Usually you would have an ElseIf statement afterwords to tell it what to do when it hits 0. Then each time it hits 0 you up the stage by 1, making it do something different each time, thus a staged timer.

What you might do, is make a quest, and use the quest script so it works anywhere. Then have it check IsPCSleeping and if so, set a variable to one. Then if that variable is one, give the NPC a package with that as a condition, so they talk to the player upon waking up. Then when they are done talking, set the variable back to 0. So it works each time.
User avatar
Alisha Clarke
 
Posts: 3461
Joined: Tue Jan 16, 2007 2:53 am


Return to Fallout 3