How do I have different choices go to the same layout?

Get help using Construct 2

Post » Tue Jul 07, 2015 1:37 am

In the game I'm making I want the player to be able to choose different things (such as bullets to fire) and I was wondering if it was possible to have all choices lead to the same layout, but still have their choice to affect the game play. I was just going to have each choice lead to a duplicate of the same layout with the item they chose unless there is an easier way to do so. Anyone have an idea?
B
3
Posts: 7
Reputation: 189

Post » Tue Jul 07, 2015 1:39 am

You could have their choice affect a variable and then the events in the layout rely on that variable. For instance, if you press the left mouse button, the game checks the variable to see what weapon is equipped, then based on that it fires a different type of bullet.
B
11
S
2
G
1
Posts: 79
Reputation: 842

Post » Tue Jul 07, 2015 2:13 am

ThomasP wrote:You could have their choice affect a variable and then the events in the layout rely on that variable. For instance, if you press the left mouse button, the game checks the variable to see what weapon is equipped, then based on that it fires a different type of bullet.

I see what you're saying but how do you make the game check what the variable is?
B
3
Posts: 7
Reputation: 189

Post » Tue Jul 07, 2015 2:24 am

I have mine as sub-events.

Mouse -> On Left button Clicked

System -> [variable name] = 1 ..... here are events for that

Else
System -> [variable name] = 2 ..... here are events for that



Note, you do need the "Else" condition for the second sub-event and beyond. And to get to the variable name part, it's called Compare Variable after you select the System event.
B
11
S
2
G
1
Posts: 79
Reputation: 842

Post » Tue Jul 07, 2015 2:31 am

ThomasP wrote:I have mine as sub-events.

Mouse -> On Left button Clicked

System -> [variable name] = 1 ..... here are events for that

Else
System -> [variable name] = 2 ..... here are events for that



Note, you do need the "Else" condition for the second sub-event and beyond. And to get to the variable name part, it's called Compare Variable after you select the System event.

Oh I didn't know about sub-events. Thanks for the help!
B
3
Posts: 7
Reputation: 189


Return to How do I....?

Who is online

Users browsing this forum: GrogIsGood, koops and 3 guests