[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
47
S
22
G
65
Posts: 1,127
Reputation: 38,395

Post » Sat Jul 16, 2016 4:10 am

Here is a 3rd party plugin for this purpose.
B
109
S
27
G
276
Posts: 4,479
Reputation: 154,418

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
47
S
22
G
65
Posts: 1,127
Reputation: 38,395

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
109
S
27
G
276
Posts: 4,479
Reputation: 154,418

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,721


Return to Construct 2 General

Who is online

Users browsing this forum: Google [Bot] and 7 guests