Dev poll: next feature to implement

Discussion and feedback on Construct 2

Post » Mon Mar 07, 2011 10:18 am

Meta charset is an HTML5 tag, and we can safely assume the user playing the game is on an HTML5 browser!
Image Image
Scirra Founder
B
125
S
37
G
25
Posts: 3,945
Reputation: 44,922

Post » Mon Mar 07, 2011 12:53 pm

Event groups are worth to implement !
Here is why !

When they are used accurately, they give you a very simple way to handle complex scenarii and state based actions, the most well know being in game menus !

In the page above, I show how use groups to handle motion and handle user typed commands ! (see the link)
B
18
S
4
G
6
Posts: 17
Reputation: 4,353

Post » Mon Mar 07, 2011 1:19 pm

[quote="programaths":1dhpvg1i]Event groups are worth to implement !
Here is why !

When they are used accurately, they give you a very simple way to handle complex scenarii and state based actions, the most well know being in game menus !

In the page above, I show how use groups to handle motion and handle user typed commands ! (see the link)[/quote:1dhpvg1i]

They are nice, but we can use instance variables for now.
Plus we have the boolean type which does speed things up a bit.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Mon Mar 07, 2011 2:21 pm

It appear to be a very, very quick answer...too quick !

What about this NPC (Non Playable Character) ?


He has 7 states, so 7 groups.

With boolean, the first few interactions have to be checked with :

[code=php:dwc5r2aw]
if
(not($shield)andnot($sword))
{
say("youshouldgrab...");
}
else
{
if($shield)
{
say("grabbsword");
}
else
{
if($sword)
{
say("grabbshield");
}
else
{
say("Doyouwantto...");
if($wantlearn)
{
....
}
}
}
}
[/code:dwc5r2aw]

Etc...A big pain in the ass, unless you use a "state" variable that you have to keep consistent between all events.

And this one is a trivial NPC because he doesn't offer quests that depends on others quests :)
Etc.
B
18
S
4
G
6
Posts: 17
Reputation: 4,353

Post » Mon Mar 07, 2011 3:05 pm

You can simulate groups with subevents (which I think newt was suggesting): put a bunch of events as subevents to an event which is something like "Is MyBoolean Enabled" (stored in some instance variable, because that's the only place you can store variables right now). To disable the group, set the boolean to false. It works with triggers, events, anything you can put in an ordinary event group.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Mar 07, 2011 3:42 pm

[quote="programaths":281v2fce]Event groups are worth to implement !
Here is why !

When they are used accurately, they give you a very simple way to handle complex scenarii and state based actions, the most well know being in game menus !

In the page above, I show how use groups to handle motion and handle user typed commands ! (see the link)[/quote:281v2fce]

I use groups in same way too.
B
30
S
15
G
10
Posts: 285
Reputation: 7,144

Post » Mon Mar 07, 2011 10:09 pm

Ok,now I picture it :)

But I find group more suitable, not for a technical point of view :p
B
18
S
4
G
6
Posts: 17
Reputation: 4,353

Post » Tue Mar 08, 2011 1:12 am

I agree wholeheartedly, but from form rather than function.
I like the fact you can hide all that code. :)
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Tue Mar 08, 2011 6:30 am

That could be done by folding sub-events into top-level event.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sat Mar 12, 2011 5:21 am

i am surprised that families don't have more votes.....
i have found that coding a project of any size is a major pain in the rear with out them
you need families for reusable code which is essential to medium to large projects.
behaviors can be easily be replicated with events (most of them anyway)
families cannot be replicated however.
not to mention you can use families to easily replicate the more complex behaviors as well as a lot of other features
besides families, we need animations!(for obvious reasons)
B
2
G
2
Posts: 11
Reputation: 672

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 11 guests