Jump to content
Vectif

Finding a building's classname

Recommended Posts

Hello! 

I been developing some sort of "Survival" gamemode with loot spawns and etc-etc; but I been also kind of been modifying maps and trying to add more maps so that there's variation. The issue I'm having is that my "loot" spawns on "positions" of different buildings - and some of the buildings I don't know how to get the name of (as they are custom or imported) and I need help figuring out the items (buildings) of a map or just a building I see around that I find interesting & fun to use.

I need to obtain the classnames & positions for these.
Thanks!

Share this post


Link to post
Share on other sites

More than classnames. Its the unique ID name which you should ask for. Click on ID in the editor.note down the number next to it and then a script may help you.

:)

Share this post


Link to post
Share on other sites

More than classnames. Its the unique ID name which you should ask for. Click on ID in the editor.note down the number next to it and then a script may help you.

:)

Nope, you don't need the ID - building classnames are enough to set up a loot spawn system (look at Na_Palm's script).

 

Anyway, this should be a good place to start :

TypeOf

NearestBuilding

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

so I'd basically want to do nearestBuilding in a trigger; and what about the BIS functions?
Also, I'm using a slightly modified version of Na_Palm's script :)

Share this post


Link to post
Share on other sites

@kyootlaerr:

Open the map in editor, place a playable unit, hit "preview".

Once ingame, type this in the debug console :

hint str(typeOf cursortarget); copyToClipboard str(typeOf cursortarget);

And execute whenever you are looking at a building.

After that you just need to paste the copied data into a text document.

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites

Alright thanks you very much!
I did some extra search and I also found another way of doing it:

https://forums.bistudio.com/topic/133691-find-editor-class-names-for-buildings-vehicles-on-existing-map/


To find a classname just make a Radio Trigger with this as the onAct:
player sideChat str (typeOf nearestBuilding position player)
 
You can get crazy and have it copyToClipboard if you wanted to.

Share this post


Link to post
Share on other sites

Note the ID's will be obsolete in a future release. Don't rely on ID's anymore. Other handy commands/functions:

 

 

Hey Whiztler - do you have any more info on this?  This is a huge change for certain mods like ALiVE that rely on map IDs for indexing.

Share this post


Link to post
Share on other sites

Hey Whiztler - do you have any more info on this?  This is a huge change for certain mods like ALiVE that rely on map IDs for indexing.

IDs won't disappear in the future, but BI recommends not to use them because they may change with map updates.

That's why they will not be visible in the 3DEN editor.

  • Like 1

Share this post


Link to post
Share on other sites
 

IDs won't disappear in the future, but BI recommends not to use them because they may change with map updates.

That's why they will not be visible in the 3DEN editor.

 

 

Ah I see thanks Greenfist.

Share this post


Link to post
Share on other sites

So I did found a work-around back then. But now I need something different again, as the previous techniques don't quite work in some occasions. In this situation in specific, I'm trying to find the building classnames for some buildings in a custom map, regardless of whether they may be from A2, A3, or custom. I've tried looking into map files, tried about three different script approachs but no results. Any suggestions or ideas?

It's been about a year but, yeah, still working with this kind of things with buildings and etcetera!
The Radio trigger doesn't work, and the cursorTarget on the debug doesn't either. It works in general, for most custom maps and official, but I wonder if this is a problem with the map's developer or the tool? Maybe an alternative way would work, but if not, it is very nice as it is so far!! Thanks for everything!

Cheers!
Thanks in advance.

Share this post


Link to post
Share on other sites

Execute 
 

onEachFrame {hintSilent str [typeOf cursorObject, cursorObject]};



this will give you classname and debug name of anything you point at

  • 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

×