Jump to content
King of tentacle

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

Recommended Posts

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!

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...