Jump to content

Recommended Posts

Hi,

 

I would like to know, how to get information about building type - such as military, industrial, civilian etc.

 

I can read the building class (name) - but is there any function that returns what type it is? Or is it coded in building name?

_nBuilding = nearestBuilding player;
hint str typeOf _nBuilding;

 

thnx

Share this post


Link to post
Share on other sites

maybe the classname is part of a parent class which is categorized like u wish.
You can use the configbrowser in eden and search for the classname. Thenn in the bottem right u see all of the objects parent classes.

 

Share this post


Link to post
Share on other sites

Many thanks - thats it.

 

I am not just sure about proper syntax. Would it be:
_parentbuilding = [ str typeOf _nBuilding, true] call BIS_fnc_returnParents;
Many thanks

Edited by durobulo@gmail.com
syntax

Share this post


Link to post
Share on other sites

I think it should be:

[configfile >> "CfgVehicles" >> (typeOf _nBuilding), true] call BIS_fnc_returnParents;

Share this post


Link to post
Share on other sites

Yep its working.

Only problem is that the results for example military bunker on Malden are "house", "non strategic" "housebase" "building". :D

Share this post


Link to post
Share on other sites
_nBuilding = nearestBuilding player;
_cfg = configFile >> "CfgVehicles" >> typeOf _nBuilding;
_EdenCat = getText( _cfg >> "editorCategory" );
_EdenSubCat = getText( _cfg >> "editorSubcategory" );

if !( _EdenCat isEqualTo "" ) then {
	_EdenCat = getText( configFile >> "CfgEditorCategories" >> _EdenCat >> "displayName" );
};

if !( _EdenSubCat isEqualTo "" ) then {
	_EdenSubCat = getText( configFile >> "CfgEditorSubCategories" >> _EdenSubCat >> "displayName" );
};

hint format[ "%1 is in\n%2\n%3", typeOf _nBuilding, _EdenCat, _EdenSubCat ];

 

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, Larrow said:

_nBuilding = nearestBuilding player;
_cfg = configFile >> "CfgVehicles" >> typeOf _nBuilding;
_EdenCat = getText( _cfg >> "editorCategory" );
_EdenSubCat = getText( _cfg >> "editorSubcategory" );

if !( _EdenCat isEqualTo "" ) then {
	_EdenCat = getText( configFile >> "CfgEditorCategories" >> _EdenCat >> "displayName" );
};

if !( _EdenSubCat isEqualTo "" ) then {
	_EdenSubCat = getText( configFile >> "CfgEditorSubCategories" >> _EdenSubCat >> "displayName" );
};

hint format[ "%1 is in\n%2\n%3", typeOf _nBuilding, _EdenCat, _EdenSubCat ];

 

 

This is just PERFECT - many thanks to both of you.

19620127_851168491708741_245926445941173

Share this post


Link to post
Share on other sites

in comes Larrow with the super useful code snippet. as always :don16:

 

@Larrow is there anything you haven't tried yet? i always wonder what you are working on when i see your posts. is it some super elaborate game mode or are you just playing around?

Share this post


Link to post
Share on other sites

I do not know whet he is :D
but I am just working on some game mode (mission) inspired by battle royalle mod.

 

Amount of loot, circle size etc is balanced to amount of players playing.


But the loot spawn works differently - doesn't spawn in every object and can be really rare. Usually it takes 2km walk to get a weapon. It is common to loot system in Dayz SA.

VIP players can set the amount of loot in round from low, normal to high.


There are enemy NPC so you can play it as singleplayer as well. 

VIP players can double NPC volume or switch them off and play just versus other players.

 

Now players demande to spawn the loot according to building type - so I needed some help here.

 

Edit: also I am working on loot damage system, when hit in player means, some his loot will became ruined (unusable).

 

 

 

 

Share this post


Link to post
Share on other sites
9 minutes ago, bad benson said:

@Larrow is there anything you haven't tried yet?

Lots of stuff.

10 minutes ago, bad benson said:

i always wonder what you are working on when i see your posts. is it some super elaborate game mode or are you just playing around?

Both, plus some Eden tools and systems for other peoples projects ( although I have not done any for a little while ).

:shhh:Very experimental

 

  • Like 4

Share this post


Link to post
Share on other sites
5 minutes ago, Larrow said:

Lots of stuff.

Both, plus some Eden tools and systems for other peoples projects ( although I have not done any for a little while ).

:shhh:Very experimental

 

 

wait! the hint suggests it's inside arma? damn. nice work!

Share this post


Link to post
Share on other sites
On 7/1/2017 at 2:54 PM, Larrow said:

_nBuilding = nearestBuilding player;
_cfg = configFile >> "CfgVehicles" >> typeOf _nBuilding;
_EdenCat = getText( _cfg >> "editorCategory" );
_EdenSubCat = getText( _cfg >> "editorSubcategory" );

if !( _EdenCat isEqualTo "" ) then {
	_EdenCat = getText( configFile >> "CfgEditorCategories" >> _EdenCat >> "displayName" );
};

if !( _EdenSubCat isEqualTo "" ) then {
	_EdenSubCat = getText( configFile >> "CfgEditorSubCategories" >> _EdenSubCat >> "displayName" );
};

hint format[ "%1 is in\n%2\n%3", typeOf _nBuilding, _EdenCat, _EdenSubCat ];

 

 

At the risk of hurting the rules of this forum (necromancing this and that). I would like to take a moment to really appreciate @Larrow for being the absolute saint of Arma Coding.

Not saying there is not anyone else who does this much, but this man has helped so many people here take their stuff to the next level. 

 

Thank you Larrow, from the heart ❤️

  • Like 2

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

×