OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: MOC_XIII on 29 Mar 2005, 02:08:46

Title: chairs
Post by: MOC_XIII on 29 Mar 2005, 02:08:46
Does anyone have a script to make a AI sit in chair with anim?
I tried with setpos but he only goes next to the chair. help plz
Title: Re:chairs
Post by: Blanco on 29 Mar 2005, 02:37:03
It only works with the chairX.

...  :-\
Or was it Xchair?
Brrr, I'm confused...
Anyway, it a chair with an x in it's name.  :P




Title: Re:chairs
Post by: Flauta on 29 Mar 2005, 02:41:53
edit this..  not really know if thias is going to work.. cause i just invented it..

Code: [Select]
;sit.sqs
;writing it.. on the fly :p
;use it like these [man,y offset,x offset, z offset,obejct,animation] exec "sit.sqs"
;example [officer1,2,2,3,chair,FXstandSitDown] exec "sit.sqs"
;Maden by Flauta

_sold = this select 0
_obj = this select 4
_anim = this select 5
_yoff = this select 1
_xoff = this select 2
_zoff = this select 3

;not suer what was the animation command, I think it was swichmove..
_sold swichmove _anim
_sold setpos [(getpos _obj select 0) + _xoff,(getpos _obj select 1) + _yoff,_zoff]

play whit the offset's to make the man sit normaly in whatever you want to do it sit...


tellme if it worked!!

flauta
Title: Re:chairs
Post by: RujiK on 29 Mar 2005, 05:38:11
Kind of an unrealistic script sir...

It may work however it is very unpractical.

I would simply get a chairx As chairx is an object that does not have any inertia so you can walk right through it.

Than just set a unit on top and have him do the proper anim.

Or if you dont want him to be pushable make a loop that keeps him on the chair.
Title: Re:chairs
Post by: Dubieman on 29 Mar 2005, 06:41:06
gooddubie switchmove "OnChair"

And preview a couple of times to get the right placement.

And I've used other chairs. I once had Guba and his cronies chilling out in his little villa on the rose chairs and sofa. Looked funny. ;D
Title: Re:chairs
Post by: bedges on 29 Mar 2005, 09:51:47
create a chair, name it chair1.

create a loon. call it loon1.

create a trigger, activated once, by loon1 (group the trigger to the loon), place the loon inside the trigger, and in the trigger's 'on activation' field put

Code: [Select]
loon1 setPos [getPos chair1 select 0, getPos chair1 select 1]; loon1 switchMove "FXStandUnivTable"
presto. loon sitting on chair. you may need to removeallweapons from the loon, set his behaviour to careless (otherwise he'll twist his head around like a possess'd one to look at stuff) and make sure that the loon and chair are both pointing in the same direction.

EDIT - and now having read the original post properly i realise that may not animate the loon into the chair. swap the switchmove for a playmove, that should work. ;)
Title: Re:chairs
Post by: Grunt249 on 30 Mar 2005, 00:57:06
This might not be what you want, since it's an addon and not a script. But it's small enough that you can include it with your mission so nobody will have to download it.

http://www.atwar.net/download.php?view.3051 (http://www.atwar.net/download.php?view.3051)

It adds several pieces of furniture that have built-in "moveincargo" actions so that human or AI units can sit or lay in/on them. Includes a bed, sofa, and work desk. Only 194KB in size, and made by Philcommando, a name people trust.