help with a list of family and picking problems and hacks

New releases and general discussions.

Post » Mon Aug 17, 2009 8:34 pm

[quote="newt":10sz4cw5]Hmmm, how about stack object? [/quote:10sz4cw5]
eh...I don't know, it does alot more than stacks, and stack is a programmer's term
construct is supposed to be a tool especially made for nonprogrammers to be able to jump in and use
[quote:10sz4cw5]Oh wait will this even be an object? Cause it kinda needs to be built in. You know with the functionality of an object, as well as a behavior, kinda like families are.[/quote:10sz4cw5]
I can't build it in. I can only make plugins, but I'm not sure why it needs to be like a behavior, or how are families like behaviors?

you won't be able to use it like a family in the sense that there won't be an icon representing your custom families
however, I do plan to have collisions and comparisons, etc.
you would have to use the objects' conditions to test for collisions, as opposed to the sprites' collision tests, though
but it will amount to the same, and use the same collision testing techniques
as for object specific things, like sprite 20 having a behavior, or being a panel instead of a sprite, and you want to access those things, one of the main points of this plugin is to fill in any gaps with picking you would have
the picking system is awesome, but there are certain things that are difficult or impossible to do with picking right now, picking objects included in the plugin is going to be as comprehensive as possible. I am going to try to cover all the bases


[quote:10sz4cw5]
As to the double family hack take a look at this:
[url:10sz4cw5]http://dl.getdropbox.com/u/666516/stareater.cap[/url:10sz4cw5]
Taken from one of the compo's lol[/quote:10sz4cw5]
thank you, but can you just give me a sentence or two that describes why you'd need it
all this segmentation stuff is distracting me from the basic picking issue that makes the family hack necessary :)

[quote:10sz4cw5]
Also for the stack, how about placement as a percent?[/quote:10sz4cw5]
what do you mean?
like add object at 50%?
what happens if you have 10 objects and you tell it to place at 15%?
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Aug 17, 2009 8:57 pm

[quote:1llin47d]how are families like behaviors?[/quote:1llin47d]

In that you can add it to an object, or well vice versa.
But yeah guess you cant change the program.

As to the family hack I'll let someone else explain. As its a pretty new concept to me.

[quote:1llin47d]what do you mean?
like add object at 50%?
what happens if you have 10 objects and you tell it to place at 15%?[/quote:1llin47d]
Well if 10 is 100% of the stack, and 1 is 1% 15 would fall somewhere at the bottom. Yeah some interpolation would be required. An expression like get stack amount would be nice.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Mon Aug 17, 2009 9:43 pm

Family hack? The Stareater, is that my project? Well gee, guess I should explain the trick! :? :lol:

Well, it is not a hack per se, just bit of a clever solution. What you do is add two or more families, depends how complex your picking code gets.

With two families, let's name 'em A and B, you can pick from other family INDEPENDENTLY of the SOL of first family. You see, families have their own SOL, as do objects. That is three different selected object lists!

So, with more than one family, when you are working with already selected members of family A, you can select another bunch from family B without messing the selected members of A up.

If it is too confusing, let me illustrate it:

You have balls. Normal, ordinary round balls, not the furry kind. Add two families to these balls, name them Red and Blue. Even if balls actually are pink, but who cares.

So, you have a condition that, say, filters balls by their relative position. Balls on the left side of the table, for example. You make a condition, using the family Red:
+Red.X < LayoutWidth/2 (Assuming the table is the size of a layout)

Now, we want to also pick balls that are on lower half of the table. But wait, we can't do that, we've already selected balls and if we refine search any more, we won't be able to grab balls on lower right! Oh wait, we've got one more family to abuse. Phew.
+Blue.Y < LayoutHeight/2
Now we have two selected groups of balls, first group of balls that are on left side of the table and second group of balls that are on lower half of the table! Two selections, independent of each other! You can make operations with them, like count them, see how many balls are in either group, which side of the table is more populated etc.

Within the same event. That, friends, is the beauty of multiple families; they grant you access to extra SOLs (Selected Object List or something, it remembers objects that passed the condition). You can combine this into elaborate picking procedures! Oh, and don't forget: objects have their own SOL as well, so that is three ways to abuse! Whee!

And that's it from me.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Mon Aug 17, 2009 10:02 pm

[quote="newt":2tyktg9w] Yeah some interpolation would be required. An expression like get stack amount would be nice.[/quote:2tyktg9w]
definitely going to have "get size" stuff
also considering interpolating, but for other purposes, like
an action to Lerp Object positions between blank and blank
which would automatically lerp, qerp, or cubicly interpolate the positions of all the objects automatically making the first and last objects be in the correct positions

it would be a nice shortcut for a commonly done function

[quote="Mipey":2tyktg9w]...
Well, it is not a hack per se, just bit of a clever solution. What you do is add two or more families, depends how complex your picking code gets....And that's it from me.[/quote:2tyktg9w]
thanks for the explanation
and that's a perfect example
you could do something like this without using the family trick
I understand the family trick works perfectly well, but logically it doesn't correspond with the intended purpose, as in, reading the events doesn't make it immediately obvious what it's doing like it normally would
and being able to create these picking relationships on the fly would allow more power and flexibility

so you could do something like
if Sprite.x<100 place spriteA in group "LeftFam"
if Sprite.x<100 place spriteA in group "RightFam" if Sprite.x>100
if sprite('yodude') = "whatup" place spriteA in group "CoolGuy"
if spriteA in "CoolGuy" is overlapping spriteA in "LeftFam", do whatever

know what I mean?
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Aug 17, 2009 11:22 pm

[quote:h9i6lw3s]definitely going to have "get size" stuff
also considering interpolating, but for other purposes, like
an action to Lerp Object positions between blank and blank
which would automatically lerp, qerp, or cubicly interpolate the positions of all the objects automatically making the first and last objects be in the correct positions

it would be a nice shortcut for a commonly done function
[/quote:h9i6lw3s]

Thats what I need, a simple way to arrange multiple objects, like a snake, or a platoon in an rts.
Of course in the rts situation you wouldn't want the picking event to set position, just the ability to get the information and tell the objects where to go via the rts calls.
Like
repeat stacksize object.tank times
object.tank stack=loopindex
>rtsobject.tank move to rtsobject.tankstack(loopindex-1)

Or something like that, but the problem currently is picking from the actions side of the event.
[quote:h9i6lw3s]
Family hack? The Stareater, is that my project? Well gee, guess I should explain the trick! :? :lol: [/quote:h9i6lw3s]
Yeah Its fun to play with. :D
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Mon Aug 17, 2009 11:54 pm

@lucid What you are describing would be awesome and a very useful addition! Can't wait to see an early prototype!
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat Aug 29, 2009 9:07 pm

how is this coming along

if you can pull it off this may chance the way we use construct
B
2
S
2
G
4
Posts: 259
Reputation: 1,968

Post » Sat Aug 29, 2009 9:11 pm

it's not coming along yet manontherun
I'm working fulltime on my personal game project from now until I get the editor fully working
then I'm going to fix all the reported bugs for Custom Controls, and FontSprite
then I'll make this

it's not a matter of if it works to be honest though
it will work, I just need the time to program it
and I don't have it at the moment
but all the needed elements to make it work on in there in the sdk and construct itself
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Previous

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 9 guests