pierremgi 4892 Posted November 17, 2017 As @Tankbuster said, modelToWorld is OK. The best reference I found for the reliable "center" of an object/building whatever its direction/elevation is: _bbr = boundingBoxReal _yourObject; _p1 = _bbr select 0; _p2 = _bbr select 1; _pos = _yourObject modelToWorld (_p1 vectorAdd _p2 vectorMultiply 0.5); 1 Share this post Link to post Share on other sites
Tankbuster 1746 Posted November 17, 2017 I've been fiddling with modeltoworldworld because I am doing similar stuff, but over water. I found that setpos'ing the object in script was flakey because modeltoworldworld returns worldpos, so had to use setposworld instead. This may or may not be relevent here, just thought I'd mention it just in case. Share this post Link to post Share on other sites
lsd 147 Posted November 17, 2017 Just beat me to this - I've been working on a Eden/Zeus module-based implementation to use in making missions. You could assign the building a variable to identify it as processed, which would fix your overlapping trigger issue. Is there an easy way you check the pathways in the assets? Feel free to edit or use any of the layouts I've made for the Altis buildings, hopefully we use the same coordinate layouts. https://github.com/LISTINGS09/ZEI/blob/master/ZEI/functions/fn_interiorCiv.sqf I'm currently working on the Apex buildings but it's slow going. 3 Share this post Link to post Share on other sites
phronk 898 Posted November 17, 2017 DOWNLOAD LINK - (Google Drive) DOWNLOAD LINK - (Steam Workshop) Version: 0.1 INITIAL RELEASE _____________________________________________________ NOTE: The CFG.sqf included in the PF folder is the configuration file; there's currently only two settings you can change, debug mode (true/false) and an array of markers to blacklist from spawning furniture in. The script doesn't feature up to 3 random layouts for any houses, but I just wanted to release this so I can work on other shit. Enjoy. 4 Share this post Link to post Share on other sites
johnnyboy 3797 Posted November 17, 2017 You deserve a medal for the tedious grunt work dude. Thanks much. Share this post Link to post Share on other sites
HazJ 1289 Posted November 18, 2017 Great work! @phronk Trying it out now! lol! Share this post Link to post Share on other sites
phronk 898 Posted November 18, 2017 @HazJ Thanks, didn't reference correct classname for the desk. Fixed it now. Will upload an update later. 1 Share this post Link to post Share on other sites
Atomic_Core 0 Posted November 18, 2017 Would be great if you made a detailed description of your process in making those "templates". We have a large community here and all of us can easily outbeat you in both originality and production speed in making a much much larger pack of those templates. Making a some sort of a tool that allows you to simple export those templates from a 3den Editor made mission would be quite handy. For example if we simply had a VR map with the building in question set at 0,0,0 from the world of that map. Then you fill up that building with w/e you want using the 3den controls and easy to use interface. Export it and have your relative xyz to that source building??? would that work? who knows.... I would recommend you convert this into a MOD, scrips and mods are the same thing anyways, and it would allow consistent versions to be pushed w/o having to consistently redo mission templates. Would also make your mod some sort of a "Must have" across the whole community imo, fill the void in my Arma. Share this post Link to post Share on other sites
phronk 898 Posted November 18, 2017 It's a bit more complicated than just playing doll-house in the editor and "placing" furniture around the house. Here's the process I go through to do it: 1. Go into Virtual Reality map 2. Place a house (Name the house "myHouse") 3. Place an invisible helipad (Name the helipad "house") 4. Put code into helipad init: house setPos(getPosATL myHouse) Now for every single piece of furniture you want to put into that house, I execute an attachTo command in the editor's debug and mess with the offsets until it looks good enough in the house. Not only that, but I have another AI unit in my group whom I give move orders to all the building positions in the building and see what paths he takes. No tools involved. Just boring tedious mundane work and patience. Here's an example of attaching an object to the invisible helipad: 5. Place a piece of furniture, like a couch, and name it "sofa" 6. Local execute this code in the debug window, and tweak it 'til you have "placed" the furniture where you want it: sofa attachTo [ house, [ 0, 0, 1 ]; I mean hey, if you want to go ahead creating layouts, now you have an idea how to do it. 1 Share this post Link to post Share on other sites
Tankbuster 1746 Posted November 18, 2017 4 hours ago, SGT M.Lafontaine said: Would be great if you made a detailed description of your process in making those "templates". We have a large community here and all of us can easily outbeat you in both originality and production speed in making a much much larger pack of those templates. Making a some sort of a tool that allows you to simple export those templates from a 3den Editor made mission would be quite handy. For example if we simply had a VR map with the building in question set at 0,0,0 from the world of that map. Then you fill up that building with w/e you want using the 3den controls and easy to use interface. Export it and have your relative xyz to that source building??? would that work? who knows.... I would recommend you convert this into a MOD, scrips and mods are the same thing anyways, and it would allow consistent versions to be pushed w/o having to consistently redo mission templates. Would also make your mod some sort of a "Must have" across the whole community imo, fill the void in my Arma. +1 for us helping. -1 for making it into a mod. Something like this doesn't need to be a mod. Share this post Link to post Share on other sites
phronk 898 Posted November 18, 2017 DOWNLOAD LINK - (Google Drive) DOWNLOAD LINK - (Steam Workshop) Version: 0.2 Fixed: Incorrect classname reference caused an invisible desk Optimized: Blacklist code is more efficient Optimized: If PF_Blacklist = [] or [""], the script will skip blacklist code __________________________________ Additionally, I corrected some information and typos in the readMe.txt 2 Share this post Link to post Share on other sites
Atomic_Core 0 Posted November 18, 2017 8 hours ago, Tankbuster said: -1 for making it into a mod. Something like this doesn't need to be a mod. Ideally you can have both. Scripted version and modded version allowing communities who allready have a modpack to easily integrate it in all of their missions, and communities who run pub servers to easily add this has a feature. My Milsim community runs 2 templates on 10+ different maps. They have to be consistently updated to keep up with changes in our framework, etc... I won't be updating 20+ mission files every time there is an update to this thing, especially that now hes in early developement phase and you can expect consistently occuring new itterations. Think about it. We aren't just talking about 1 mission here and there to play with 2-3 of your friends. Having it modded on the workshop allows me to integrate this in our modpack and forget about updates or anything else. The Dev can do w/e he wants and push has many updates he wants it wont affect my productivity. Share this post Link to post Share on other sites
Tankbuster 1746 Posted November 18, 2017 Maintaining two different versions? I know I wouldn't be all that keen. 1 Share this post Link to post Share on other sites
Goro 21 Posted November 18, 2017 Hey! That's amazing actually! Can I use it in my post-apo missions? It'd bring some really wonderful addiction! Share this post Link to post Share on other sites
phronk 898 Posted November 18, 2017 You have permission to use the script in your mission, as long as I'm given credit somewhere for you using the code. Even if you modify the code, it's a generous courtesy for you (as the mission maker) to provide credit to the original script creator(s). Share this post Link to post Share on other sites
Goro 21 Posted November 19, 2017 12 hours ago, phronk said: You have permission to use the script in your mission, as long as I'm given credit somewhere for you using the code. Even if you modify the code, it's a generous courtesy for you (as the mission maker) to provide credit to the original script creator(s). Of course you'll be credited 1 Share this post Link to post Share on other sites
kennyleif 20 Posted November 19, 2017 is there a way to exclude a town or area? For example an area where you yourself want to furnish the buildings with specific things? Share this post Link to post Share on other sites
phronk 898 Posted November 19, 2017 Place an ellipse marker covering that town, name it, and reference it in the PF_Blacklist array (in the CFG.sqf) Share this post Link to post Share on other sites
kennyleif 20 Posted November 20, 2017 On 11/19/2017 at 9:30 PM, phronk said: Place an ellipse marker covering that town, name it, and reference it in the PF_Blacklist array (in the CFG.sqf) cool. Thanks Share this post Link to post Share on other sites
Blackheart_Six 283 Posted November 20, 2017 THIS IS FRICKING GREAT! Well done.... You need to update your signature.... 1 Share this post Link to post Share on other sites
Blackheart_Six 283 Posted November 21, 2017 Using on my server.... Observation: 1. When there is only one player, all the furniture disappears when the player dies and re-spawns, then the script is triggered again when he spawns in, and the furniture reappears. 2. When the furniture spawns it has to orient it self to the house with correct azimuth. There is a delay between the furniture spawning in, and the correcting for orientation, leaving furniture sticking out walls, and in the wrong position. Share this post Link to post Share on other sites
phronk 898 Posted November 21, 2017 1. This bug is now fixed. I'll release an update in a couple days. 2. The delay is intended, but sometimes it takes longer for some of the furniture to rotate. They should eventually rotate, at least when you're close enough. Share this post Link to post Share on other sites
HazJ 1289 Posted November 21, 2017 @phronk - How come you use attachTo command for the furniture inside the building? Code snippet from something I did ages back: _group = createGroup civilian; { _building = _x; _npc = _group createUnit ["C_man_1", [0, 0, 0], [], 0, "CAN_COLLIDE"]; _npc setDir ((getDir (_building select 0)) + 185); _position = (_building select 0) modelToWorld [3, 5, 0]; _npc setPos _position; } forEach (nearestObjects [(getArray (configfile >> "CfgWorlds" >> "Altis" >> "centerPosition")), ["Land_CarService_F"], ("Altis" call BIS_fnc_mapSize)]); I was just curious is all, was there a reason why you took this approach? Share this post Link to post Share on other sites
Tankbuster 1746 Posted November 21, 2017 Does attachto make for floating furniture if the building is destroyed? Share this post Link to post Share on other sites
phronk 898 Posted November 21, 2017 @HazJ I just like using attachTo, I'm more "experienced" with it. Haven't tried your method, yet.@Tankbuster Unfortunately yes. They won't spawn in hidden/destroyed buildings. Undestroyed buildings can spawn furniture in it and if that building is destroyed later, the furniture may still "float" until the town's furniture trigger is deactivated/despawns all furniture. I might add a fix in the future, but it's not too big a deal at the moment. Share this post Link to post Share on other sites