OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ahmed117 on 05 Dec 2011, 07:05:02
-
Dear folks,
Is there any script to make a unit sit on a chair? I heard about the "switchmove" scripts,
(unit_name switchmove "FXtotable") but from this code the unit is not sitting on the specific chair, Unit is just sitting in air.
Please help me by suggesting me any code.
ThankXxX
Ahmed 117
-
What chair are you using? The Chair X object is used for sitting units, the 'chair hangar' and 'chair small' are decorative and not functional items.
-
Ok, then please let me know the code for chair X....
-
There's no code, it should be in the objects list with the other chair types.
-
Hey
Try this: Add a chair (Any) with namw "Chair" and then add the soldier, in his init or a script write this: soldier1 SwitchMove "Onchair" , but you have to put him on the chair, I suggest you to use this command, for example soldier1 setpos [getpos chair select 0 , getpos chair select1 , 1]
I hope it helps,
Cheers,
Aldo15
-
Ok thanks dude, I got it.But it is only applicable on "Chair X". :(
-
nope, You can use it in any chair, see u later...
-
If you're using the 'switchmove 'onchair'' command and you want the person on the chair then using the 'Chair X' will produce the best results. I've tested this in the past and I've found that using the Onchair command with any other type of chair will cause the person to be sitting either on the edge of the chair, or completely away from the chair, regardless of where you position the person in the editor.
The top screenshot shows the usage of the 'switchmove Onchair' command and the 'Chair X' model. As you can see, the person is sitting perfectly on the chair, so this is the best method to use (it's also the simplest).
The bottom screenshot shows the usage of a different chair model; the 'chair hangar'. I used the 'switchmove onchair' and the setpos command and the result is the same; the person is not sitting on the chair properly.
Imo if you want the best result you should use the switchmove onchair command.
-
Wow... Its really working, Thankyou, gruntage. :clap: