jawad2heaven's Recent Forum Activity

  • FIXED: Before saving I moved the global variable into the group folder which turned it into a local variable... I had no idea you can convert your global variables when put into a group folder...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi! After reloading my save for whatever reason my While Loop is now broken.

    [Please read reply to see how fixed, compare both images for context]

    Oddly my While Loop was functioning completely fine. After reopening my session it's acting as though it never worked.

    I have a debug to show whether my conditions are true or not and if incrementing is occurring. Before closing my session, I can see it was incrementing every second. Even when the whole phase restarts, the event loops as I thought it should.

    After reopening the project the debug text shows incrementation is only going up by 1 and stays at 1 unless I restart the layout preview.

    What I tried:

    My backup is unfortunately 10-15 minutes older than the main project save so I'm missing information compared to the most recent one. I remember clearly saving before closing. In theory this loop should be the same as when it was working completely fin. Unless there was a save problem (couldn't find forum posts about project saves missing information).

    After reading several Loop forum posts and documentation I'm stuck figuring out what's wrong with this loop. Knowing that Loops can be tricky, is there anything I should try here?

  • lionz I'm super grateful you were patient with me. I did not realize it was that simple. Just like you said, 1 condition and 2 actions.

    I wasn't aware if you hover over a family that it still recognizes the child of that family individually. So on my debug it showed the individual position of each family member I was hovering over.

    Your suggestion to put a variable on the family and name individually for the sprites worked beautifully also.

    I should probably review the manual on families and see if there's any mention of recognizing the individuals inside the family separately.

    Edit (for those in the future confused like I was): After reviewing the family manual, it's clear I didn't understand the concept, I thought it would apply effects to all members at the same time rather than apply effects when triggers take place. So that's a good lesson for myself. I confused Families for Containers.

  • If it's 50 instances of the same object then it is mouse over object. If it is 50 different objects then you put them in a Family and say 'mouse over Family'. The text required would be set text to family.variable, so the instance variable is at the family level for text. Either way you just need one event only for everything, with 2 actions - set position of text object to sprite/family, and text object set text to object/family.var

    It is indeed 50 different objects. Edit*: And the tooltip is to show up only on the sprite that's being hovered over.

    Thank you for clarifying, since I'm a beginner I've only understood the part where mouse hovers over a family but kind of lost how an instance variable would help the actions determine which sprite it should be over. There's a lot of factors that makes me lose the train of thought.

    If it's not consuming to replicate as an example, could I ask you to show an image so I can understand the concept please? I tried to mess around with variables for the family but I can't seem to figure out what you're conveying.

  • The above is one event only that is for all sprites yes. For the above you don't create or destroy anything, you have one text object that changes position based on the object you hover over. The object is picked by mouse cursor over object condition.

    Right I see what you're saying, this will help reduce unnecessary actions and text hanging around since I can customize one text block for each sprite hovering over, thank you for pointing that out!

    What I'd also like to address is let's say I have 50 sprites I want to hover over to have their own text, does that mean each sprite will need it's own event condition "mouse over object (select sprite)"? I wanted to see if there's something else before I move forward.

  • Assuming you can only show a tooltip on one sprite at a time you can have one text object and say mouse over sprite > set text object position to sprite. The text to be shown can be a string variable on the sprite then you can also say in the same event set text object text to sprite.textvariable.

    Thanks for the reply! I see what you're trying to say but I maybe misunderstanding.

    Does that mean I have to in anyways create an event for each sprite I hover over? Or is there a way to setup the events in a way it recognizes the hovered over sprite without creating a separate event for hovered over sprite?

  • Hi! I have a page with many sprite boxes, whenever I hover over one of these sprite boxes the appropriate text appears.

    I can do this by creating the text and then destroying it every time I hover or simply fadein fadeout every hover.

    My issue is too many sprite boxes that require their own text and this is making event overhead a bit much!

    I can't think of a way to simplify the events. I tried using a family but that triggers it for everything in the family obviously. If you have any ideas please do throw them at me!

    This is what I have as an example for hovering over a single sprite.

  • I don't know if this is the right context to suggest but wouldn't "System --> Trigger Once While True" help in these scenarios?

  • What was once a huge function block is one of the smallest blocks, thank you once again Tsardall

  • Are your pages only sprite or you have text pinned to them?

    Because I did something similar only using 1 sprite, instead of many pages on different Z layers, I used sprite animation and frame.

    That way you would only have to refere to one sprite and just tell which frame/animation you want.

    That's freaking genius, the majority of my pages are sprites so that at least will cut down a massive chunk of work for sure! MVP comment of the day Tsardall

  • I have a book where I flip pages (duh). Initially I just had a function to bring to the top the page that I needed.

    Now I found myself adding more and more pages and this is making my function HUGE. Any ideas how to bring to the top layer or bring to the top a page when there's a lot of them?

    I'm trying to think of a logical solution using event sheets.

  • I think it's probably that your "Exam" layer isn't set to Transparent, so when objects go onto layers below it, they aren't visible. To change it, just go to the Layer Properties bar and check the box that says "Transparent". :)

    Thanks! I did not see that in the documentation and never knew about it!

jawad2heaven's avatar

jawad2heaven

Member since 19 Jan, 2024

None one is following jawad2heaven yet!

Trophy Case

  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

3/44
How to earn trophies