Bug Reports / Function FreezePlayer() doesn't freeze player character in 3rd person mode

Author
Message
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 7th Nov 2015 21:48 Edited at: 10th Nov 2015 23:16
Error report: In 3rd person mode, if a script calls function FreezePlayer() while player is moving, player loses control and the screen stops moving, but player character keeps moving (even though player doesn't see this, because camera doesn't move) and the walking animation keeps going. When UnFreezePlayer() is called, the player character and camera teleport to whichever location the character has had time to walk between these calls.

Repeatable: As far as I've tried*.

Howto: Place a start marker with the wizard character and another entity with a script that freezes player. E.g.
Test play mode. Capslock off. Hit p and try to move. Nothing happens. Hit o and notice that you are in the same position as before hitting p. So far everything is ok. Now start moving forward and while moving, hit p. Notice the continuing of your walking animation. Wait some time and hit o. Notice that you are now standing in a different location than before.

ps. If an entity is attacking player while FreezeAI() is called, the AI will keep attacking.
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 10th Nov 2015 16:41
Also happens in 1st person mode.
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 10th Nov 2015 21:17 Edited at: 10th Nov 2015 22:51
My best workaround so far:
Which is called after this is done:
It tests player position and tries to stop player as long as he/she keeps moving. But there is one problem with it: If player keeps holding W, A, S or D down, character will keep moving (but does stop for good as soon as player releases these keys). And UnGlitch or not, the bug is still there.

Ps. Fully functional workaround (and much much much much more (like better save/load script)) could be created if there was "SetPlayerLocaction(x,y,z)" function. So my fellow forum users, pretty please vote for "All settings to have equivalent LUA commands" (also "Player control override", "Camera Control override" and "Full entity override" could help) instead of anything else in the feature vote.

https://www.game-guru.com/feature-vote

Seriously. If that was done, most of the other features in the list could be created with LUA!
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Nov 2015 23:38
you could just move whatever is running that script to the players position and then transport the player to it
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 11th Nov 2015 09:17
Problem with your approach is the entity's y-coordinate gets messed up (problem that I described here) when I try to return the entity back to its original position. Another one is that it requires user to write entitys name to 'if used' field.

(I've created an RPG style inventory script (video, btw.) and I want to make it as newbie friendly as possible before I publish it. My goal is that it works 100 % out-of-box without user having to set anything else than an entity to use it (and static mode off).)
Scene Commander
Support Manager
16
Years of Service
User Offline
Joined: 3rd May 2008
Location:
Posted: 12th Nov 2015 06:27
Hi,

FreezePlayer() works for me in 1st person. I'll check the 3rd person camera.

We do plan on expanding the Lua scripting soon.

SC
i7-4770s 3.10ghz - Geforce GTX 650ti
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 12th Nov 2015 08:07
Are you sure? Mine works fine too, except when player is actively moving while FreezePlayer() is called (and keeps moving that direction until UnFreezePlayer() is called).
Ratall
16
Years of Service
User Offline
Joined: 29th Jun 2008
Location: Not Here
Posted: 16th Nov 2015 08:37 Edited at: 16th Nov 2015 08:41
Hi
didn't Lee say in one of his twitches that you have to stop the animation with StopAnimation(e) before freezing the Player/ai .
I mean it makes sense as the animation system appears to run independently of the object movement and ai.

Rick

edit sorry may have got the wrong end of the stick there but I am still have a memory of Lee saying that you need to stop the animation before you freeze.
CPU:i7-4720HQ Mem: 16G
Graphic: GTX 980M 8G and intel HD4600
OS: Windows10
PM
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 16th Nov 2015 11:39
Thanks, Ratall. I'll try that, though my problem really isn't the animation, but the continuation of the movement. We'll see whether stopping animation fixes the problem.
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 18th Nov 2015 14:10 Edited at: 18th Nov 2015 18:43
StopAnimation() doesn't help. I had already written a workaround that made the problem disappear (works better in my case than the UnGlitcher()):

The problem itself seems to be kind of fixed in the new build BUT only virtually and with an extremely annoying side effect.

First of all, I say "kind of" because the character still actually moves (this can be proven by creating a script that tests distance to player and prompts when player is near it - Now in testplay face character with this script and start moving. Hit p and see the camera stop (animation continues as usual). Wait for a while and a prompt appears. Wait some more and it disappears. Now hit o and voila, you are back in the original positions, but... BUT (now comes the annoying part) screen flashes black and MUSIC RESTARTS.

NOOOoooooOOOO!!! DO NOT WANT!!!

If the player position can now be saved for later use then why not just give us "SetPlayerLocaction(x,y,z)", "FlashScreenBlack()" and "RestartMusic()" functions instead of clumping these together with UnFreezePlayer() to make the game look like a skipping record player?

I made another thread about this immedieately when I noticed the new state of affairs. Sorry for flooding. I didn't remember that I had already started a discussion about this topic here. The other thread is here:

https://forum.game-guru.com/thread/213795

Login to post a reply

Server time is: 2025-04-29 07:43:14
Your offset time is: 2025-04-29 07:43:14