How do I use the text of an instance within a parameter?

Get help using Construct 2

Post » Mon Aug 14, 2017 6:39 am

Hi! :D Can anybody help me?
I need to use the text of an instance within a parameter.

I have an 'sprite' with an 'instance' called "inst" and with the text "example" placed on it.

I Need to call a function that has 'dictionary.Get("any text here")' but like 'dictionary.Get("Parameter(0)")' and the "any text here" or 'parameter' is the text of the 'image' 'instance'

but I can not seem to put the 'instance' as text, if i put 'dictionary.Get("Parameter(0)")' or 'dictionary.Get("sprite.inst")' the function will search 'Parameter(0)' or 'image.inst' like text form instead 'example", the text in the instance.

Anyone in good heart would have a solution to put an text of a instance in a parameter, like above?
B
6
S
2
G
1
Posts: 12
Reputation: 974

Post » Mon Aug 14, 2017 6:45 am

Try losing the quotation marks in the parameter brackets - eg dictionary.Get(sprite.inst)

Putting it in quotation marks will make it interpret that as a string :)
Image



Coming soon on Steam!
B
16
S
9
G
3
Posts: 209
Reputation: 3,476

Post » Mon Aug 14, 2017 7:47 am

mikehive wrote:Try losing the quotation marks in the parameter brackets - eg dictionary.Get(sprite.inst)

Putting it in quotation marks will make it interpret that as a string :)



:shock: a lot of thanks :D
I've been breaking my head for hours and I've researched and found nothing, I think I need to sleep :lol: :lol:
B
6
S
2
G
1
Posts: 12
Reputation: 974

Post » Mon Aug 14, 2017 11:57 am

Haha no worries, we've all done it ;)
Image



Coming soon on Steam!
B
16
S
9
G
3
Posts: 209
Reputation: 3,476


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests