-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from gruppe-adler/fix-spawn-posis
Fix spawn posis, and refactor a bunch of other stuff
- Loading branch information
Showing
28 changed files
with
620 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "..\..\component.hpp" | ||
|
||
GRAD_CIVS_EXCLUSION_ZONES = []; | ||
|
||
INFO("all exclusion zones removed"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GRAD_CIVS_EXCLUSION_ZONES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// 1: position position or object - if object, position of object is used | ||
// 2: radius number or array - if array, random radius between first and second element is used | ||
// 3: count number > 1, or array - amount of waypoints to generate, if array, random amount between first and second element is used | ||
|
||
#include "..\..\component.hpp" | ||
|
||
params [ | ||
["_position", [0, 0, 0]], | ||
["_radius", 0], | ||
["_maxTries", 10], | ||
["_findPosOfInterest",false], | ||
["_findRoadPos",false], | ||
["_findWaterPos",false] | ||
]; | ||
|
||
private _waypointPosition = []; | ||
|
||
//create waypoints | ||
|
||
for "_i" from 1 to _maxTries do { | ||
LOG_1("trying to create wp, pass #%1 ", _i); | ||
|
||
private _searchPosition = [ | ||
_position, | ||
[_radius / 2 ,_radius], | ||
[0,360], | ||
nil, | ||
_findWaterPos, | ||
_findRoadPos | ||
] call FUNC(findRandomPos); | ||
|
||
_searchPosition = if (_findPosOfInterest && {80 > random 100}) then { | ||
[_searchPosition, false] call FUNC(findPositionOfInterest); | ||
} else { | ||
_searchPosition | ||
}; | ||
|
||
private _inAnyExclusionZone = [GRAD_CIVS_EXCLUSION_ZONES, {_searchPosition inArea (_this#0)}] call FUNC(arrayContains); | ||
if (!_inAnyExclusionZone) exitWith { | ||
LOG_1("position %1 is not in exclusionzone, return it", _searchPosition); | ||
_waypointPosition = _searchPosition; | ||
}; | ||
LOG_1("not creating WP at %1", _searchPosition); | ||
}; | ||
|
||
_waypointPosition |
Oops, something went wrong.