Announcement

Collapse
No announcement yet.

pay to open and close doors,

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    pay to open and close doors,

    okay well hello there guys, So i'm working on a system that would allow a player to purchase a door to open it, kinda like cod black ops zombie mode, where you have to pay to open doors.

    However the catch is, The player should be able to open and close doors multiple times with only paying once!

    The way i have it set up, when you press e
    -It traces to see if you hit a door
    -If a door is what you hit,than it checks if you have your money variable is above 500$
    -if true, it subtracts the money from your money variable
    -Then it Tells the door blueprint to play the door open animation.


    The only problem with this is, everytime you look at a door, and press e, even if you've already bought that door, your money will still be subtracted.

    In an attempt to make it that you only have to purchase the door once, i set a variable to true once you have purchased the door, so that all future times, it checks that variable if the door has been purchased, and skips the money subtraction, and just opens up the door.

    However, this variable effects every single door in my game, so if you buy one door, it sets the variable to true, and then every other door is costs nothing! Which is not what i want either.

    What I'm thinking is to set, a variable in the Doors blueprint to check if that specific door has been purchased. then send that information back to the character blueprint....But I' don't know how to do this. My mind is hurting from trying to think of how this is supposed to be accomplished.

    So, how could i make it so when you purchase the door, it only has to be purchased once, and then all future times it knows it has been purchased, so that when e is pressed, just go straight to opening the door.Click image for larger version

Name:	1.png
Views:	1
Size:	437.0 KB
ID:	1143778

    Click image for larger version

Name:	2.png
Views:	1
Size:	374.3 KB
ID:	1143779

    #2
    Hello,
    If you set your bool in your door, then you'll can access it from your "cast to door" from your break hit to buy access and to check it.(don't forget to set variable public : open the eye of the variable)
    Last edited by Fen; 02-05-2015, 03:20 AM.

    Comment


      #3
      Omg thats why i couldn't see the variables from the door blueprint, The eye wasn't open. Thx so much!

      Comment


        #4
        Hey I just tryed to do the reverse, where instead of getting a variable to work a character blueprint, from an asset.

        I'm trying to get a variable to work that is from the character blueprint in another asset. I Followed what you said and it still does not want to work.

        Click image for larger version

Name:	Can't cast to thing2.png
Views:	1
Size:	267.7 KB
ID:	1066139
        the chair blueprint amounts is from the Character blueprint, and its being used in The Item Maker Actor Blueprint. How could i make something like this work.

        Comment


          #5
          I am not sure about your blueprint because i can't see it clearly but i see that your "cast to mycharacter" has no input. You need to "get player character" and connect it to "cast to mycharacter" to be able to drag variables (functions and custom events) and have the values of those variables of the source.

          Comment


            #6
            worked once again, I Wish i could show you what just worked XD Its awsome.

            Comment

            Working...
            X