Jump to content

how does the game tell a mattress from a bed in survival?


Recommended Posts

Posted

There's a function in the HC_ManagerScript (main survival mode script) called WakeUpPlayerBasedOnBedType that's called on a PlayerSleepStart event. It differentiates the passed in bed Object Reference between beds, sleeping bags and others (mattresses etc).

 

The bed object check functions are:

 

bool Function IsSleepingBag(ObjectReference RefToCheck)
	return CommonArrayFunctions.CheckObjectAgainstKeywordArray(RefToCheck, SleepingBagKeywords)
EndFunction

bool Function IsMattress(ObjectReference RefToCheck)
	return CommonArrayFunctions.CheckObjectAgainstKeywordArray(RefToCheck, MattressKeywords)
EndFunction

bool Function IsBed(ObjectReference RefToCheck)
	return CommonArrayFunctions.CheckObjectAgainstKeywordArray(RefToCheck, BedKeywords)
EndFunction

 

The keyword array declarations:

 

	keyword[] Property SleepingBagKeywords const auto mandatory
	{a bed with any of these keywords will be treated as a sleeping bag, wins over Mattress and Bed keywords}

	keyword[] Property MattressKeywords const auto mandatory
	{a bed with any of these keywords will be treated as a matress, wins over Bed keywords}

	keyword[] Property BedKeywords const auto mandatory
	{a bed with any of these keywords will be treated as a bed}

 

SleepingBagKeywords contains HC_ObjType_SleepingBag

 

MattressKeywords contains AnimFurnFloorBedAnims


BedKeywords contains AnimFurnBedAnims, AnimFurnHospitalBed

 

 

What a mess!

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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