Jump to content
Sign in to follow this  
BullyBoii

arma 3 wildcard searching

Recommended Posts

My question is, if there is any way to make a wild card search in Arma 3. For example,

if a player has a name attached to it, e.g. b_man_1 (where b is desginated for blufor units only)

how do you create a trigger condition/search that will only add units with a name that has a b at

the front of it.

Also, is there a command that will allow you to do this...

i seem to remember a command similar to isLike being available

Any help is appreciated

Share this post


Link to post
Share on other sites

I don't believe that this is possible, but I may be wrong. The most common wildcard characters are '*' and '?' (e.g., b_man_*). I've never seen them used within Arma, so it's probably not coded in the engine. It would be nice, especially if commands were implemented to allow people to search for, create, modify and delete files.

Share this post


Link to post
Share on other sites

thanks i had thought about using that sort of technique but i didnt try it because i didnt see anything within the wiki stating it could be used, ill give it a try, thanks

Share this post


Link to post
Share on other sites

Your really going to want to move this sort of thing to a Game Logic using nearentities.

For example something like this in a gameLogic's init.

handle = this spawn {
while {true} do {
	_searchString = "b_";
	_radius = 10;

	_searchArray = toArray _searchString;
	_pos = getPosATL _this;
	_ents = _pos nearEntities ["MAN", _radius];
	if ((
		{
			_object = toArray (format ["%1",_x]);
			_i = -1;
			if (({ _i = _i + 1; _x == _object select _i } count _searchArray) == count _searchArray) then {
				true
			}else{
				false
			};

		} count _ents > 0
	)) then {
		//OnAct
		hint "in area";
	}else{
		//OnDeact
		hint "none in area";
	};
	sleep 1;
};
};

Will hint "in area" when ever a unit whose editor name starts b_ is in a radius of 10meters of the gamelogics location. Of course using a gamelogic means your not gonna be able to sync stuff to it etc, you will have to script things to happen on this gamelogic being true.

The above may give you some ideas or atleast show you how to compare a editorName against a string.

Share this post


Link to post
Share on other sites

Can anyone help? I'm looking for a way to have a tag check for profileName.

 

So idealy I need it to something like "[TAG]*wildcard*" then kick if on the wrong side ... But cant seem to work out how to implement the wildcard anywhere

Share this post


Link to post
Share on other sites

if a player has a name attached to it, e.g. b_man_1 (where b is desginated for blufor units only)

 

If you've already assigned names, then why not simply add those names/units to an array beforehand. Saves you a lot of trouble.

 

Oh, wait... profileNames ?

 

 

Then simply use the "find" command to analyze the string:

https://community.bistudio.com/wiki/find

 

Like this:

if (profileName find "[TAG]" > -1) then {
    // do something nasty
};

Share this post


Link to post
Share on other sites

 

If you've already assigned names, then why not simply add those names/units to an array beforehand. Saves you a lot of trouble.

 

Oh, wait... profileNames ?

 

 

Then simply use the "find" command to analyze the string:

https://community.bistudio.com/wiki/find

 

Like this:

if (profileName find "[TAG]" > -1) then {
    // do something nasty
};

Works perfectly, no option to kick I dont think so had to use a custom mission finish to get the player back to the lobby to either change side or change tags

Many thanks

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  

×