How do I get a text pop up to display the correct text

0 favourites
  • 9 posts
From the Asset Store
Relax and relieve stress by popping bubbles in Fidget Anti- Stress Releaser!
  • Hey all! Lost all my post info again as usual, I'll make this quick! Capx and gif included!

    My Metroid style pause-wait-unpause effect for when the player acquires a new item isn't' working correctly. The issue is the way the text is being displaying. If the player collects the items in any order, the text pop up will only display the text info for the first gun. If the player collects the items in order (from A - H), the dialogue pop ups all show the correct information for the appropriate item.

    Can anyone help me with this? I previously had this "inventory" set up as an array but I was having the exact issue. I thought this "no-array" system would fix the problem still persists. I'm thinking its an issue with the function?

    One more thing, can anyone tell me why some of my items are displaying blank on the inventory slot? Because they shouldn't. There are no blank images in the inv slot animations. That's another issue I'm slowly working through too. Thanks all! ... .capx?dl=0

  • Besides that it is to much code for only 'that' ....

    Your problem are the origins in the animation frames. They are way out of center, actual showing the graphic content out of the viewport.

  • 99Instances2Go Thanks again for your help! Can't believe I let the origins slip like that. That part is fixed. Any idea how to get the text to display according the the pick up acquired now?

    [quote:39q23vzu]Besides that it is to much code for only 'that' ....

    Lol! Yeah I know, my code is shameful!

    I do have a few reasons for that though. I had the idea of having the inventory slots arranged in a cool way in the UI. I thought it would just be infinitely easier to place them manually. I had an array based system before that semi-worked but had the same problems I was having before 99Instances help. Now the array inventory system is partly working too. I'm debating whether to have "flashier" menu or just a row of 8 or 2 rows of 4 items at the bottom of the menu. Here's the code to my array ( and my imagined HUD for fun).

    Regardless of what system I go for, both the no-array and array system are playing the text incorrectly if the player picks up the items in any order.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1/. The function had no idea wich object to perform its action on, because you did not pick one. And 2/. All the other events had the same problem.

    You gots to learn how to pick objects, what the SOL (Selected Object List) stands for, and how to filter it with conditions. ... .capx?dl=0

    Look at event 5. The 'on collision' auto picks 2 objects. The playerbox & obj_weaponItems where the playerbox collided with. Now the SOL conatains those two objects. Meaning, we still need to add the right obj_slots to the SOL. That is wat the 'pick by comparisation' does.

    At this moment the SOL contains the playerbox, the right obj_weaponItems & the right obj_slots. Any action adressed to any of those objects in that event will only adress THOSE objects that are in the SOL. And that is basecaly how c2 works.

  • 99Instances2Go Wow! I don't think I would have ever figured this one out by myself! Thanks so much! It's a little more clear to me know. I'll need to experiment some more and actually try these series of events together in some other form to fully grasp the concept but this seems really important. Thanks for simplifying the code for me too! It's difference is crazy.

    I have a quick question. I'm sorry if this is a dumb question but why are those sub events empty? I find myself sometimes intuitively knowing I should use blank sub events in certain areas and other times I'll just try every possible combination of events I can think of to get something to work. I feel like I'm stumbling around blindly sometimes creating happy accidents because I'm lucky.

  • Events are easy to colapse that way. For me that is easyer to read the code, as easy as i read my morning paper. And it easyer to drag them arround.

    But. A little warning. If you read the 'optimalisation' articles in the manual, there are words against using empty sub events this way. I never noticed any difference in performance, so i keep using them. Just able to wrap my mind arround things is for me as importand as performance.

  • I'm looking at your demo and the actual text that appears for each item seems to be defined by this variable:

    But I'm not seeing where the instance variables are set.  Please help?
  • If you have each pickup item be a different animation or frame of the same object, you can give it an instance variable and fill it with the object's name. Then, set a global variable to that instance variable's value before you call the function.

  • goodwin88 What calebbennetts said. I was trying to figure out a way to create a simple inventory without an array and found this capx tutorial on the tutorials page. ... .capx?dl=0

    My system is basically inspired by that one. It uses "I" and the instance variable of the sprite to set the the correct animation frame (correct weapon item).

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