Sound Event Sheet practice?

For questions about using Classic.

Post » Fri Oct 08, 2010 8:07 pm

Say you have a platform game and you want to add the ability to climb walls if you pick up a certain object... Is it sound to do "If Player('HasClimbingShoes') = 1 then include Even Sheet "Player Climbing" (don't know the pseudo code standard around here, hope you get it)?

... Or should I just include those checks in the actually Events? If so, how many Conditions can you have on events? Does it matter if you have 15 conditions?

I have a tendancy to think that stacking of the conditions matters, so if you have the least resource heavy condition first (say, is key pressed?) it will not go through the other 15 conditions?

Thanks for your time :)
~Julmust (Swedish Christmas Beverage)
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Fri Oct 08, 2010 9:30 pm

You can't include an event sheet as an action, either the sheet is included or it's not.

But you can activate/deactivate event groups in an event sheet that has all of your player controls. Make your Climbing group deactivated by default and just activate it when the player picks up the shoes.

[quote="Julmust":3696d3sc]I have a tendancy to think that stacking of the conditions matters, so if you have the least resource heavy condition first (say, is key pressed?) it will not go through the other 15 conditions?[/quote:3696d3sc]

That is correct.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Oct 09, 2010 3:26 am

It's weird that event sheets are always included, but you can place them as subevents. This confused me.

Then I realized it was being included always, even if the subevent wasn't firing. So I moved all of that code into a function object and call that function with the condition I wanted. I made the function object global so I can reference it from the event sheet and call it from wherever I want.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sat Oct 09, 2010 11:38 pm

Just out of curiosity, madster - did you benchmark these changes? And did it make any different to performance?
B
2
S
2
G
3
Posts: 105
Reputation: 1,510

Post » Sun Oct 10, 2010 11:05 am

[quote="deadeye":1ztt04h7]You can't include an event sheet as an action, either the sheet is included or it's not.

But you can activate/deactivate event groups in an event sheet that has all of your player controls. Make your Climbing group deactivated by default and just activate it when the player picks up the shoes.

[quote="Julmust":1ztt04h7]I have a tendancy to think that stacking of the conditions matters, so if you have the least resource heavy condition first (say, is key pressed?) it will not go through the other 15 conditions?[/quote:1ztt04h7]

That is correct.[/quote:1ztt04h7]

Thanks, that worked like a charm and is probably the right way of doing it :)
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Sun Oct 10, 2010 7:42 pm

[quote="GMG":1yb0zy0t]Just out of curiosity, madster - did you benchmark these changes? And did it make any different to performance?[/quote:1yb0zy0t]
I didn't, but it shouldn't make any noticeable difference, since it's still one call per tick.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests