How do I Search among the objects

Get help using Construct 2

Post » Sun Jun 05, 2016 2:56 pm

Message: Wanedeck can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hello.
Beforehand sorry about my not perfect English, i`m from Russia.

Ok, after few weeks of trying i giving up.
Are "Construct 2" haven't normal search of objects?

In my app which I made in C2 i have many of objects. And each and every one have their "arguments".
And I want to do a search, like search in "Add event" or "Add action" window.
I mean type in textbox word or part of the word, and system understand, which object satisfies what I type, which don't satisfies, and thoose who don't satisfies - go away, and toose who satisfies - move to their place.

In example I try to show what I mean using buttons.
You can not watch in "event sheet", because that just events for simple example.

I trying do search with array, but have a many trouble.

Is it even possible?

Thanks for any help.

Example - https://www.dropbox.com/s/cjfv02iby4t2mxr/cubes.capx?dl=0
B
6
S
1
Posts: 10
Reputation: 378

Post » Sun Jun 05, 2016 7:38 pm

Lets go out from the best.
You work with the free version and therfor have no acces to families.
I understand this can be frustrating at times.

But it should not stop you from learning. Blaming the software while not knowing it, is not flattering for you.

So, i took your project, and i played with it.
With three reasons.
First , to show you that even with the free version it is all possible. Secondly, to show that you have a lot to learn. And i give you something to start with. Third, i love playing.

https://www.dropbox.com/s/rei6jwbds2aha ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,474
Reputation: 20,912

Post » Sun Jun 05, 2016 8:07 pm

Message: Wanedeck can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
99Instances2Go wrote:Lets go out from the best.
You work with the free version and therfor have no acces to families.
I understand this can be frustrating at times.

But it should not stop you from learning. Blaming the software while not knowing it, is not flattering for you.

So, i took your project, and i played with it.
With three reasons.
First , to show you that even with the free version it is all possible. Secondly, to show that you have a lot to learn. And i give you something to start with. Third, i love playing.

https://www.dropbox.com/s/rei6jwbds2aha ... .capx?dl=0


Oh, big, BIG thanks to you!

And... I once spent money :o and now... i have Business license.
I mean... I have acces to families and etc.
If it helps to make it easier - do, please :oops: :)
B
6
S
1
Posts: 10
Reputation: 378

Post » Sun Jun 05, 2016 8:57 pm

To read:
https://www.scirra.com/manual/142/families

Make one family with all the objects in. Now, all those events, instead of dooing it for each object, do it only once for the familie.
B
33
S
18
G
28
Posts: 2,474
Reputation: 20,912

Post » Mon Jun 06, 2016 5:28 am

Message: Wanedeck can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
99Instances2Go wrote:To read:
https://www.scirra.com/manual/142/families

Make one family with all the objects in. Now, all those events, instead of dooing it for each object, do it only once for the familie.


Ok, I see you're so smart! ;)
Can you please do one more modification with almost the same project?
But the difference is now I have only one sprite (with 10 frames) and each have his own parametr (variable "Name"). And now they are not at the periodical distance between each. They each have personal X and personal Y.

https://www.dropbox.com/s/vevfnqhmfv0wfl6/Items.capx?dl=0

Can you do search with this conditions and all opportunities of C2?
Please... I really need it :?
B
6
S
1
Posts: 10
Reputation: 378

Post » Mon Jun 06, 2016 7:45 am

That isnt possible so basically you want to break our realm by having one sprite with different parameter and condition as a well as positional based. That Is not really suitable.

The only time you should be using sprite with different frame is say. Let use RPG clothing for example.

most rpg sprites have one sprite for each piece of clothing and using different frame for different looks so that it cuts down time for spawn action and pinning and scoring it x,y this is fine to use it in this way.

but when you use sprite for different behavior say a gun verse a sword. You cant tell the construct to keep the sprite pin to the character and expect the gun/sword sprite to be perfectly align or function right. you are better off just making gun its own sprite and the sword its own sprite. Its just easier management.

If you are using a sprite in a manner like inventory where it isnt a graphic using issue just a viewing and overlapping you can do if overlapping , add a condition Sprite frame = number then you can run the event that way

or if you want to you can also do pick up such as if overlapping item and add condition if item variable= name then change the sprite to what ever frame you need it to be set on.

But again try to think can you use the same sprite for similar condition and action if not then try to use different sprite. Organization is key with sprite, don't make a thousand frame for one sprite just because you rather use frame number because you will get lost to what sprite you want and its a pain in the ass to figure out what didnt do right with debugging and the horror for ever reason you accidentally delete that one sprite that held 90% of your game.
B
51
S
24
G
6
Posts: 391
Reputation: 7,820

Post » Mon Jun 06, 2016 8:04 am

I did some testing with you example and ive found something to help you get started

If you set in the condition for the text-box to a text for the word ("fly") set a event under it as in sub event sprite with the parameter fly and another flies and now make that subevent block an ("or") block so that if one or the other is one there then it will pick both based on the text-box text for fly . Now add in an action sprite to visible

Next add in for else for that event block to sprite invisible

next you need to make sure that your sprite animation speed is set at 0 so that it doesn't all go to the last frame

Another tip i want to ask you to do is when ever you want a specific effect to be done. Write down the condition you want and then tell yourself what is the action. and act it out yourself before going all haywire on us. If found that if you were to experiment with such you might come across pretty cool result.

Someone once told me for every thousand experiment failed there is alway going to be that one success. You cannot have success without failure. so play with it for a bit.
B
51
S
24
G
6
Posts: 391
Reputation: 7,820

Post » Mon Jun 06, 2016 8:14 am

Message: Wanedeck can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Ok, if Gearworkdragon said that one object with many frames is not really suitable...
Gearworkdragon wrote:That isnt possible so basically you want to break our realm by having one sprite with different parameter and condition as a well as positional based. That Is not really suitable.

...I make the same but with 1 frame in 1 object (I mean... 1 object have only 1 image, but project have many objects).

99Instances2Go, maybe you can make the search like with 3 squares but here, with the many different object?
Your idea is cool, but if i have many object - i need to do every function to every object (yes?).

Please, if you can... I am begging you... Try, please..

https://www.dropbox.com/s/2cu8ranft1osnxl/Items2.capx?dl=0
B
6
S
1
Posts: 10
Reputation: 378

Post » Mon Jun 06, 2016 8:18 am

Gearworkdragon wrote:I did some testing with you example and ive found something to help you get started


Can you send .capx with your testing?

I think about this search for several weeks in a row, and my brain now alredy boil.. :?
B
6
S
1
Posts: 10
Reputation: 378

Post » Mon Jun 06, 2016 5:06 pm

Message: Wanedeck can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
99Instances2Go wrote:To read:
https://www.scirra.com/manual/142/families

Make one family with all the objects in. Now, all those events, instead of dooing it for each object, do it only once for the familie.


99Instances2Go, I haven't acces to PM, so write here. I hope you read it.
Can I expect to you for make the search with many objects?
No matter, with and object and many frames, or with many object each which have only 1 frame.. Can I expect to you for make the search with many objects?

Please, answer.. :oops:
B
6
S
1
Posts: 10
Reputation: 378


Return to How do I....?

Who is online

Users browsing this forum: bluesun66 and 11 guests