Jump to content

DisablePlayerControls() not working prperly


Recommended Posts

Hi there folks. Seems I don't get something in how the Input Layers work, so here is the deal. I want to FULLY disable player's controls, so that he (she) would stand and stare ahead. The code you see below makes ABSOLUTELLY no difference. Let's say it is written in the quest stage to be exact.
Where can I be possibly wrong, please tell me. Thank you beforehand.
InputEnableLayer DCMGPlayerLayer = InputEnableLayer.Create()
DCMGPlayerLayer.DisablePlayerControls(true, true, true, true, true, true, true, true, true, true, true)   ;;disable everything
Game.ForceFirstPerson()

 

Link to comment
Share on other sites

hi!

 

why do you have 11 bool values as input parameters? DisablePlayerControls only have 9, of which the first 8 are expected to be booleans and the last one is supposed to be an integer.

 

btw the rest of your code seems to be correct. this example below should work as it's from DialogueGoodneighborScript - when you date Magnolia and been teleported to the hotel room:

Function MagnoliaDate()
	InputEnableLayer myLayer = InputEnableLayer.Create()
	Actor myPlayer = Game.GetPlayer()
	Actor MagnoliaREF = Magnolia.GetActorRef()

	myLayer.DisablePlayerControls()
	Game.FadeOutGame(True, True, 0.0, 3.0, True)
	Utility.Wait(5.0)
	;Game.PassTime(4)
	Utility.Wait(0.1)
	MagnoliaREF.moveto(HotelMagnoliaMarkerREF)
	myPlayer.Moveto(HotelPlayerMarkerREF)
	Utility.Wait(0.1)

	Game.FadeOutGame(False, True, 0.0, 3.0)
	;track when the scene should progress
	DateComplete = 0
	MagnoliaGreetScene03.Start()
	Utility.Wait(3.0)
	LoversEmbracePerkSpell.Cast(myPlayer, myPlayer)
	DateComplete = 1
	myLayer = None
EndFunction
Link to comment
Share on other sites

Hey, cdante, many thanks to you man for the response.

 

Your example looks the same that mine. Couldn't think of any moments in game where the controls are taken away other than the begining with Vault-Tec Rep. And that quest is a bit overcomplicated to search within it. But you pointed me out the another very good direction.

 

Soon right after your answer I found the solution. Will post just in case other guys have the same issue. Well it is little bit hard for me to explain, but long story short - the problem was the Input Layer exists only while the parent script is active. So for some reason the game doesn't take DisableControls command from quest fragment into account. When written in the Stage Fragment this Input Layer expires right after its creation and the player control frees.

 

But if you attach script to the Quest itself (quest is running) with at least only Input Layer declared it will store the information about player controls till the quest is finished. And you can then adress quest script as a quest and adjust the controls running this fragment in parallel to the main quest stage fragment. Twisted a bit but it works!!!

 

 

 

 

 

P.s. Speaking about the function arguments, DisablePlayerControls differs in Fallout from its analogue in Skyrim a little. 11 boolean arguments (F4, Skyrim)

Edited by werr92
Link to comment
Share on other sites

oh my mistake, sorry, I thought I was looking at the FO4 page on the CK wiki.

glad it worked out and nice to know about these restrictions, thank you!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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