Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random Objects Spawning #1

Open
odst910 opened this issue Jul 23, 2017 · 2 comments
Open

Random Objects Spawning #1

odst910 opened this issue Jul 23, 2017 · 2 comments

Comments

@odst910
Copy link

odst910 commented Jul 23, 2017

I have a problem where random objects like H-Barriers and canal walls randomly spawn. They spawn on roads sometimes and its really annoying I can't seem to find out why.

@AlexGnatko
Copy link
Owner

Hi odst910!

As I'm not one of the authors of the A3W mission, I don't know exactly how objects spawning is done there.

So, I can only theorize. In ARMA, it's possible to find roads on the map. I used this functionality in another map (I guess I'll publish it now here on GitHub so that you could also take a look). I had a server script that found roads on the map around the center point of a location (within some radius) and placed random "parked" vehicles that were slightly offset from the axis of the road and oriented to the direction of the road or the opposite direction, so that it looked like the cars pulled over on the side of the road.

I guess that same mechanism can be implemented in whatever the script that spawns objects on the A3W map. When it decides where to place the object, it should make sure that there are no roads nearby and that it won't block the traffic. Or, on the contrary, if the spawned object is a vehicle, it's better to place it alongside a road than somewhere on the hill or in the bushes like it often happens in A3Wasteland.

@AlexGnatko
Copy link
Owner

Here it is:

https://github.com/AlexGnatko/WildIsland-Lijnhaven.Tanoa

In this file:

https://github.com/AlexGnatko/WildIsland-Lijnhaven.Tanoa/blob/master/utils.sqf

Function "Vehicle_Spawn_Params" returns the exact location and direction of the vehicle to spawn. On the map I placed a marker for roughly the location that I want the vehicle to spawn, and this function found the exact location on the side of the closest road.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants