How do I Search among the objects

0 favourites
  • 10 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • 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 - dropbox.com/s/cjfv02iby4t2mxr/cubes.capx

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • 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 <img src="{SMILIES_PATH}/icon_e_surprised.gif" alt=":o" title="Surprised" /> and now... i have Business license.

    I mean... I have acces to families and etc.

    If it helps to make it easier - do, please <img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarrassed" /> <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

  • 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.

  • 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! <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink" />

    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.

    dropbox.com/s/vevfnqhmfv0wfl6/Items.capx

    Can you do search with this conditions and all opportunities of C2?

    Please... I really need it <img src="{SMILIES_PATH}/icon_e_confused.gif" alt=":?" title="Confused" />

  • 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.

  • 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.

  • Ok, if Gearworkdragon said that one object with many frames is not really suitable...

    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..

    dropbox.com/s/2cu8ranft1osnxl/Items2.capx

  • 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..

  • 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.. <img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarrassed" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)