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

Donation: Custom Building Position #1136

Closed
G3rrus opened this issue May 3, 2019 · 14 comments · Fixed by #1138
Closed

Donation: Custom Building Position #1136

G3rrus opened this issue May 3, 2019 · 14 comments · Fixed by #1138
Assignees
Labels
Milestone

Comments

@G3rrus
Copy link

G3rrus commented May 3, 2019

So I made this little custom building position, which is basically a small invisible object that can be placed down in the editor with one building position configured at its center.

-What does it do? It adds a small invisible disk object (much like a tiny invisible helipad) that has 1 building position at its center.

-How is this helpful? Well, it works together with scripts that utilize building positions. Its most obvious use would be extending the functionality of garrison and loot scripts. In those cases it would allow for additional building positions to be "added" to buildings that already have some preconfigured, or "adding" building positions to structures that don't have any (such as the bunker tower, used in the sample screenshots).

Sample Screenshots: (note that the disk is still visible in these screenshots as I hadn't configured the invisible texture at that point yet)

https://i.imgur.com/poaiquU.jpg
https://i.imgur.com/Sv51wP0.jpg

Source files can be found here:

https://github.com/G3rrus/Custom-Building-Position

@commy2
Copy link
Contributor

commy2 commented May 3, 2019

This is a clever idea.

Does it need the visible LODs for something or could that be made empty?

@G3rrus
Copy link
Author

G3rrus commented May 3, 2019

I honestly don't know, it might be possible to delete them but then that might have unintended consequences.

@commy2
Copy link
Contributor

commy2 commented May 3, 2019

Maybe it needs the LOD, but one could delete all vertices. I will mess around with it tomorrow.

@G3rrus
Copy link
Author

G3rrus commented May 3, 2019

That would be great, as I merely had the idea and did the config, while I asked a friend from my unit if he would be so kind as to provide me with the necessary .p3d

@commy2 commy2 added this to the 3.11.2 milestone May 4, 2019
@commy2 commy2 self-assigned this May 4, 2019
@commy2 commy2 added the Feature label May 4, 2019
@commy2
Copy link
Contributor

commy2 commented May 4, 2019

#1138

@commy2
Copy link
Contributor

commy2 commented May 4, 2019

Apparently the model is required for the object to snap to the surface of the bunker and terrain.

I replaced the empty texture with the Arma go to empty texture a3\weapons_F\data\clear_empty.paa.

@G3rrus
Copy link
Author

G3rrus commented May 4, 2019

Ah yes that makes sense, nice!

@10Dozen
Copy link
Contributor

10Dozen commented May 7, 2019

Sorry, if i didn't get the implementation of this feature right, but can we have some custom CBA's BIS_fnc_buildingPositions function that will return building positions and related custom building positions in single array? May be useful for scripts to spawn/garrison units and used for CBA's ai scripts (e.g. ai/fnc_searchNearby.sqf).

CBA's custom 'nearestBuilding' function will be usefull in this case too (to return only buildings, skipping custom positions).

@commy2
Copy link
Contributor

commy2 commented May 8, 2019

function that will return building positions and related custom building positions in single array?

What makes them related?

Think of these custom building positions to be "invisible micro buildings with a single AI building position at the center".

To return all custom building positions 200 meters around the player, you could use:

nearestObjects [player, ["CBA_BuildingPos"], 200] apply {_x buildingPos 0}

@10Dozen
Copy link
Contributor

10Dozen commented May 8, 2019

What makes them related?

Placed inside 'main' building bounding box / synced in editor.

IMHO, as a scripter i want to be able to treat house and custom positions as single entity (e.g. to spawn garrisoned units). Also i may not be aware of does mission have these invisible micro buildings or not (e.g. ai behaviour mod) - using functions will be also helpful to prevent unexpected behavior in this case (e.g. random selected mostly custom position in single building instead of few houses across the village).

@bux
Copy link
Contributor

bux commented May 8, 2019

use two functions and merge the results in one array ¯\(ツ)

@G3rrus
Copy link
Author

G3rrus commented May 8, 2019

I don't really see the problem with only the building position anyway. I mean most garrison scripts for example already have options if units should be garrisoned equally or building by building. In both cases I don't see how the custom building position would make distribution unequal by chance.

@commy2
Copy link
Contributor

commy2 commented May 8, 2019

@10Dozen
#1138 (comment)

@10Dozen
Copy link
Contributor

10Dozen commented May 9, 2019

@commy2
Thank you very much, sir!

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

Successfully merging a pull request may close this issue.

4 participants