StevenC21 Posted March 8, 2018 Is there a way that I can lock down a player's movement, so that a cinematic can play out? This is using ACS, of course. 0 Share this post Link to post
0 snapshot Posted March 8, 2018 SetPlayerProperty(0,1,4); https://zdoom.org/wiki/SetPlayerProperty 0 Share this post Link to post
0 ReX Posted March 8, 2018 StevenC21, just in case you're wondering which function to use to restrict player movement: PROP_FROZEN allows the player to turn in place, look up or down, and attack, but not move forward/backward/sideways. PROP_TOTALLYFROZEN completely freezes the player Also, consider that while the player is frozen and the cinematic plays out, the player can continue to take damage if attacked. This may be handled by ensuring that the player is in a location where s/he cannot be attacked when the cinematic starts and ends. Alternatively, the player can be set to be invulnerable during the cut-scene. [The disadvantage of this is that when the cut-scene is over and invulnerability is removed, the player is immediately susceptible to attacks that may have begun while the player was immobilized.] 0 Share this post Link to post
0 Empyre Posted March 8, 2018 (edited) Here's a script I wrote that gives the player invulnerability while viewing a camera and for 3 seconds after. It checks if the player is already invulnerable, and doesn't take it away. Also, if the already-existing invul runs out, then the script gives invul to the player. Spoiler script "EmpViewCamera" (int CamID) { If(CheckInventory("EmpCameraIsInUse")) { Terminate; } GiveInventory("EmpCameraisInUse",1); Thing_Stop (0); ChangeCamera (CamID,0,0); SetPlayerProperty (0,ON,PROP_TOTALLYFROZEN); if (CheckInventory("EmpCameraInvul")) { if (!CheckActorProperty(0,APROP_Invulnerable,TRUE)) { SetActorProperty (0, APROP_Invulnerable,TRUE); } } else if (!CheckActorProperty(0,APROP_Invulnerable,TRUE)) { SetActorProperty (0, APROP_Invulnerable,TRUE); GiveInventory("EmpCameraInvul",1); } HudMessage (s:"Press Use to return to your own view.";HUDMSG_PLAIN,1,CR_YELLOW,1.5,0.5,0.0); While (GetPlayerInput(-1,INPUT_BUTTONS) & BT_USE) { Delay(4); if (CheckInventory("EmpCameraInvul")) { if (!CheckActorProperty(0,APROP_Invulnerable,TRUE)) { SetActorProperty (0, APROP_Invulnerable,TRUE); } } else if (!CheckActorProperty(0,APROP_Invulnerable,TRUE)) { SetActorProperty (0, APROP_Invulnerable,TRUE); GiveInventory("EmpCameraInvul",1); } } While (!(GetPlayerInput(-1,INPUT_BUTTONS) & BT_USE)) { Delay(4); if (CheckInventory("EmpCameraInvul")) { if (!CheckActorProperty(0,APROP_Invulnerable,TRUE)) { SetActorProperty (0, APROP_Invulnerable,TRUE); } } else if (!CheckActorProperty(0,APROP_Invulnerable,TRUE)) { SetActorProperty (0, APROP_Invulnerable,TRUE); GiveInventory("EmpCameraInvul",1); } } Hudmessage (s:" ";HUDMSG_PLAIN,1,CR_YELLOW,1.5,0.5,1.0/35+1); ChangeCamera (0,0,0); SetPlayerProperty (0,OFF,PROP_TOTALLYFROZEN); TakeInventory("EmpCameraIsInUse",1); for (int I = 1; I <= 21; I++)//21 times 5 tics = 105 tics or 3 seconds { Delay (5); if (CheckInventory("EmpCameraInvul")) { if (!CheckActorProperty(0,APROP_Invulnerable,TRUE)) { SetActorProperty (0, APROP_Invulnerable,TRUE); } } else if (!CheckActorProperty(0,APROP_Invulnerable,TRUE)) { SetActorProperty (0, APROP_Invulnerable,TRUE); GiveInventory("EmpCameraInvul",1); } } // Delay (105); //replaced by the above for loop If(!CheckInventory("EmpCamersIsInUse")) { If (CheckInventory("EmpCameraInvul")) { TakeInventory("EmpCameraInvul",1); SetActorProperty (0, APROP_Invulnerable,FALSE); } } } 0 Share this post Link to post
0 Empyre Posted March 9, 2018 I forgot to mention that for the script I posted above, you need these two actors declared in DECORATE: Spoiler ACTOR EmpCameraIsInUse : Inventory { Inventory.Amount 1 Inventory.MaxAmount 1 -INVBAR } ACTOR EmpCameraInvul : Inventory { Inventory.Amount 1 Inventory.MaxAmount 1 -INVBAR } Of course, feel free to edit the script to fit your needs. 0 Share this post Link to post
0 StevenC21 Posted March 9, 2018 @Empyre I would, but it went waaaaay beyond my ability to understand. I am a noob. These things are hard for me. 0 Share this post Link to post
Is there a way that I can lock down a player's movement, so that a cinematic can play out? This is using ACS, of course.
Share this post
Link to post