Completely disable all player movement for specific scenes

  • #1, z pakeithpsyWednesday, 06. April 2022, 23:10 hodinky 2 years ago
    I'm trying to create a scene where the player character is not visible and therefore cannot move anywhere on screen. However, everything else on screen can still be moved and interacted with. Yet I cannot find a way to disable movement for the player character. Setting it to "hide character" only makes the character invisible, but when I removed the "hide" command, I found out the character is still moving to where I click. Nothing I do can stop this, not even removing the way system does anything as they just continue to walk around. How can I disable movement for the player character???

    Bažant

    18 Posts


  • #2, z afrlmeThursday, 07. April 2022, 00:00 hodinky 2 years ago
    Don't add the character to the scene - use show scene/menu action part instead of change scene action part to change to a new scene without teleporting the playable character to it. Or create a way system border outside of the scene & set the character position inside of that. Or you can disable destination update for each mouse input via script too. Or use a menu type scene or an interface overlay. You have loads of options to choose from. wink

    Imperátor

    7285 Posts

  • #3, z pakeithpsyThursday, 07. April 2022, 01:30 hodinky 2 years ago
    Well... that fixed the problem, but now I can't see any subtitles for the player character.

    Tried creating a new character for that purpose but I can't get the subtitles in the spot I want them.

    Edit: Nvm I found out how to use narration text, I'm good. ??

    Bažant

    18 Posts

  • #4, z afrlmeThursday, 07. April 2022, 02:08 hodinky 2 years ago
    Aye narration text is the way to go when you have no character(s) on scene.

    Imperátor

    7285 Posts

  • #5, z pakeithpsySunday, 01. May 2022, 03:32 hodinky 2 years ago
    Okay, now I'm on a new scene where the player character is visible, but shouldn't be able to move since they're supposed to be trapped at this point in the story. Still can't get them to stay put, even with no way system.

    Tried creating an action area with the action "stop character" and execution type "when character enters area" but that doesn't seem to be doing anything.

    Bažant

    18 Posts

  • #6, z afrlmeSunday, 01. May 2022, 18:05 hodinky 2 years ago
    Did you change the title of this thread?

    Anyway... you have at least 2 choices.

    1. swap out the playable character with an npc version.

    2. you can use Lua script to temporarily tell the engine that left click shouldn't update the destination.

    game.LeftClickBehaviour = eMouseActionBehaviourDoNotSendCharacter


    Here are all the available options you can use:

    • eMouseActionBehaviourDoNotSendCharacter 0
    • eMouseActionBehaviourSendCharacterToCursor 1
    • eMouseActionBehaviourSendCharacterToObjects 2


    The default option is: eMouseActionBehaviourSendCharacterToCursor

    Imperátor

    7285 Posts

  • #7, z pakeithpsySunday, 01. May 2022, 19:03 hodinky 2 years ago
    Ah. I did try the NPC method you mentioned, it seems to work alright.
    Not well-versed in Lua, though I may give it a try.

    Bažant

    18 Posts

  • #8, z afrlmeSunday, 01. May 2022, 19:32 hodinky 2 years ago
    Insert this line of code into an execute script action part when you want to disable left click from updating destination...

    game.LeftClickBehaviour = eMouseActionBehaviourDoNotSendCharacter

    & same thing again when you want to re-enable it via this line of code...
    game.LeftClickBehaviour = eMouseActionBehaviourSendCharacterToCursor

    & that's about it. wink

    Imperátor

    7285 Posts

  • #9, z pakeithpsySunday, 01. May 2022, 20:33 hodinky 2 years ago
    Worked like a charm!
    Thanks man.

    Bažant

    18 Posts