Jump to content
phronk

[Released] Phronk's Furniture Script

Recommended Posts

Download Link (Google Drive)

Download Link (Steam Workshop)
Download Link (Armaholic)

Version: 0.4

Size: 124 KB

 

ADDITIONS:

• Added: New setting to adjust % chance for furniture to spawn per house

• Added: Electronics store furniture layout for one of the Altis shops

• Added: Script now supports all A3 location types

• Added: Script now supports all A2 location types

• Added: MissionEventHandler to delete furniture in ruined houses

 

ADJUSTMENTS:

• Changed: Rewrote location finder code:

          + Trigger/marker size scales with town size

          + Trigger/marker angle taken into account

• Changed: Trigger deactivation deletes objects attached to invisible helipads

• Changed: Color of debug markers to ColorCiv, from ColorWest

• Tweaked: Merged Arma 2 location types with Arma 3 location types

• Tweaked: Increased trigger's max elevation activation to 99m, up from 0m

• Tweaked: Disabled simulation of invisible helipads on houses, instead of deleted

• Tweaked: Reduced damage check of buildings to 0.6, down from 0.9

 

FIXES:
• Fixed: Overlapping triggers could cause furniture to spawn more than once

• Fixed: Blacklisted markers system

• Fixed: All buildings in trigger would spawn an invisible helipad

• Fixed: Trigger deactivation should no longer delete loot

• Fixed: Locations with 0 PF supported houses in them no longer spawn a trigger

• Fixed: A specific house type did not have its functions initialized

• Fixed: Undefined variable reference for bucket object caused a script error

• Fixed: Undefined variable reference for radio object caused a script error

• Fixed: Undefined variable reference for table object caused a script error

• Fixed: Tanoa flag paths were defined incorrectly

• Fixed: Reduced sleep delays to help fix the delayed object rotation issues

• Fixed: Removed most sleep delays to help fix the delayed object rotation issues

 

OPTIMIZATIONS:

• Optimized: Script initialization (Thanks to Metalman10)

• Optimized: All instances of the createVehicle[] command now use "can_collide"

• Optimized: Invisible helipads are created only on buildings with furniture

• Optimized: Trigger calls code for PF supported houses only

• Optimized: Trigger deactivation deletes a couple specific objects

• Optimized: Triggers are only created in locations with PF supported houses

• Optimized: Blacklist marker code

• Optimized: Replaced BIS_fnc_inTrigger, with inArea

• Optimized: Significantly reduced script delays

• Optimized: Naming of furniture trigger markers

• Optimized: HelipadEmpty is created on the house's position, instead of setPos

• Optimized: Replaced a couple forEach commands, with count

• Optimized: Removed some unneeded occurrences of the setDir command

 

 

 

KNOWN BUGS:

• Bug free!

__________________________________________________________________________


All known bugs are now fixed.  I've also reworked a lot of the code.  I've decided to stick with the attachTo method, because it is more efficient than setting/getting variables on everything (houses AND spawned furniture) with how I clean up the furniture upon deactivation.  I still have a lot of work to do.  I've updated the To Do List, so you'll know what to expect in the future.

 

Thanks and enjoy!

  • Like 3
  • Thanks 3

Share this post


Link to post
Share on other sites

This is amazing! Thanks for your great and hard work, and thanks for sharing this!!! Will definitely use this on my server. How will this work in missions where clutter has already been placed manually in some points by the mission maker? I always put some stuff in the military metal structures, so if players raid them they seem a little more realistic. Or will you only do town houses? Anyway. Great stuff, can't wait to see this working on Tanoa.

Share this post


Link to post
Share on other sites

Thanks; the script currently only spawns furniture within residential buildings from Altis, Malden, and Stratis.  I'm still adding furniture for more houses, including Tanoa (Not yet included).  Abandoned houses, industrial buildings, and military structures are planned.  The upcoming version of the script will allow you to blacklist houses within defined markers, blacklist houses within specific defined locations, and blacklist houses with their classnames defined in the CFG.sqf

  • Like 1

Share this post


Link to post
Share on other sites

Download Link (Google Drive)

Download Link (Steam Workshop)
Download Link (Armaholic)

Version: 0.5

Size: 160 KB

 

ADDITIONS:

Added: Furniture layout for 6 unique Tanoa houses
• Added: New furniture layout for Land_i_House_Small_02_V1_F
• Added: New furniture layout for Land_i_Addon_02_V1_F

• Added: New setting to blacklist specific locations, in the CFG.sqf

• Added: New setting to blacklist specific building classnames, in the CFG.sqf

• Added: New unhide function which unhides furniture within 150m of player

• Added: Code now repositions/resizes some map specific locations (WIP)

 

ADJUSTMENTS:

• Tweaked: Increased furniture spawn chance setting to 75%, up from 50%

• Tweaked: Added more furniture to a couple houses which still felt too empty

• Tweaked: Slightly moved some furniture to be less intrusive in a couple houses

• Tweaked: Wooden table in Land_i_Stone_HouseBig_V1_F is now larger

• Tweaked: Replaced getPosATL with getPosASL in some instances

 

FIXES:
• Fixed: Blacklist markers system

• Fixed: Fireplaces wouldn't despawn upon trigger deactivation

• Fixed: Some triggers/markers which spawned in water didn't behave correctly

 

OPTIMIZATIONS:

• Optimized: Furniture is hidden globally after spawning

• Optimized: Furniture is revealed to client when he is within 150m of furniture

• Optimized: Replaced some forEach commands with count

• Optimized: Renamed _tempH variable to _H, in spawn.sqf

• Optimized: Renamed _house variable to _B, in spawn.sqf

• Optimized: Renamed _house variable to _H, in furniture scripts

• Optimized: Code no longer pointlessly checks for location types

• Optimized: Removed useless _housePos variable from garage layout script

 

REMOVALS:

• Removed: Useless array of location types

• Removed: Redundant _townType check / variable

 

 

 

KNOWN BUGS:

• Bug free!

__________________________________________________________________________


Merry Christmas! :xmas:

 

Thanks and enjoy!

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

you do a gods job, thanks for adding what's missing in arma

  • Like 1

Share this post


Link to post
Share on other sites

Really good idea to implement! Thanks for your effort.

 

Did anybody run the script in dedi with >25  people? Is there any performance issues?

Share this post


Link to post
Share on other sites

Great work and most of it done placing objects by hand. A labour of love.

 

I'll be using this in the next build of my mission, for sure.

  • Thanks 1

Share this post


Link to post
Share on other sites

@phronk

I'm getting an error sometimes to do with _bucket being undefined:

17:39:10 Error in expression < 85;_chair1 attachTo[_h,[9,1.5,1.31]];_bucket attachTo[_h,[10.06,1.2,1.06]];_>
17:39:10   Error position: <_bucket attachTo[_h,[10.06,1.2,1.06]];_>
17:39:10   Error Undefined variable in expression: _bucket
17:39:10 File D:\Users\beno_\Documents\Arma 3\missions\MDCS-Urban.Altis\core\PF\A3\h1_4.sqf, line 58

It so far has only happened when I setPos into a high density area (i.e. towns/cities). I've been running with PF_Chance=100, and there's a fair amount of FPS-lag when it's about to happen too. Just thought it'd be worth mentioning.

 

Edit:

So, rather than being lazy I had a quick look, and it seems that h1_4.sqf is missing the line:

private _bucket=createSimpleObject["Land_Bucket_F",[0,0,0]];

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you.  The bug is now fixed in the next version, 0.6.  I'll try to update the script this week before I ship my PC out.

  • Like 2

Share this post


Link to post
Share on other sites

Hey @Phronk, I'm also getting an error (I'm applying your script to a Tonoa mission).  My player location is in the town of Lami near the Aeroport de Tanoa. Maybe its the bug you just fixed for upcoming release .6?   Happy New Year bro!

private _H=_this select 0;

private _bed=createSimpleObje>
 9:54:38   Error position: <select 0;

private _bed=createSimpleObje>
 9:54:38   Error select: Type Object, expected Array,String,Config entry
 9:54:38 File C:\Users\John\Documents\Arma 3\missions\aaaLTIT_BoomDog.Tanoa\PF\T\h1_1.sqf, line 2
 9:54:38 Error in expression <.Tanoa\PF\T\h1_1.sqf"

private _H=_this select 0;

private _bed=createSimpleObje>
 9:54:38   Error position: <select 0;

private _bed=createSimpleObje>
 9:54:38   Error select: Type Object, expected Array,String,Config entry

 

Share this post


Link to post
Share on other sites

Yeah, _this select 0 should be _this instead.  Thanks!

Share this post


Link to post
Share on other sites

Hey Phronk, I bet you are totally sick of manually furnishing buildings...but if you're still at it, you might consider adding the plank (Land_Plank_01_8m_F) inside the industrial shed (Land_i_Shed_Ind_F) like below.  This gives players walkable ramp access to the window above the office for sneaky observation, sniping, etc.  No hurry, and no worries if you're not interested...  Happy New Year buddy!

Plank_In_Garage.jpg

  • Like 5

Share this post


Link to post
Share on other sites

I'll see what I can do. :wink_o:

  • Like 2

Share this post


Link to post
Share on other sites

That's an amazing project!

I like how much effort you've put into these interiors. They look great!

 

If you don't mind, a question just for my own curiosity, why are you using triggers to detect player presense? What benefit do they give for solving the 'player presense' problem compared to a scripted solution?

Share this post


Link to post
Share on other sites

@phronk love this script good sir, much needed for every mission now!

 

i did have a small problem in a mission that involved moving a scripted helo about: the last two lines of "PF\f\PF.sqf"

 

Quote

private _pad=(_b nearObjects["Land_HelipadEmpty_F",2])select 0;
if(!simulationEnabled _pad)then{{deleteVehicle _x}forEach attachedObjects _pad;deleteVehicle _pad;};}];

 

deletes all invisible heli pads near player, including any spawned by other scripts or placed in eden by the player.

 

i was going to add an array "LFkeepPads = ["pad1","pad2","pad3"];" and add a check against that to your script as extra condition before deleting

 

just thought i'd mention it!

Share this post


Link to post
Share on other sites

So this sounded like a really cool script but trying it out caused me not to use it. Because:

 

1.]Visiting a town's location in Malden and returning back without leaving the town made the placed furniture change. The shop used to have laptops and then the owner started selling plants :scratchchin:

2.]Seeing the shop from a distance meant no furniture. Coming in closer made furniture appear.

3.]Some furniture were floating out of buildings. Even the shop sometimes had the laptops stuck into walls along with the office desks.

4.]Vehicles that used to be in garages stopped being there once you returned back to their previous location.

 

Is this just me or are these known issues because reading the thread's posts didn't show any such issue to be known.

Hope this script does work eventually because you would really save editors a lot of time.

 

Mods used which might cause an issue: CBA, ASR AI3

All tests were made via the Eden editor. I was trying to implement it in a WIP mission of mine but no luck sadly.

 

 

 

Share this post


Link to post
Share on other sites

@Sparker The triggers are created on the server and are local to it -- they aren't global. I could use a scripted method, but this works well enough. I can also use inArea with it, which you can't do with a scripted method. I create markers on top of the triggers anyway (Mostly for debugging), but the triggers don't seem to harm anything. I heard that all triggers which loop (Repeatedly) run on a different thread and all run fine, whereas using tons of waitUntils starts to hinder the scheduling of scripts.

 

@lordfrith Yeah, it was only a matter of time until people figured that part out. I might work on setting variables for all the helipads, but I would like to keep this as smooth as possible. No variable checking means it'll run faster because it's not checking for additional stuff mid-process, but the downside is potential inconveniences like the one you mentioned. I'll add it to my list of stuff to look into, but no promises I'll actually add a fix or workaround.

 

@JohnKalo I'll answer each issue as they were brought up:

  1. Each house randomizes the furniture when the trigger is activated and the results are not cached, for performance reasons. I am working on a possible option to enable caching, though.
  2. This is a result of a recent optimization I added to the script; when the furniture is spawned, they are hidden globally. The furniture is revealed locally to players near the furniture and will not be rehidden once revealed. I will try to turn this into a toggleable feature.
  3. This is an Arma bug that BI needs to fix: setDir is not executing globally. The only way I can possibly fix this is if I remoteExec "setDir", but that'll be a lot slower than if BI just fixed it. It'll also be a little tedious to go back into every script and rewrite that part, which I might do, just to prove the point.
  4. This is part of answer #1.

 

Performance is the #1 thing people piss and moan about with Arma 3 and it's partially because of ambitious/excessive scripts in the missions/mods. It's important to know how to compromise and make sacrifices for smoother performance. My script is already ambitious enough and a bit excessive as is. But, I'll try to address the issues you brought up, unless they hinder performance too much.

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites

Download Link (Google Drive)

Download Link (Steam Workshop)
Download Link (Armaholic)

Version: 0.6

Size: 180 KB

 

ADDITIONS:

• Added: New furniture layout for Land_i_Addon_03_V1_F

• Added: New furniture layout for Land_Slum_House01_F

• Added: New furniture layout for Land_Slum_House02_F

• Added: New furniture layout for Land_Slum_House03_F

• Added: New furniture layout for Land_Shed_02_F

• Added: New furniture layout for Land_House_Big_01_F

• Added: New setting in 'CFG.sqf' to toggle "Optimization Mode"

• Added: Playable unit to player's group in demo mission for MP testing

 

ADJUSTMENTS:

• Tweaked: Invisible helipads on each building have a "PF" variable set on them

• Tweaked: Enabled simulation for invisible helipads on each building

 

FIXES:
• Fixed: Furniture wouldn't rotate on dedicated servers

• Fixed: Only 2 of the 7 supported Tanoa houses would actually spawn furniture

• Fixed: Invisible helipads not spawned by furniture script could get deleted

• Fixed: Sofa objects were mixed up in Land_i_House_Small_02_V1_F

• Fixed: Missing bucket object script error, in h1_4.sqf

• Fixed: Tanoa furniture script h1_1 incorrectly defined _H variable

• Fixed: Some floating furniture

 

OPTIMIZATIONS:

• Optimized: Reduced sleep delays to 0.2 seconds, down from 1 second

• Optimized: Removed _blanket variable which selectRandom'd array

 

 

 

KNOWN BUGS:

• Bug free!

__________________________________________________________________________


The feedback you guys have given is appreciated and more will come as a result of it, such as persistent furniture layouts.

 

Enjoy!

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

Nice one phronk!

This would also be nice as an addon for servers so every mission would be affected automaticly...

Just sayin, and no i wont do it...to old...but i would use it  ;)

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

×