Multiple Keystroke Events

Just started using Construct 2? Post your questions here

Post » Tue Aug 12, 2014 11:41 am

I'd recommend if possible putting all events pertaining to the inventory in a group and enabling/disabling this group along with the visibility..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Aug 12, 2014 11:52 am

Yes, that's a very good suggestion, (so obvious that I forgot to mention that).

This will simply make sure when Inventory is not visible to not run any actions related to it. Events under disabled groups are omitted by engine, which lead to better performance if you have a lot of events.

Also you can split your project to different event sheets and include them only when they are needed.
ImageImageImageImage
B
157
S
64
G
41
Posts: 2,592
Reputation: 34,644

Post » Tue Aug 12, 2014 8:26 pm

So like
if keystroke "i" pressed, activate group ~ wait 0.1 -> so it will run the events

and if keystroke "i" pressed again simply deactivate the group and it will vanish?


But i wonder... if the whole group is deactivated, won't that destroy all instances of my inventory so the next time i open it all items will be resetted?

But that sounds like a great solution for me if i want to reach better performance.
B
39
S
8
G
3
Posts: 158
Reputation: 2,995

Post » Tue Aug 12, 2014 8:36 pm

I guess you have your inventory set up either with variables or an array or something like that, so that wouldn't be an issue..
And even if you haven't you shouldn't have to destroy anything, for you can just set the layer invisible and all actions (like button-push) disabled through the grouping, so actually nothing changes on the inventory layer..

and the wait action shouldn't be necessary either in my opinion..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Previous

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests