help with a list of family and picking problems and hacks

New releases and general discussions.

Post » Mon Aug 17, 2009 3:12 pm

please post any issues you've had where either you had no way to pick something the way you wanted to, or where you needed to use the object/family hack or the double family hack. this can include situations where the solution included creating a new private variable just for the sake of helping you pick, where the private variable served no other purpose.

when i've made a reasonable amount of headway on my game project, and updated custom controls, i will be making a new multipurpose plugin.
so this is also the place to post suggestions

im on break at work, so ill try to explain briefly.
first, wherever i say arrays, that means arrays, stacks or queues.
it will provide:(if it all works out)
strings and numbers(separate from private and global variables, this will make sense in a minute)

a way to create arrays of objects, that can be picked by index.

and create families and containers which contain any combination of objects strings, numbers, arrays, and other families

objects in arrays can be accessed by index, or by traditional picking means of course...anywho:
EDIT: what I had here before very confusing, so I will post my more rational example from later in this thread:
[quote:2jymb8fn]the idea of the family and the arrays are separate

you can add several things to a family, and they aren't thought of in any particular order
they are just together
like a regular family or container

you can also have an array
this is ordered, you can add stuff to the top or bottom, remove stuff from the top or bottom
you will probably be able to do this to the middle as well, but I need to test the efficiency

you can put arrays inside families, and you can have arrays of families

you could create a family called 'item'
[item]
sprite object of item
string object's name
number for the repair level of the object

you can access it all as if it were one thing, the commands will be different than with private variables, but you will be able to access the name as if it were part of the item
if item sprite collides blah blah blah
and item name is "sword"
-1 from item repair level

you could make an array of 'item's called 'inventory'
and then access them by 'name' inside 'item'
by an index in the array
and you can pop or push them to the bottom or top of a stack

then you can make another family called 'character'
[character]
string for name
number for hit points
inventory (the array of items)

then you can create an array of 'characters' called 'party'


as I said before, you'd be able to create a random group of objects and put together families randomly for one time use
like remembering a group of objects a character encountered,
or a list of coordinates

but this is an example of how it could be used more powerfully through organization
and solidly defined containers [/quote:2jymb8fn]

using the stacks and queues are like arrays that you only about the top or bottom of
a queue is like a line at a grocery store
the person who got there first, will leave first, and they are gone, no longer part of the line

a stack is like a stack of books, the book you placed last on top, is the first one you will remove, then no longer part of the stack

I'd like to make this fully flexible, where all arrays can be used as stacks, queues, or arrays at any time, and you don't need to think about the terminology, just add, or remove, or get, or pick from front or back.

but examples of uses can be:
having an AI character go to one location at a time, or attack one character at a time, and move on to the next when the last one is done,

have a list of functions (Strings), and then call the functions in the order they were received, if a new high priority function comes along, it can be added to the bottom of the array (used as a queue). when a function is done, it is removed, and with no loops or commands, the next function is ready to be called with no separate command to do so.

a third use would be a multiple targeting system, where pressing a key locks on to the next thing
this is already possible, but could be much simpler with something like this

remember also, that this isn't just for stable organized objects
you can create a random list of random objects to save in a group to remember at any time for later use

the idea here is to fill in any remaining gaps that the normal family/container/pairer/picking built into construct can't do, or could be easier. combined with the stuff that's already there
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Aug 17, 2009 4:15 pm

I don't really get what you are describing, but I am all for a simple, quick and lightweight data container (stack, queue, whatever). Hashtable is a bit unwieldy, array is like trying to use a cauldron to fry eggs etc.

Basically, what I am looking for is a linked list object or something, that can accept numbers or strings, it would have the following features:
- sorting (automatic, manual, on request, disabled)
- dynamic (add, remove, replace elements without hassle)
- stack (LIFO - last in, first out container, the most recently added object is the first to come out, has uses such as undo feature)
- queue (FIFO - first in, first out container, the first object is first to go, essential for stuff like queued commands etc.)
- indexing - by native index (number) or by name (named list, much like hashtable but allow capital letters)

Think it'd make sense to create a custom data object, which you'd be able to customize to meet your ends - simple list, stack, queue or more complex named fixed list. This could shift focus from private variables to personal data objects, give more freedom. But this is too much already...

A simple stack, queue and list will do. :)
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Mon Aug 17, 2009 4:24 pm

basically everything you described is what i was trying to describe, but without saying lifo and fifo,
i was giving situations is can be used in, but yes, the plugin would focus on giving you as much control as possible over the creation and management of customizable containers, with the ability to index by any member, one of which could be a name string, or by actual numerical index.
i would prefer to have it be flexible, so you can use fifo,lifo, or regular array and chyange at any time
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Aug 17, 2009 5:23 pm

That would be awesome! It would be ideal to also have a pairer plugin, well, a simpler one than Object Pairer. ;) Imagine if you could link sprites and data containers like that into a relationship, organizing a parent-child hierarchy!

I've been trying to post a feature request for it, but then I realized that it may be more difficult than I thought. Perhaps this linker object should be limited to unique instances. I'd love to be able to access children directly and manipulate them without having to use elaborate conditions and subevents that likely mess SOL up. Like containers, but flexible. You get the idea. Problem is, Construct doesn't really like roundabout ways of object references.

Oh well. A flexible data container would be a great feature indeed! :)
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Mon Aug 17, 2009 5:33 pm

So, you are creating some kind of customisable "struct", like in C? (or object in c++) So that the members of the structure can be other data types or objects of construct?
B
3
S
2
G
5
Posts: 263
Reputation: 2,201

Post » Mon Aug 17, 2009 6:24 pm

[quote="Drasa":1xzmkozv]So, you are creating some kind of customisable "struct", like in C? (or object in c++) So that the members of the structure can be other data types or objects of construct?[/quote:1xzmkozv]
exactly
also adding arrays of objects
and the ability(like structs)
to use these containers to hold other containers
[quote="Mipey":1xzmkozv]That would be awesome! It would be ideal to also have a pairer plugin, well, a simpler one than Object Pairer. ;) Imagine if you could link sprites and data containers like that into a relationship, organizing a parent-child hierarchy!
[/quote:1xzmkozv]
yeah thats the idea too
something very simple
like 'remember' picked "charsprite"s in "mymem"
'remember' "20" as "bullets left" in "mymem"

and then later - 'recall' "mymem"
and 'forget' "mymem"

a completely flexible object pairer
with backward lookup ability
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Aug 17, 2009 6:44 pm

Basically something like a family without a families restrictions(different objects types, etc.), with added functionality of adding to the family on the fly, and a customizable hierarchy within the family, IE when I create this object and add it to the family it will be added to the last(or first) of the list.
So I can do something like this:
sprite on collision with sprite2
>sprite2 create sprite3
>add sprite3 to family.blue.last

family.blue.new
>add to family.blue.stack
>set position to family.blue.last

I wonder what kind of controls you can have for the stack tho.....
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Mon Aug 17, 2009 7:22 pm

kinda
the idea of the family and the arrays are separate

you can add several things to a family, and they aren't thought of in any particular order
they are just together
like a regular family or container

you can also have an array
this is ordered, you can add stuff to the top or bottom, remove stuff from the top or bottom
you will probably be able to do this to the middle as well, but I need to test the efficiency

you can put arrays inside families, and you can have arrays of families

you could create a family called 'item'
[item]
sprite object of item
string object's name
number for the repair level of the object

you can access it all as if it were one thing, the commands will be different than with private variables, but you will be able to access the name as if it were part of the item
if item sprite collides blah blah blah
and item name is "sword"
-1 from item repair level

you could make an array of items called 'inventory'
and then access them by the name inside item
by an index in the array
and you can pop or push them to the bottom or top of a stack

then you can make another family called 'character'
[character]
string for name
number for hit points
inventory (the array of items)

then you can create an array called 'army'
which would be an array of 'characters'

as I said before, you'd be able to create a random group of objects and put together families randomly for one time use
like remembering a group of objects a character encountered,
or a list of coordinates

but this is an example of how it could be used more powerfully through organization
and solidly defined containers

as for the stack controls you could have,
pick bottom, pick top, push and pop bottom or top
for starters,
but any suggestions anyone has, let me know

oh yeah, and when exactly do you need the double family hack again?
I haven't had to in a while, and I don't remember
it falls in this general area though, and a more logical workaround is probably possible here

also, if anyone has any ideas for what this object should be called...?
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Aug 17, 2009 8:09 pm

Hmmm, how about stack object? 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.

As to the double family hack take a look at this:
[url:1qrwfq2c]http://dl.getdropbox.com/u/666516/stareater.cap[/url:1qrwfq2c]
Taken from one of the compo's lol

Also for the stack, how about placement as a percent?
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

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

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests