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
2 respawned vehicles and 2 respawned boats keep respawning in the centre of the map #4
Comments
seems to be related to FindSafePos bugging out. but is not gamebreaking. it just looks wierd to see that pile of vehicles :) |
might just put a fence arround it.. /ghettofix |
fixed in next release. some vehicles will still spawn there but no longer respawn at the 'limbo' location |
thought it was fixed but it seems that vehicles are still placed in limbo (mountain between airfield/city) if the setpos command fails after spawn/respawn. When hosted locally the issie is resolved though.. I think ill just box out that area with some walls, since its only a few vehicles |
I know why BIS_fnc_findSafePos does that. I looked at the code in the functions help, and what it actually does is try 1000 different random positions within the specified radius, and if it doesn't find a satisfying location, it will just place the vehicle at the "map center" from the game config, which for Stratis is defined as in front of the airbase gunstore. I took the original code and modified it to fix this. It's in "server\functions\findSafePos.sqf" in my master. I raised the number of attempts to 10 000, and if no fitting position is found, it will try to find one by using "findEmptyPosition" on the base position. The 8th parameter of the function is the vehicle type, it is passed to "findEmptyPosition" so it can find a location that fits the size of the vehicle. If it can't find a good position again, it will use the base position itself. If the base position isn't valid for some reason, only THEN will it spawn it in front of the gunstore. Hopefully it should fix most issues with that function. For some reason, BIS originally coded it to search in a square pattern sized to the specified radius, but I changed it to a circle pattern, as it would be expected. |
if its caused by the BIS functions id rather just box it out, i did notice you copied and changed the findsafeposs funtion. but.. really thats not our job, i draw a line at the anticheat stuff since thats just needed.. i've got the old 3d editor to work, maybe ill just build a nice town on that hill :) |
I don't really understand what you mean by "that's not our job"... All the BIS_fnc_* scripts are simply helper functions that some BIS developers took the time to write so that people wouldn't have to re-invent the wheel. There's a reason why you can see and copy the source code in the editor, it's so that you can improve them if you need to. Those functions aren't part of the game core itself. Anyway, with BIS_fnc_findSafePos, the For vehicleCreation.sqf :
For boatCreation.sqf :
Besides, using the |
I thought of it as being a flaw in a BIS entitled function, and I never even noticed the fallback option in the wiki, thanks for pointing that one out to me. :) Maybe i just enjoy improvising too much ;) BTW: is there a reason youre going for 0 (minimal distance) rather then Random 25 ? :) |
Because as I said, the function tries 1000 attempts at different random positions inside the radius. When I first wrote random 25, I thought the function was starting from the center of the base position and moved out progressively to find a free spot. Many BIS_fnc_* functions aren't documented on the community wiki, only about 10 of them are on there, while hundreds of them exist. |
okay this results into errors in a BIS function. Error in expression <"_maxX", "_minY", "_maxY"]; Error in expression <_tl = _current select 0; private ["_minX", "maxX", "> private ["_minX", "maxX", "> Error in expression <"_maxX", "_minY", "_maxY"]; ill look into this after work so i can actually test the code :) |
oh, lol i was blacklisting the positions :) Parameter(s): :) sooo i gues it would become For vehicleCreation.sqf :
For boatCreation.sqf :
or should i add an empty array in the empty array? |
Oh, right. I saw "_this select 8" but I completely forgot that it started at 0. So, it's the 9th parameter. Corrected my comment with the examples. An empty array alone should do, because the blacklist checking function iterates through it in the following manner :
And "from 0 to -1" cancels the for loop. |
4-7 respawned vehicles and 2-4 respawned boats keep respawning in the centre of the map
The text was updated successfully, but these errors were encountered: