Jump to content
Sign in to follow this  
AAD10 Pete

How let people sit on a chair?

Recommended Posts

Hi guys

What do I have to do to let people, from the beginning of a mission, sit on a chair.

For example like the people in the briefing room in one of the first mission of the campaign who all are sitting on their chairs and listen to the commanders briefing.

If I give the right animation to the people, they sit too high in the air and pull automatically away the chair-object...

Any other possibilities to let people sit on a chair from the beginning of a mission?

Thanks for your help

Share this post


Link to post
Share on other sites

Ya I noticed that as well. Most likely you will have to use attachto

I haven't messed with it yet but there's lots of posts on it.

Example scripts that use the attachTo command

Share this post


Link to post
Share on other sites

@pufu:

Thats exactly what I did but with this way it doesn't seem possible.

@shanawa:

thx, I will try that out.

Share this post


Link to post
Share on other sites
@pufu:

Thats exactly what I did but with this way it doesn't seem possible.

@shanawa:

thx, I will try that out.

I am sure it is possible if you got the proper animation. Which you probably don't and unfortunately cannot direct you to it (as i don't know the sit on chair anim)

Share this post


Link to post
Share on other sites

Both work but switchto command for the animation you will have to have the right anim or the player/ unit will slide off the chair/push the chair away.

If you placed the chair urself via an object I would use the attachto command and the switchmove command and when the unit has to get up I would use unit1 attachto [unit1,[0,0,0]]; and unit1 switchmove ""

Share this post


Link to post
Share on other sites

There's a chair vehicle that you can use moveInCargo on. E.g.:

myChair = "FoldChair_with_Cargo" createVehicle getPos player;
player moveInCargo myChair;

Share this post


Link to post
Share on other sites
There's a chair vehicle that you can use moveInCargo on. E.g.:

myChair = "FoldChair_with_Cargo" createVehicle getPos player;
player moveInCargo myChair;

Ha! My inability to perform this simple task has been putting a real downer on my editing time. I must have spent 3 hours fiddling with animations and attachto...

Many many thanks.

Share this post


Link to post
Share on other sites
There's a chair vehicle that you can use moveInCargo on. E.g.:

myChair = "FoldChair_with_Cargo" createVehicle getPos player;
player moveInCargo myChair;

forgive my noobness but . . .

is this a script or what? where do i put this code?

Share this post


Link to post
Share on other sites

That's a script to create the chair, and move the player into the chair. If you put that in the player's init box (in the editor), it would create a chair at the player's position, and put the player in it.

Share this post


Link to post
Share on other sites

I tried it in an NPC's init and it didn't work. I tried changing the "player" to "co1" (what i named the NPC, and "this"

Share this post


Link to post
Share on other sites

Well, this would work (and does, have tested) for any unit (NPC or player), if placed in their init field:

myChair = "FoldChair_with_Cargo" createVehicle getPos this;
this moveInCargo myChair;

Share this post


Link to post
Share on other sites

Try using this.

this disableAI "MOVE"; 
removeAllWeapons this; 
this switchMove "sitUnarm_L_relaxing";  
this setPos (getPos chair1); 
this setDir (getDir chair1 - 90);

Where actor is some unit such as a rifleman and chair1 is a folding chair placed in the editor.

I put that script in the "init" field on the "actor" rifleman, works like a charm. The hard part would be getting smooth transitions to walking around and sitting down etc :D

Edit: setDir is not behaving well, the unit seems to like to turn to his own direction, fixed with disableAI "MOVE". The -90 degrees on the direction is due to the animation being rotated 90 degrees from the unit's forward direction.

Edited by xPaveway

Share this post


Link to post
Share on other sites

@JamesF1 - worked like a charm! . . . except the person/chair is always ending up in a random spot facing a random direction rather than the original direction of the character.

@xPaveway - also worked like a charm! ... the first time, but now when I try it the person sitting in the chair is not facing the correct way. I've double checked the code but its all the same as it was before (just copied and pasted, changed the names of the person/chair).

Edit: ok . . . I got it workin Paveway, only I had to set the character's initial direction 100 degrees different from the direction of the folding chair.

Edited by TheRev709

Share this post


Link to post
Share on other sites

@xPaveway

Your method worked great. There is one problem though... for some reason AI character stands up to salute after some time and wont sit back again...

Any workaround?

I'm sorry, it seems that this actually happens only when you ''greet'' him. Few seconds later he stands up and saluts, after that he wont sit again...

would loop solve it?

Then I would have to use while {true} do... but I have no idea how to set it up so that it works... Can someone write that code for me?

Or any better suggestions? Not to ''greet'' him lol?

Edited by Minoza

Share this post


Link to post
Share on other sites
@JamesF1 - worked like a charm! . . . except the person/chair is always ending up in a random spot facing a random direction rather than the original direction of the character.

@xPaveway - also worked like a charm! ... the first time, but now when I try it the person sitting in the chair is not facing the correct way. I've double checked the code but its all the same as it was before (just copied and pasted, changed the names of the person/chair).

Edit: ok . . . I got it workin Paveway, only I had to set the character's initial direction 100 degrees different from the direction of the folding chair.

I still have this occurring. I tried adjusting the number but the chair and unit still are at 90 degree angle from each other. Is there a work around?

Share this post


Link to post
Share on other sites

Hey, i am having a relatively similar issue, only I would like the player to have the scroll option to "sit in Chair." The final product would be a player walking up to the chair pressing sit in chair then sitting, then while sitting have the option to get out of the chair...any ideas?

Share this post


Link to post
Share on other sites
Hey, i am having a relatively similar issue, only I would like the player to have the scroll option to "sit in Chair." The final product would be a player walking up to the chair pressing sit in chair then sitting, then while sitting have the option to get out of the chair...any ideas?

Chair with actionMenu

...works fine for me...

;)

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
Sign in to follow this  

×