Need help with item pickup system

Discussion in 'Programming' started by OblivionSkull21, Jul 30, 2018.

  1. OblivionSkull21

    OblivionSkull21 Member

    Sep 26, 2017
    First off, here is what I'm wanting to happen.

    1.) Player touches item and presses space.
    2.) Text box pops up saying what the item is (with a typerwriter effect, so each character is displayed one at a time, with beeps for each).
    3.) Once the text has finished typing, the yes/no options appear. This is just an object I created so that if the player presses the 'A' key, yes is highlighted and if the player presses the 'D' key, then no is highlighted. The default would be for it be set on yes. So really, I would just be creating the object and then destroying it once your option has been selected.
    4.) If yes is highlighted and the player presses space, then the item will disappear from the screen (you picked it up) and a new line of text will pop up saying you took the item. If the player presses space once the text is completely displayed, then the item textbox system closes out. THE END
    5.) If no is highlighted, and the player presses space, then the item textbox system closes out. If the player changes they're mind, then the textbox system starts over from the beginning (typing out the first line, displaying the options, etc.)

    I've been trying to create this with a modified version of a textbox system for npcs, but I keep running into bugs like:
    1.) The options don't leave once you've made your decision.
    2.) If you pick no, it doesn't close out the text box. Instead, it flips the yes and no keys around (A becomes D, D becomes A). If you press space for either of them, then the text box closes.
    3.) If you change your mind and come back, the text instantly pops up without typing it out as well as the yes/no options.

    I tried fixing these but it just caused more bugs:
    1.) The options leave but don't come back if you change your mind (no option).
    2.) The item is destroyed after picking it up, but then the moment I touch another item that's in the room, that one disappears on collision.

    I've been trying several things, but to no avail. So what I'm really asking is if somebody could help me create an easy item pickup system that meets all five needs stated above? I would severely appreciate it.

    If you need a reference as to what I want it to look like, it's like the item pickup system in Undertale.
  2. Becon

    Becon Member

    Jul 13, 2016
    Well, since you posted no code, it seems instead of having someone help you, you want them to do it for you. I doubt anyone on here wants to do that friend. Post your code and it will more than likely be addressed.
  3. DarkFireDemon

    DarkFireDemon Member

    Sep 20, 2017
    U could of bumped your old posts instead of constantly making a new one too, those have your code in it. You seem to be very stuck in this. U should probably start from the bottom and make a new script instead of modifying a npc text box one.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice