[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
51
S
24
G
70
Posts: 1,196
Reputation: 41,370

Post » Sat Jul 16, 2016 4:10 am

Here is a 3rd party plugin for this purpose.
Goodbye
B
114
S
31
G
295
Posts: 4,549
Reputation: 164,608

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
51
S
24
G
70
Posts: 1,196
Reputation: 41,370

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")
Goodbye
B
114
S
31
G
295
Posts: 4,549
Reputation: 164,608

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
141
S
34
G
17
Posts: 1,561
Reputation: 21,065


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests