Product Chat / Do not get "FreezePlayer/UnFreezePlayer" working as expected

Author
Message
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 12th May 2016 23:26
Hi guys
I'm working in a scifi weapon checkpoint for the store, and almost everything is finished, except "FreezePlayer()/UnFreezePlayer()", I can not get it to work well.

Maybe I must add, this item is intended to force player to begin level disarmed, since if he is armed, do not bypass the scanner and die.
Please see the video, will help you understand the problem.

In the script I have written, if I do not use "FreezePlayer()", everything works fine; but if I use it, nothing works as expected.

Basically it works as follows:
1- the player enters the hall.
2- he is transported automatically to the next point (as in the video), the skeleton is visible and the animation begins.
This is where I want the player to remain frozen ("FreezePlayer()"), until it happens any of two things, as follow:

a- the player is armed - the player dies.
b- the player is disarmed - the player is transported to the point C (Please see the video), and immediately must be defrosted ("UnFreezePlayer()").

<What happens when I use ("FreezePlayer()")>

The player is frozen and transported to the same site (point B) instead of being transported to the point C; and immediately it behaves as if the player is unarmed, indicating that he is unarmed, all the other way round.



Thanks in advance for any tip, and for watch the vid.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 24th May 2016 15:52
It sounds like a logic issue at the moment. What I would need is a very simple step by step using stock media which shows that the freeze system for the player is broken. It is used in a number of stock examples and seems to work fine. Anyone else notice this issue in their own projects?
PC SPECS: Windows 8.1 Pro 64-bit, Intel Core i7-5930K (PASSMARK:13645), NVIDIA Geforce GTX 980 GPU (PASSMARK:9762) , 32GB RAM

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 24th May 2016 16:27
I haven't had any issues myself, and I use freeze quite a bit. I'd check and make sure the freeze code is actually being run and not ignored. For instance, say your original code checks a distance to start, it may be causing you issues when you transport to the new position as you are no longer within distance. Or if the distance is too far, it may be out of range of the original script and so not run. Set to always active is useful in this regard.


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 24th May 2016 21:32
@ Lee
Thanks for ask about.
That's should be an isolate case; honestly does no try with stock one yet.
In fact this is only aestetic way, looks better with the player freeze, but does not very important, since player dies, even if he is moving around the room, (if armed of course).
If I do:
"if PlayerDist<150 then
FreezePlayer()"

All the rest of the code plus all the scene freeze with the player, so it does not get the line telling "UnFreezePlayer()", so it keeping freeze for ever, till I press "ESC".

However if I place "FreezePlayer()" after transport player codelines, so, does nothing, all the the scene run fine, except the player does not freeze, like in the video above.

@ DVader

Quote: "For instance, say your original code checks a distance to start, it may be causing you issues when you transport to the new position as you are no longer within distance. Or if the distance is too far, it may be out of range of the original script and so not run"


There are 2 scripts.

1- attached to a trigger zone (point A)
a- Transport player from point A to point B.
b- Spawn skeleton
c- Run skeleton anim
d- Play skeleton sound (if any)
e- Activate "Point B"
f- Determine if player is armed, and store value in a global var (plrHasWeapon=1)

2- attached to a item (point B)
a- Execute actions accordingly with "plrHasWeapon" var value.

1a- If armed, player died, otherwise, player is transported to "point C", (the next level)
1b- hide skeleton
1c- stop anims
d- stop sounds
e- "UnFreezePlayer", (if needed).

Quote: "Set to always active is useful in this regard."

I've tried with not to avail, even I've trid to activate it via script, but it looks like "Activate" command just work with the caller itself, In other words, if a barrel call "Activate(e,v) command, this just activate these barrel, you can not does ie: Activate(e,5), so, do nothing, at least for me.

Thanks a lot for the tip.

3com


Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 24th May 2016 23:35
sounds like you're using them wrong as they work ok for me (only issue is you shouldn't repeatedly call them or it can make you fly into space )

Quote: "if a barrel call "Activate(e,v) command, this just activate these barrel, you can not does ie: Activate(e,5), so, do nothing"

you should change the 'e' for the entity number and the v for the activation state to change it to.
i.e. using your above example =
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 25th May 2016 05:10
Quote: "you should change the 'e' for the entity number and the v for the activation state to change it to"


Yes, I've done so, I just wrong when type above.

Distance to the player don't should be an issue, since I've tried also when player has been transported to point B, in the script attached to it, so most closest player can't to be.

Thanks 4 the tip smallg

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM

Login to post a reply

Server time is: 2024-11-25 02:28:25
Your offset time is: 2024-11-25 02:28:25