Jump to content
Sign in to follow this  
galzohar

Building pos max index?

Recommended Posts

I want to place a target in a random building in a random spot at the building, however different buildings have a different number of allowed conditions. After I pick a building, is there any way to check how many indexes are legal without making some stupid workarounds?

I'd hate to do it by checking each and every building, and I'd hate to do it by checking when it returns an invalid position, but I suppose if there's no better solution I'll have to do just that.

Share this post


Link to post
Share on other sites

He does it in the ugly way which is what I was trying to avoid :) but I suppose there's no real choice.

Share this post


Link to post
Share on other sites

I did it like this. Not perfect, but couldn't think of any other way since iirc the info isn't in the config.

Share this post


Link to post
Share on other sites

What's really annoying is that unless I'm doing something wrong, some buildings don't have any positions at all, and some have 0 as a non-viable position yet 1 is viable, while others have 0 as a viable position as well.

Share this post


Link to post
Share on other sites

yup, not all buildings have positions and some that do the position is simply standing outside.

Share this post


Link to post
Share on other sites

Is it just be or do some buildings have 0 as a non-viable index while other indexes (for the same building) are viable?

Share this post


Link to post
Share on other sites

When a specific index position in a building doesn't exist buildingPos will return a 0 pos array, means [0,0,0].

if (format ["%1",mybuilding buildingPos 20] == "[0,0,0]") then {
   // not a valid position
};

For example, the hotel in A1 had about 250 building positions but many of them weren't usable because they were in locked rooms.

Xeno

Share this post


Link to post
Share on other sites

I noticed there is a function for creating doors called BIS_ALICE_fnc_doorCreate. It places invisible doors on houses - probably other things too. You might be able to make empty houses useable. I've no idea how to use it though.

Share this post


Link to post
Share on other sites
I noticed there is a function for creating doors called BIS_ALICE_fnc_doorCreate. It places invisible doors on houses - probably other things too. You might be able to make empty houses useable. I've no idea how to use it though.

That's for AI to use, it doesn't create an actual door. :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×