Product Chat / Any chance to rotate player?

Author
Message
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 5th May 2016 17:41
Hi guys
Working in a "scifi weapon checkpoint", and I need to rotate player.
This has nothing to do with "FloatPlatform", just want to transport for point A (trigger zone) to point B (a platform)
I'm using "trigger zone" to run my script, and using "TransportToIfUsed(e)", and it does fine, but player comes faceting the wrong angle; in another words, if you positioned looking to the north, so players appears looking to your left, instead of looking to your front.

So I thing being able to RotatePlayer I can bypass the wrong faceting.
Or perhaps there is another one I'm missing here?

And yes, I've tried also:

Quote: "SetFreezePosition(x,y,z)
SetFreezeAngle(x,y,z)
TransportToFreezePosition()"


And those commands goes fine if player is closest to the platform, but this not the case, since platform is the destination point.

I'e tried...



And I got "nil value" error in line "tNewX = g_Entity[10]['x'] ", looks like GG does not recognize "10" as platform id.

Any idea?

Thanks in avance for all feedbacks

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
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 5th May 2016 18:01
Quote: "And I got "nil value" error in line "tNewX = g_Entity[10]['x'] ", looks like GG does not recognize "10" as platform id.
"


Is your destination platform, entity 10, dynamic? If not it won't work as static entities no longer report their position to lua.

If it is dynamic, it could be that it hasn't initialised on first engine cycle at the time your script referencing it runs, so add a pending instruction to your script to wait until all lua scripts have been through engine once, something like:



Cheers
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 5th May 2016 18:39
@ cybernescence
Thanks mate!!
You are right about dynamic item, now I do not get the nil error and my script work, but player continue faceting wrong way.

player faceting wrong angle



The single arrow is the angle the player are looking.
The double arrow is the angle I want to achieve.

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
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 5th May 2016 18:59
I'm not totally sure what you're trying to achieve from the picture, but what I do if I want to force a player angle view (after transport) is to set the angle to a known entity angle at the destination. So I'll place a flat dynamic entity at the correct position & angle that the player should be moved to (and face) and then using that known entity number (knownE):



Cheers.
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 5th May 2016 19:02
I've noticed something a bit odd.
If I enter into the "trigger zone" by the angle I want to achieve, I've got the right angle.
Of course I can not force my customers, even their levels player, to do so.
So this not the full solution, thought.

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: 5th May 2016 19:24
you just need to change the Y angle in the freeze angle to the desired angle.

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: 5th May 2016 19:31 Edited at: 5th May 2016 19:40
Sorry cybernescence I was posting while you post your own.

Your solution are great, and finally I've got; thanks a lot mate.

About what I want to achieve, well when I ve done I'll upload a video, so you'' get my point better.

things are more complicated than this.
Once the player is transported to point B, there is a skeleton (SpawnAtStart=no) that must be spawned, and their animation must run.
This skeleton represent the player crossing the weapon checkpoint, if the player is armed, an alarm is triggered, plus a poisonous gas that kills him instantly.
On the contrary, if the player is disarmed, it will be transported to point C, that is, across the hall.
Of course while all this happens player will be freeze.

the player only observe the scene.
It is designed so to force the player to start level disarmed.



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
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 5th May 2016 21:52
Nice concept - a bit like "Total Recall" (original version)

Cheers.
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 5th May 2016 21:52
I've got almost complete.

player armed




player disarmed



Anyone know if "FreezePlayer()" is working fine?

thanks for watch the videos.

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: 6th May 2016 00:45
freezeplayer just stops you from being able to move but yes it works.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Login to post a reply

Server time is: 2024-06-26 07:34:24
Your offset time is: 2024-06-26 07:34:24