Jump to content
Sign in to follow this  
thy_

How to identify land-vehicles when they approach a classname object?

Recommended Posts

How can I identify only land vehicles when they approach specific class names from an array?

I wouldn't like to use given ID names to identify objects as "obj01", but use the object class name as "Land_RepairDepot_01_civ_F". 

My idea is just to drag and drop in Eden Editor that kind of object and the script does what it must do. 

 

I'm reading about these things but I need some kickoff help from you guys. 

 

typeOf - https://community.bistudio.com/wiki/typeOf  

isKindOf - https://community.bistudio.com/wiki/isKindOf

BIS_fnc_objectType - https://community.bistudio.com/wiki/BIS_fnc_objectType 

 

I've found this relationship somewhere:

"CfgVehicles"
   "All"
      "AllVehicles"
         "Land"
            "LandVehicle"
               "Car"
                  "Car_F"
                     "Wheeled_APC_F"

 

Share this post


Link to post
Share on other sites

I'm no scripter but browsing the links you provided I also stumbled across inheritsFrom which may somehow serve your purpose.

Scratch the above, I don't think it would help you.

Share this post


Link to post
Share on other sites

Yeah, I keep reading and trying to turn my programming limitations hehe.. so the question is How can I populate my _arrayStations with only those objects in _arrayStationClasses dropped in Eden Editor?

 

_arrayStationClasses = ["Land_RepairDepot_01_civ_F","Land_RepairDepot_01_green_F","Land_RepairDepot_01_tan_F"]; //classes array

_arrayStations = [];

{
	_arrayStations = _arrayStations + //HOW CAN I POPULATE MY _arrayStations WITH ONLY THOSE OBJECTS IN _arrayStationClasses DROPPED IN EDEN EDITOR?

} forEach _arrayStationClasses;

 

 

Share this post


Link to post
Share on other sites
3 hours ago, thy_ said:

How can I populate my _arrayStations with only those objects in _arrayStationClasses dropped in Eden Editor?

 

I got it with https://community.bistudio.com/wiki/allMissionObjects

So...

_arrayStationClasses = ["Land_RepairDepot_01_civ_F","Land_RepairDepot_01_green_F","Land_RepairDepot_01_tan_F"]; //classes array

_arrayStations = []; // lets populate it!

{
	// lets find out only the objects of classnames listed in _arrayStationClasses throught the allMissionsObjects array. 
	_arrayStations = _arrayStations + allMissionObjects _x;

} forEach _arrayStationClasses; //repeat the search for each classename into the _arrayStationClasses.

While {true} do
{
	{
    	if ((player distance _x) < 10) then // if the player get close to any repair station with its classname listed above, so...
    	{
    		hint "Yeah, I'm in a station!"
    	};
    
    } forEach _arrayStations; 
	
	sleep 2;
};

Share this post


Link to post
Share on other sites

Here I am back!

Finally, I have finished the idea and built it as an applicable script for everyone:

 

 

There, you will get how I am identifying kinds of objects automatically, with no code on Eden Editor, even triggers. 

Hope it might help someone.

  • Like 1

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  

×