Jump to content
Sign in to follow this  
dreadpirate

Furnishing Script

Recommended Posts

I've started making a script to auto-furnish buildings, starting with the military offices:

Place a Game Logic over the building you want to furnish with the init line:

nul = [this] execVM "furnish.sqf";

furnish.sqf:

if !(isServer) exitWith {};


_building = nearestBuilding (_this select 0);


_tmp = "Land_TableDesk_F" createVehicle position _building;
[_building, _tmp, [2.7, -4.7, 0.5], 270] call BIS_fnc_relPosObject;


_tmp = "Land_TableDesk_F" createVehicle position _building;
[_building, _tmp, [-0.7, -1.7, 0.5], 90] call BIS_fnc_relPosObject; 


_tmp = "Land_TableDesk_F" createVehicle position _building;
[_building, _tmp, [-5.1, -4.7, 0.5], 90] call BIS_fnc_relPosObject; 


_tmp = "Land_TableDesk_F" createVehicle position _building;
[_building, _tmp, [-2.4, -1.1, 0.5], 180] call BIS_fnc_relPosObject; 

Eventually, I'll use attachTo to place chairs, computers and random small objects on the desks.

But it's pretty tedious work shifting each desk around and previewing in the editor.

I tried using Zeus, but the desks bounced around and fell over too often.

I can use attachTo to pick up a desk and place it where I want, but how would I get a relative position and orientation to the building to plug into BIS_fnc_relPosObject?

Share this post


Link to post
Share on other sites

Ive done a few things to get these types of things done easily without scripting. I personally would not want a script to place furnishings.

1.) I have opened the objects im attaching in Object Builder to locate the "absolute center" so that using attachTo is easier to do. Since its based on (simplifying it here) left/right, up/down, front/back in relation to the object its being attached to its good to have a record of the location of the center of object.

2.)Each of the objects has a different "absolute center", I dont know if there would be a command to look for it. Even the medic and command HQs have different centers and are basically the same shape with different textures.

3.) Ive pre-made on a mission each of the houses with furnishings in my version of standards. ie Ive got a VR mission with a bunch of buildings with stuff in them from ghost hotel with attached stairs to medical HQs with my versions of beds in them to sheds with desks and gear boxes ready to copy paste into another mission.

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  

×