Button condition suggestion

Discussion and feedback on Construct 2

Post » Wed Jan 21, 2015 7:39 am

It would be nice if the Button object had a "Compare Text" condition when creating events. I've found a work-around involving instance variables, but being able to directly say "If button text =X, then Y" would be very handy and significantly easier.
B
6
Posts: 10
Reputation: 272

Post » Wed Jan 21, 2015 8:50 am

Ashley always asks for examples as to why any requested feature might be useful or required. I wondered why you might need this ?
B
51
S
16
G
9
Posts: 1,098
Reputation: 11,252

Post » Wed Jan 21, 2015 9:11 am

I guess the context is that it's being used in front-end logic ; if that's the case, 'just use the UIDs to know which element (button, sprite, etc.) is being pressed.
Image
Game Producer & Independent Developer - http://raphaelgervaise.com
B
24
S
9
Posts: 240
Reputation: 2,238

Post » Wed Jan 21, 2015 7:36 pm

I currently have it setup so that the button's text is equal to a list's text from a different layout. I would like to have it so that I can have a simple condition set to something like 'When Button text = "One", on being clicked, spawn Monster_One' and 'When Button text ="Two", on being clicked, spawn Monster_Two". Monsters being sprites, in this instance.

I understand there are alternate way to do this, but they seem roundabout when having this option could streamline the process. I can provide a sample layout if needed, but I am not sure what degree of clarity it would provide.
B
6
Posts: 10
Reputation: 272

Post » Wed Jan 21, 2015 7:51 pm

You can give the button an instance variable (that can always be checked via condition) and always give it the same text as the button has. It's just one more action, problem solved ;)

Just sayin'
B
5
S
1
Posts: 33
Reputation: 462

Post » Thu Jan 22, 2015 1:11 am

That's exactly what I'm doing, actually. And making an A=B, B=C, so A=C scenario isn't horrible, by any means, but it just feels a little too round-about when there is an easier solution. Since the work around is pretty simple, I doubt anything will be done to remediate this very slight shortcoming, but I figured I'd point it out and hopefully better this already pretty great program.
B
6
Posts: 10
Reputation: 272


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests