_Q_ Posted April 28, 2017 Share Posted April 28, 2017 Any way of finding entity by its name instead of using tags? Link to comment Share on other sites More sharing options...
Serpens Posted April 28, 2017 Share Posted April 28, 2017 I don't know such a way. But you can first search by tag and then sort them by prefab. So to get eg. rabbit you can first search for "animal" and then loop thorugh the results and check the prefab. Link to comment Share on other sites More sharing options...
Aquaterion Posted April 28, 2017 Share Posted April 28, 2017 if you mean names like pignames and what not, there might be a tag for entities with the named component. If there is, I think the tag would be "_named". Link to comment Share on other sites More sharing options...
_Q_ Posted April 28, 2017 Author Share Posted April 28, 2017 I search by tag and then need to compare the string provided as function argument with name of the prefab. Not sure if entity:GetBasicDisplayName() is the right fucntion, it will return the string name, i dont rember if there was something like prefab.name in there somwhere. Link to comment Share on other sites More sharing options...
Serpens Posted April 28, 2017 Share Posted April 28, 2017 24 minutes ago, _Q_ said: I search by tag and then need to compare the string provided as function argument with name of the prefab. Not sure if entity:GetBasicDisplayName() is the right fucntion, it will return the string name, i dont rember if there was something like prefab.name in there somwhere. what exactly do you want to find? Please give an example. Do you want to get the prefab? Or the string name? or the name like "steve" given from the "named" component ? You get the string name by: GLOBAL.STRINGS.NAMES[string.upper(prefab)] Link to comment Share on other sites More sharing options...
CarlZalph Posted April 28, 2017 Share Posted April 28, 2017 You question is quite vague as to what you're wanting. inst.name inst.prefab inst:GetBasicDisplayName() inst:GetDisplayName() TheSim:FindEntities only filters by tags, but during your iteration loop on it you can compare against these for further filtering. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now