Jump to content
SparkZ

Disable player movement problem

Recommended Posts

I managed to create a scene where the player can't move but can move his head, but I don't know how to make it moveable again. I know the code to be moveable again but I don't know where to put it as the waypoint is alread occupied by the disabled movement animation. Anyone knows how to end the animation after some texts has been displayed?

Share this post


Link to post
Share on other sites

Here's some ways..

_unit playMove "someAnimation";

//do stuff

_unit switchMove ""; //break out of an animation

_unit enableSimulation false;

//stuff

_unit enableSimulation true;  

just for kicks, here's a not so great way to enable and disable user input.

//disable user input
disableUserInput true; 

//do stuff

//enable user input
disableUserInput false; 

Edited by Iceman77
Added different ways

Share this post


Link to post
Share on other sites

if you dont want there screen to be frozen only the anims then do it like this

//Disable all movement
player enableSimulation false;

//Enable all movements
player enableSimulation true;

Share this post


Link to post
Share on other sites

I know that, but it's like a conversation and I don't know how to time the animation to stop. Like after the converstation the animation stops, and I don't know what to put at the //do stuff part.

It's just, I got the animation running but It's just a few radio messages playing and after those the animation stops. But I don't know how :P

Can't explain it any better xp

---------- Post added at 19:36 ---------- Previous post was at 19:34 ----------

_unit playMove "someAnimation";

This part is where there needs to be a timer or something after the messaged appeared.

_unit switchMove ""; //break out of an animation  

Share this post


Link to post
Share on other sites

Maybe after animation starts give eventhandler.

_unit addEventHandler ["Animchanged",{(_this select 0) switchMove ""; (_this select 0) removeAllEventHandlers "Animchanged"}];

when unit stops talking animation has changed and goes back to default.

Not sure, but the removeAllEventHandlers "Animchanged" part may need to be spawned?

Seems like its working as is here.

Share this post


Link to post
Share on other sites

You never responded so I assume you got it working. Another way you could do this is just using sleep statements.

player enableSimulation false;

unitTalk sideChat "some talking";

sleep 5;

unitTalk sideChat "some more talking";

sleep 5;

unitTalk sideChat "a little more talking";

player enableSimulation true;

Share this post


Link to post
Share on other sites

Well, sorry for not responding had quite busy last time. But I didn't got it working I just made the converstation while you can walk around with a "Patrol" task. But I'll try your method and see if it worked, thanks :)

Share this post


Link to post
Share on other sites

Hey, what about the attachTo command? attach the player to an object, don't specify its relative location ([0,0,0] don't do that).

I know it works on objects and vehicles, I need to check if it works on units.

It should allow you too look, and player should still animate, but not move.

I will test it too, I'm curious if it works as I think it should.

Share this post


Link to post
Share on other sites

Old topic, but posting this to help the next guy searching for this.

 

The best way I know to disable player movement and still allow head movement is to do this:

player switchMove "HubSpectator_stand";

Then to reneable player movement, do this:

player switchMove "";

 

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×