[request] create object by string

Discussion and feedback on Construct 2

Post » Sat Jul 16, 2016 2:13 am

Would be nice to create objects via a string that corresponds to their object name. That way we could use an instance variable that stores the name of an object to determine which object to create without having to create a bunch of conditions to check, etc..
B
43
S
19
G
65
Posts: 1,104
Reputation: 37,945

Post » Sat Jul 16, 2016 4:10 am

Here is a 3rd party plugin for this purpose.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Mon Jul 18, 2016 8:47 pm

thanks @rexrainbow , do you have any plugins/behaviors that allow accessing instance variables via a string? example: sprite("variable")
B
43
S
19
G
65
Posts: 1,104
Reputation: 37,945

Post » Mon Jul 18, 2016 11:30 pm

@Prominent

No. But I have another behavior which can access a private JSON data.
Sprite.Hash("variable")
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Tue Jul 19, 2016 7:32 am

Prominent wrote:thanks @rexrainbow , do you have any plugins/behaviors that allow accessing instance variables via a string? example: sprite("variable")


Is this what you're looking for?
Image
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests