Picking by Evaluation of TextObject behaves strange?

0 favourites
  • 5 posts
From the Asset Store
Strange factory themed set of tiles for your platformer game
  • Hey there!

    In my project I use a function to let text (TextObjects) spawn. For being able to differentiate between these TextObjects I use a local variable usage inside these TextObjects.

    Okay now I have 5 different TextObjects. Two of them are just titles above the two ListObjects. They just stay there. Two of the other ones are descriptions of the ListObjects, below them. These descriptions change when selecting items of the corresponding ListObject above them. The last one is another TextObject which changes depending on the selection of the first ListObject.

    How I tried it is as follows:

    Every TextObject will be checked for its usage local variable by evaluation. If it is "role_icon" or "role_description" it should be deleted before spawning another one of these (or there will be overlapping text). That works perfectly fine.

    But when I try the same with the second ListObject and its description text below it just will not be triggered at all.

    Even if I remove the delete text command there will be no description text. Only if I remove the evaluation there will be description text. But either all other TextObjects will be deleted or text will overlap (depending if I remove the delete text or not).

    Am I missing something?

    Thanks in advance!

  • I don't know if it's a typo on your screenshot, maybe you have the word "resource" spelled differently in the instance variable and in the condition. "ressource_description".

    If this is not the case, try running the project in Debug Mode and check all instances of the Text object.

    Also, instead of "Pick By Evaluate" you can use "Text Compare Variable" condition.

  • Ah I wrote resource indeed wrong. But I did it on all places where I used it. It is written with double s in my native language. Corrected it. :D

    I now finally got it to work! But I think it is a little strange. Comparing the instance variable of the TextObject didn't work either. But when I made a subevent and moved the evaluation there it suddenly worked.

    But what I find quite strange is with the first ListObject (role) the picking inside on selection changed totally works.

    Both ListObjects use the same logic and call the same function to just spawn a different description text.

    Edit without an edit:

    Ahhh I now found out that if I remove the | (OR) statement and just have a single evaluation it stops working in the first list too.

    Is this a bug or did I do something wrong?

  • Can you post the entire event sheet or your project file? It's difficult to guess what is wrong without seeing the actual code.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm good for now, thank you! I noticed that I can not send the project via private message. Although it is strange I will just use a sub-event for the evaluation. It works that way.

    Thank you for your help. :)

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