Multiple Keystroke Events

Just started using Construct 2? Post your questions here

Post » Sun Aug 10, 2014 12:38 am

Like I said, You don't need it.

Wait 0 will actually delay the following actions until the end of the event sheet.


One note. You should consider making inventory on separate layer. This way you can only toggle visibility of that layer instead of all needed objects.
And then you can do something like this

If layer "inventory" is visible - do stuff in inventory
Else - don't

That way you can interact with all inventory elements only if this layer is visible,
You do not have the required permissions to view the files attached to this post.
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 35,968

Post » Sun Aug 10, 2014 12:42 am

Update:

Got it to work now with just a single event.
Maybe it was a caching issue on the browser...
B
40
S
8
G
3
Posts: 159
Reputation: 3,019

Post » Sun Aug 10, 2014 12:43 am

Everade wrote:I don't know but... in a lot instances it feels like Construct 2 has a lot of bugs.
I don't really like to implement such "workarounds" just to make it work.

My game is becoming pretty big, and i'm worried about performance issues if i have to implement such messy events.


Nope, there's not a lot of bugs... maybe few but not a lot ;)
C2 is quite easy but you need to know how stuff works, but that needs time.

Are you aiming for desktop? or mobiles?
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 35,968

Post » Sun Aug 10, 2014 12:47 am

Thanks a lot for the help guys!

I didn't think to make it work with the whole layer!
I will try that out by tomorrow.

However i'm not using the drag & drop feature.
I've used the system written by Yann https://www.scirra.com/forum/need-help-with-something_t65732?start=20

I think i've learned already more than i've ever expected when posting this thread ^^


I'm aiming for PC right now
B
40
S
8
G
3
Posts: 159
Reputation: 3,019

Post » Sun Aug 10, 2014 12:52 am

I used drag and drop because it was faster. But you can easily modify this to your needs.

If it's for PC then yeah, You can use whole layer. Or create and destroy all inventory elements instead of hiding them. It's up to you.
You can do crazy stuff on PC, but remember if you ever feel about moving it to mobile you will need to consider some limitations.
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 35,968

Post » Sun Aug 10, 2014 12:55 am

the only issue i've noticed that... even if i turn the whole layer invisible.

The Mouse-Over the items still works.
But i guess i can find a solution for that.
The inventory system from Yann isn't the easiest for a beginner....

Still found no way to actually add an item to the inventory upon pickup for example xD
Or how to actually equip something.

But that will require some more research from my side.
B
40
S
8
G
3
Posts: 159
Reputation: 3,019

Post » Sun Aug 10, 2014 1:09 am

Yes, even if layer is invisible objects on it can still interact.
I've been always dealing with that using one global variable "Inventory" and placing everything related in sub-event. Like on the image
You do not have the required permissions to view the files attached to this post.
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 35,968

Post » Sun Aug 10, 2014 1:16 am

Yea but my game will feature multiplayer as well.
So i guess i can't use global variables, can i?

Or would global variables also work, due the fact that the global variables are NOT synced unless i tell them to sync them?
I'm not sure about that.

Till now i've always used object based variables if i wanted to make them work for multiplayer peers.



But your function calls look interesting.
B
40
S
8
G
3
Posts: 159
Reputation: 3,019

Post » Sun Aug 10, 2014 1:21 am

Can't get multiplayer to work on my network so never bother to sink in to that, yet.

As of functions... yeah Functions are your best friend.
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 35,968

Post » Mon Aug 11, 2014 4:21 pm

Just to add a little clarity, I believe the reason the wait is needed is because the way C2 works, all events are played once a tick, in the order they appear in the event sheet. The top event sets the inventory to visible, but for this tick 'I' is still being held down, so it triggers the next event down. The wait0 command means the inventory state is not changed until the end of the tick. I think I have that right, please correct me if im wrong.

Hope this helps your understanding and if not I can expand further.
Intermediate level Construct 2 developer, looking to build up my portfolio : https://seriouslycrunchy.itch.io/

Current projects : Bite Sized Game Development, please have a look at my tutorials and comment!

I also write for http://moonbooks.net/, please come and check us out!

Follow me on twitter! @SrslyCrunchy I'm always looking for games or templates to highlight, use the hashtag #madeinconstruct !
B
15
S
7
Posts: 52
Reputation: 3,126

PreviousNext

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest