Jump to content

Locking player completely - Mean camera movement


Recommended Posts

I want to lock the player movement completely for some time . I can achieve that with the SET_PLAYER_LOCKED script. But what about camera movement? I can still not only move the camera up and down but i can rotate the player model. Is there any script or option to stop everything for player?

Link to comment

If not, you could always activate a cinematic with the camera where the player is locked. That may not be ideal for what you are trying to do but it's an option.

Cinematic removes the player from what i remember.. so this is not what i am looking for. I want it to be like it is a gameplay function. 

 

I maybe found the answer - 

 

SET_LOCKYAW            "off/auto/float"    Locks the legs yaw angle of the entity. The head and torso will turn freely but only so far as their tolerance off the leg's angles will let them. That way it will move one direction and look another. "Off" turns off lock angle. "Auto" locks it the current yaw angle, a float value forces it to a specific yaw.

 

But dont know how script should look like for this one. Any ideas?

Link to comment

do you have script like this? Can you show us here?

 

This are the commands that I use to force the player to look at a certain direction. The numbers at "SET_ANGLES" depend on where do you want your character to look at. 

	affect ( "player", FLUSH )
	{
		set ( "SET_ANGLES", < 10.000 90.000 0.000 > );
		set ( "SET_PLAYER_LOCKED", "false" );
	}

Maybe you could try to loop that for a couple seconds to see if the player can move his camera during that time, or if the game crashes because of the loop.

Langerd likes this
Link to comment

This are the commands that I use to force the player to look at a certain direction. The numbers at "SET_ANGLES" depend on where do you want your character to look at. 

	affect ( "player", FLUSH )
	{
		set ( "SET_ANGLES", < 10.000 90.000 0.000 > );
		set ( "SET_PLAYER_LOCKED", "false" );
	}

Maybe you could try to loop that for a couple seconds to see if the player can move his camera during that time, or if the game crashes because of the loop.

Lawl... set_angles works for a player? thought it works only for brushes type entities.

Noodle likes this
Link to comment

I thought it was only for the player and NPCs!

Hmm i might measled you @@Noodle. set_angles is only for npc and player -  https://github.com/JACoders/OpenJK/wiki/ICARUS-Scripting#npc-only-set-fields

 

But if you want to set the angles of the brush enitity you use rotate - https://github.com/JACoders/OpenJK/wiki/ICARUS-Scripting#brush-manipulation-commands instantly i think you just set seconds to 0

 

 

For people who start to script or are not scripters in general but has many times problems with icarius i will leav this link - https://github.com/JACoders/OpenJK/wiki/ICARUS-Scripting

Noodle and Mandalorian like this
Link to comment

This are the commands that I use to force the player to look at a certain direction. The numbers at "SET_ANGLES" depend on where do you want your character to look at. 

 

affect ( "player", FLUSH )
	{
		set ( "SET_ANGLES", < 10.000 90.000 0.000 > );
		set ( "SET_PLAYER_LOCKED", "false" );
	}
Maybe you could try to loop that for a couple seconds to see if the player can move his camera during that time, or if the game crashes because of the loop.

Hmm i cant make it to work because i also want the camera lock when upper and lower parts of the player moves. Maybe if i would fit all commands at once but i cant figure out how... some changes turned off animation for some reason and i needed to use a loop already (for one animation to loop) not sure what should i do here :/ i will try scripting. If it will still not work i will send you script i have made

Noodle likes this
Link to comment

Hmm i cant make it to work because i also want the camera lock when upper and lower parts of the player moves. Maybe if i would fit all commands at once but i cant figure out how... some changes turned off animation for some reason and i needed to use a loop already (for one animation to loop) not sure what should i do here :/ i will try scripting. If it will still not work i will send you script i have made

 

Sure, I can check the script if it doesn't work! 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...