Jump to content

Script help: Move player, and force into furniture.


Trykz

Recommended Posts

Posted

Basically, I need to move the player to, and then put the player into a furniture item (chair), after they make a terminal selection. How do I achieve this?

 

I have the other functions I need performed working flawlessly as follows:

 

1) Player makes a terminal selection and exits the terminal

2) Screen fades to black (timed)

3) <-----------------------------------    Here is where I need to move the player and place them into the chair. But how?

4) Other stuff happens

5) Screen fades back in (timed)

 

Any help would be greatly appreciated.

 

TIA,

 

Trykz

Posted

Do you need to see them path to the furniture? It sounds like no because the screen is faded any way right? The moveto command will force the player into the idle animation associated with a piece of furniture. So just:

 

    yourPlayerREF.MoveTo(yourFurnitureREF)

 

Ought to do it. You may want to disable player controls briefly while you do it:

 

    InputEnableLayer myLayer = InputEnableLayer.Create()
    myLayer.DisablePlayerControls()

 

And discard it when you're done with it.

 

    myLayer.Delete()

 

Note that using the moveto command on the player will often invoke a load screen even when moving to a reference in the same cell. That might interfere with your fades.

 

[edit]

 

I should have also said that as your player char is now performing the idle, when you're done with it (on a timer etc) you can automatically make them exit the idle by making them activate the object reference that you moved them to.

 

    yourFurnitureREF.Activate(yourPlayerREF)

Posted

Generally it's along the lines of disable player controls, set player ai driven, then you could set up a sittarget AI pack for the Player which can be put on a player alias, or in a scene...

 

Alternatively, you can set the furniture as an objectref property or alias in a script and activate it via script, something like: NearbyFurniture.GetReference().Activate(PlayerRef, false)

 

GetReference is for aliases, remove it if you're doing a straight objectreference.

 

 

Posted

Thank you both. Immensely. After a little fiddling around with the script fragment, I now have everything working exactly as intended ?

 

Trykz

Archived

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

  • Recently Browsing   0 members

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