Arma 3
Abandoned Roads (Simple Script)
88 Comments
Asaayu  [author] 30 Jan @ 7:11pm 
@ARMA&MEN
The map in the screenshot is Tanoa
ARMA&MEN 30 Jan @ 6:28pm 
map pleas :steambored:
Asaayu  [author] 12 May, 2023 @ 7:33pm 
@ZERO COOL
Thank you 😄
GOMERSGOOD 12 May, 2023 @ 9:31am 
_dir = selectRandom [25,-25];
_location = _x modelToWorld [_dir,0,0];
?
GOMERSGOOD 12 May, 2023 @ 9:30am 
Asaayu i love this script, used it for a while now, thank you for your immersive contribution.

i wanted to give you and anyone else that might want to use it, a line of code that moved the trash on the road just a BIT to the side, to allow AI and other players to see it but not hit each one.

the results move each trash item a bit to the left or right of the middle of the road

changed this>
_location = _x getRelPos [floor random 3,floor random _dir];
to this>
_location = _x modelToWorld [25,0,0];

im busy but i wanted to randomize it too with 25 or -25 so it will move it either left or right of the middle of the road.
ill upload what i come up with when i do
yousef 9 Sep, 2021 @ 10:29am 
@Asaayu

Appreciate it.
Asaayu  [author] 9 Sep, 2021 @ 7:10am 
@o
In the script change the "private _roads = [worldSize/2,worldSize/2] nearRoads worldSize;" line. that will change what roads are effected by the function.
yousef 9 Sep, 2021 @ 6:12am 
@Asaayu

Is it possible to make the wreckage and garbage spawn only within trigger area?
Asaayu  [author] 7 Jul, 2021 @ 3:26pm 
@sooz
You can increase the chance of a vehicle being spawned. That would increase the amount of wrecked vehicles.
yousef 5 Jul, 2021 @ 12:32pm 
Is there any way to increase the amount of wrecked vehicles on the roads?
Asaayu  [author] 20 Jun, 2021 @ 11:00pm 
@GilliganTrevor93
No, when you call the function just append your array of positions and ranges to the forth item in the function parameters.
GilliganTrevor93 18 Jun, 2021 @ 3:46pm 
hi quick question how would one use the blacklist area do we place marker and name it?
Asaayu  [author] 21 Apr, 2021 @ 10:17am 
@Ol'Yeller
That sounds good. Have a play around and you can see what the script does in more detail.
Gramps 19 Apr, 2021 @ 8:30pm 
Thank you so much, I got it figured out!
params [["_per1", 85], ["_per2", 45], ["_per3", 30], ["_blacklistArea",[]]];

private _roads = [];
{
_pos = _x select 0;
_range = _x select 1;
_roads append (_pos nearRoads _range);
} forEach
[
[[16823.0,12714.0],300.0],
[[3573.71,13094.53],350.0],
[[3826.85,13732.11],300.0],
[[8626.27,18282.36],200.0],
[[25669.43,21358.68],250.0]
];
pretty good results using coordinates only for default major spawn cities in exile mod!
I also edited "floor random 3" to "floor random 6 + 3" to provide more variation and less stuff dead center of the road! :)
Asaayu  [author] 19 Apr, 2021 @ 6:44am 
@Ol'Yeller
The position is an array.
You've got yours as just numbers.
They should look like this
[[16823.0, 12714.0, 0], 150.0]
Gramps 18 Apr, 2021 @ 11:52pm 
am I even close? lol
private _roads = [];
{
_roads append ((_x0) nearRoads (_x1));
} foreach
[
[16823.0 12714.0,150.0],
[1234.0 4321.0, 100.0]
];
Asaayu  [author] 18 Apr, 2021 @ 11:10am 
@Ol'Yeller
Like this,

private _roads = [];
{
_roads append ((_x#0) nearRoads (_x#1));
} foreach
[
[Pos #1, Distance #1],
[Pos #2, Distance #2]
];

Where Pos#X is the position array and Distance #X is the distance from that position in a circle.
Gramps 18 Apr, 2021 @ 12:58am 
ok, like so? private _roads = [16823.0,12714.0],[1234.0,4321.0] nearRoads 100.0;
or: private _roads = [16823.0,12714.0] nearRoads 100.0, [1234.0,4321.0] nearRoads 50.0;?
Asaayu  [author] 17 Apr, 2021 @ 11:22pm 
@Ol'Yeller
_roads is an array so you can append/pushback to it on the next lines with your other positions you want to add.
Gramps 17 Apr, 2021 @ 1:07pm 
Thanks! So if I wanted to add, say 3 cities. can I do like so? forEach _roads;forEach _roads2;forEach _roads3; All on the same line following that if statement, If BLArea isEqualTo []?
Asaayu  [author] 17 Apr, 2021 @ 4:14am 
@Ol'Yeller
Yes
Gramps 17 Apr, 2021 @ 1:15am 
ok so that would be something like private _roads = [posx, posy] nearRoads radius;?
Asaayu  [author] 16 Apr, 2021 @ 10:43pm 
@Ol'Yeller
What you can do is alter the script and change the
`private _roads = [worldSize/2,worldSize/2] nearRoads worldSize;`
line to the position and distance you want it to find roads
Gramps 16 Apr, 2021 @ 4:30pm 
This would be much cooler if it were in the towns/cities only, kinda strange driving out in the country and seeing a roadblock pop up in the middle of nowhere... XD
Reading below, a white-listing option seems it could accomplish this?
Basil 22 Feb, 2020 @ 8:38pm 
if you're looking for a result like in the screenshot keep looking, nothing like that
Zjajo 17 Jan, 2020 @ 9:31pm 
Having issues making blacklisted areas as other seem to be as well. I enter the position and range as explained in the git, but keep getting error for AbandonedRoads/init.sqf line 52, type Number, expected Array,Object. Are you able to explain why these coordinates/range are not working? Can't seem to message you on Steam like your git says to do for help.
CartoonrBOY 23 Sep, 2019 @ 5:11pm 
I'm sorry, but the "_blacklistArea" function is not working. In the code it says: ["_blacklistArea",[]]. There's no coma after the second to last ]. Entering positions: ["_blacklistArea",[500,500,0]5] gives an error. Adding the coma ["_blacklistArea",[500,500,0],15] gives the same error.

In the Github the script is not called using the params, they are inc with the script at the top: params [["_per1", 13], ["_per2", 5], ["_per3", 2], ["_blacklistArea",[]]];

Your comment below: "So in the example above change ( [10,10,0],15 ) to your center postion and radius around your position." does not work and includes missing ] and spelling mistakes (postion). I'm very confused?!?

It's a great script which I'd dearly love to get working as intended, but at present I have items spawning where I don't want them (within a Trader for eg).

Can you please explain how to get this working, properly?
Asaayu  [author] 12 Dec, 2018 @ 6:26am 
@n1Fish
Your mission file should look include these files
https://imgur.com/a/zhETBGG
Fish 12 Dec, 2018 @ 12:41am 
so what exactly do i put into my "mission sqm place" i just keep gettint a internet shortcut whenn i put it on my desktop and put it in the "mission sqm place" (i might be a idiot here) and which one of the files do i put there thanks
Asaayu  [author] 9 Dec, 2018 @ 5:53am 
@Baton
Following the example above the 3rd item in the array is another array with the center postion and radius of blacklisted areas.
So in the example above change ( [10,10,0],15 ) to your center postion and radius around your position.
Asaayu  [author] 9 Dec, 2018 @ 5:52am 
@JTS
Use the (count allMissionObjects "") command to count the number of objects with this turned off then turn it on and try again. If its detecting the roads then the postion might be spawning them below the ground.
JTS 9 Dec, 2018 @ 4:58am 
somehow this doesn't work on Chernarus. Maybe it's the fault of nearRoads command. But actually it returns the roads, so actually the roads are "roads" technically. Not sure what is the problem...
Baton 6 Dec, 2018 @ 9:01am 
Can somebody explain how to make restrict area for this script (I mean area where trash wont spawn)? Thanks.
Asaayu  [author] 1 Nov, 2018 @ 2:55am 
My new project has been released!
Arma 3 SwitchMove DLC
Go check it out!
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1551815726
Asaayu  [author] 21 Oct, 2018 @ 3:44pm 
@shephart
The idea for this script was from the picture.
I don't think its possible to replicate it with the script.

If you would like to try I would say [85,40,10]
The best way is just experimenting with the numbers.
shephart 21 Oct, 2018 @ 10:07am 
so what number do i have to write, to have the same result like in your picture?
Anfo 11 Oct, 2018 @ 3:22am 
@Asaayu All good, thanks for answering
Asaayu  [author] 11 Oct, 2018 @ 2:54am 
@Anfo
The script was originally made for mass placing, therefore, it only has a blacklist implemented rather than a whitelist.
As I'm working on another project I don't plan on adding a whitelist any time soon.
Anfo 8 Oct, 2018 @ 6:30pm 
I believe you're right, I think my % per road tile were maybe a bit high.

So because they are simple objects, this many spawns shouldn't have too much impact on Server FPS? Have you given any consideration towards creating markers where you want trash to exist rather than whole map?
Asaayu  [author] 8 Oct, 2018 @ 2:07am 
@Anfo
The number of objects depends on the size of the map and the percentages you have set.
Anfo 7 Oct, 2018 @ 11:50pm 
Is this normal?
asaayu's abandoned roads created 27714 simple objects in 18 seconds
Seems like a lot?
Asaayu  [author] 7 Oct, 2018 @ 8:52am 
@sentinel329
The script was originally created for a specific use in one of my missions therefore it only has a maximum distance of 3 meters from the center of the road. This was to stop spawned objects from colliding with objects that were placed beside the road.

If you want to change the distance edit the following lines in the init.sqf, 18, 26, 34.
Just change "floor random 3" to what you want.
getRelPos information [community.bistudio.com]
Ditch 6 Oct, 2018 @ 3:06pm 
@Asaayu: Thank you for the great script. For those interested, it is possible to customize the items spawned by modifying the init.sqf file in the Abandoned Roads folder. I've successfully created my own Iron Front version of this script and it works well. One minor suggestion I would like to mention is a way to randomize where objects spawn in relation to the road tile. Right now it seems they spawn in the center only; it would be more immersive if the position was randomized a bit more. Perhaps the script is already written this way and I'm just not seeing the effect?
YesYoa ™ 4 Oct, 2018 @ 5:55am 
oh.. :steamfacepalm::m9beretta: THX!!
Asaayu  [author] 3 Oct, 2018 @ 6:59pm 
@YesYoa
This is a demo mission, check your scenarios tab in the main menu.
YesYoa ™ 3 Oct, 2018 @ 9:10am 
Dude, is it possible that you drop a demo-test-mission for us? :) thx!!
Anfo 2 Oct, 2018 @ 4:44am 
All good :)
Asaayu  [author] 2 Oct, 2018 @ 4:22am 
@Anfo
I've been away the last couple of days, therefore, Github may not be as active as I have hoped.
If you are looking for a quick reply I usually have either steam open or get notifications on my phone.
Leaving it at either place will eventually get a reply.
Anfo 2 Oct, 2018 @ 3:35am 
Are the Github issues being monitored, otherwise I can leave feedback here?
Asaayu  [author] 30 Sep, 2018 @ 3:50pm 
@LondonsFinestSon
The idea for the script originally came from this thumbnail that I made for another mission.
So all the objects in the thumbnail were individually placed.