Get object name

For questions about using Classic.

Post » Mon Jan 24, 2011 9:41 pm

Is there not a way to get an object's name? If there is I'm having a hell of a time finding it :?
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Jan 25, 2011 12:27 am

There's the id and uid, but that wont really help with picking.
What you can do is compare it to something you already know, size, private variable, position, etc.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue Jan 25, 2011 12:52 am

I need to store object names for later use in my level editor, then use 'create by object name' - a feature that seems pretty useless unless you can retrieve an object's name :T

I guess I can store object names in private variables, but I mean..really?

ASHLEY!!! Please consider adding 'get object name' :mrgreen:
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Jan 25, 2011 4:25 am

you should be able to create an object based on its ID if I recall correctly. Save that out with your level editor and then use that ID to create the objects you need. If your Level editor is integrated in with the same cap file that will be fine but if not then what you could do is have the name stored in a pv and then save that out and use that to create the object. Ive actually had this problem many times and I wrote a plugin for the purpose of easily creating objects i dont remember what happened to it though, and it may not work anymore with newer versions of construct.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Tue Jan 25, 2011 11:31 am

[quote="Tokinsom":18lpujrr]ASHLEY!!! Please consider adding 'get object name' :mrgreen:[/quote:18lpujrr]

Not exactly a new request. And seeing that it hasn't been added yet, I wouldn't hold my breath.

[quote="Tokinsom":18lpujrr]I need to store object names for later use in my level editor, then use 'create by object name' - a feature that seems pretty useless unless you can retrieve an object's name :T [/quote:18lpujrr]

It's still very useful. Think about naming conventions and things alike.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Tue Jan 25, 2011 11:59 am

[quote="PixelRebirth":1ahhmeep]Not exactly a new request. And seeing that it hasn't been added yet, I wouldn't hold my breath.[/quote:1ahhmeep]

I'm baffled. 'Get object name' should have been one of the first actions ever added to Construct, don't you think?

Sigh. I'll stick with values then.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Jan 25, 2011 1:43 pm

Its a long shot, but you could try a family, and a private variable.
Both are presumably broken for this kind of thing, but who knows maybe 2 wrongs can make a right.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue Jan 25, 2011 1:46 pm

In this case, 2 wrongs make a disaster. You have been warned!

Why not use a private variable to contain the name and a hashtable to track them?
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Jan 25, 2011 1:54 pm

[quote="Mipey":15l1td2w]In this case, 2 wrongs make a disaster. You have been warned!

Why not use a private variable to contain the name and a hashtable to track them?[/quote:15l1td2w]

This is pretty much what I'll be doing. I was just hoping there was a 'get object name' so I didn't have to spend so much time making new PVs for each one. Oh well, it won't take too long :P
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Jan 25, 2011 3:51 pm

Object name... Well, you can get OID and just use a string name as an alias for your convenience?

As for instance names, same thing with UID.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 10 guests