Announcement

Collapse
No announcement yet.

[RELEASED] [SUPPORT] RPG User Interface Kit

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

    #31
    Hi Moore Game Dev !

    Not sure how often you check this but I just started messing with the system today. I noticed that if you kill the bandit before accepting the quest from Bob than you'll never be able to complete his quest. Where in the BPs does it check to see if something has been completed (I'm still digging around)? I tried changing the prereqs on the quest table but it didn't seem to make any difference. Since the bandit has a specific ID, I figured I could run a check on that ID if the NPC is alive or dead right after accepting the quest. Also, I see there are checks on whether or not the hero can buy items, but nothing on selling them. I was looking to make quest items unsellable.

    EDIT: I was able to prevent the trader from buying quest items. Apologies for jumping the gun.
    Last edited by cveedub; 03-09-2020, 05:14 PM.

    Comment


      #32
      Originally posted by cveedub View Post
      Hi Moore Game Dev !

      Not sure how often you check this but I just started messing with the system today. I noticed that if you kill the bandit before accepting the quest from Bob than you'll never be able to complete his quest. Where in the BPs does it check to see if something has been completed (I'm still digging around)? I tried changing the prereqs on the quest table but it didn't seem to make any difference. Since the bandit has a specific ID, I figured I could run a check on that ID if the NPC is alive or dead right after accepting the quest. Also, I see there are checks on whether or not the hero can buy items, but nothing on selling them. I was looking to make quest items unsellable.

      EDIT: I was able to prevent the trader from buying quest items. Apologies for jumping the gun.
      Hiya cveedub,

      When the bandit is killed (when you press the E key up close to him) , the Event Interact event is triggered on the Event Graph of the BP_NPC_Enemy blueprint which does a few things like set his status to Dead and turn him into a ragdoll, then it calls the function NPCDefeated in the BP_RPGUIKit_PlayerController bp. The NPCDefeated function checks all current (uncompleted) QuestObjectives the player has and looks for the bandit's NPC ID number and if found then sets that QuestObjective row to Completed (well actually it calls yet another function to do that last bit, called SetQuestObjectiveToCompleted).

      I suppose that one way you, or I, could handle this situation, whereby the bandit is killed before we start the quest, is to respawn the bandit at the point of getting the quest.

      Or another way you could handle it is to make the quest unavailable when you kill the bandit so that when your char talks to the BP_NPC_QuestGiver , the function InitializeQuests , that is executed when you do that, checks the status of the bandit, and if he is dead, then the OpenQuestHUD function should not get called, but it should open the HUD if he is alive. To check all actors' statuses you could call the built in function GetAllActorsWithInterface (set the Interface to Interface_Interactable) built in function, then loop through them and Cast To BP_NPC_Enemy and compare their ID with the ID from the BP_QuestGiver_NPC. If there is a match then get the status variable from the NPC and checks its value for Alive or Dead.

      If you decide to spawn him then you would also have to unspawn (destroy actor) when he dies too. Probably after 30 seconds or similar.

      If you unspawn him then you could do it in a fancy way, such as making a Niagara effect that makes him melt into the ground or turn into smoke and ashes and blows away in the wind....

      Got any other ideas how it could be handled?

      Best regards,
      James
      Artstation: https://www.artstation.com/jamesmoore
      Sketchfab: https://sketchfab.com/James.Moore

      Comment


        #33
        Originally posted by Moore Game Dev View Post

        Hiya cveedub,

        When the bandit is killed (when you press the E key up close to him) , the Event Interact event is triggered on the Event Graph of the BP_NPC_Enemy blueprint which does a few things like set his status to Dead and turn him into a ragdoll, then it calls the function NPCDefeated in the BP_RPGUIKit_PlayerController bp. The NPCDefeated function checks all current (uncompleted) QuestObjectives the player has and looks for the bandit's NPC ID number and if found then sets that QuestObjective row to Completed (well actually it calls yet another function to do that last bit, called SetQuestObjectiveToCompleted).

        I suppose that one way you, or I, could handle this situation, whereby the bandit is killed before we start the quest, is to respawn the bandit at the point of getting the quest.

        Or another way you could handle it is to make the quest unavailable when you kill the bandit so that when your char talks to the BP_NPC_QuestGiver , the function InitializeQuests , that is executed when you do that, checks the status of the bandit, and if he is dead, then the OpenQuestHUD function should not get called, but it should open the HUD if he is alive. To check all actors' statuses you could call the built in function GetAllActorsWithInterface (set the Interface to Interface_Interactable) built in function, then loop through them and Cast To BP_NPC_Enemy and compare their ID with the ID from the BP_QuestGiver_NPC. If there is a match then get the status variable from the NPC and checks its value for Alive or Dead.

        If you decide to spawn him then you would also have to unspawn (destroy actor) when he dies too. Probably after 30 seconds or similar.

        If you unspawn him then you could do it in a fancy way, such as making a Niagara effect that makes him melt into the ground or turn into smoke and ashes and blows away in the wind....

        Got any other ideas how it could be handled?

        Best regards,
        James
        Thanks, James! Really appreciate the response on this, let me have a go at the blueprint and see if I can come up with something. Similarly to this though, in a future iteration you may consider adding a function that does an inventory check after a quest is issued. With regard to the apple quest, if I go pick the apples before hand, the quest system doesn't see them in my inventory and only recognizes what I add after taking on the quest. I'll also look into storing a location visited array and checking against that when the quest giver asks me to go someplace.

        All this aside, you've made a wonderful kit that has some many possibilities to expand and an incredible foundation to start from.

        Comment


          #34
          Originally posted by cveedub View Post

          Thanks, James! Really appreciate the response on this, let me have a go at the blueprint and see if I can come up with something. Similarly to this though, in a future iteration you may consider adding a function that does an inventory check after a quest is issued. With regard to the apple quest, if I go pick the apples before hand, the quest system doesn't see them in my inventory and only recognizes what I add after taking on the quest. I'll also look into storing a location visited array and checking against that when the quest giver asks me to go someplace.

          All this aside, you've made a wonderful kit that has some many possibilities to expand and an incredible foundation to start from.
          Thanks I'll definitely include this inventory check in a future update. I suppose its going to be debatable about how much functionality should be provided (out of the box) or left to the buyer to develop. But there is surely room for some additional functionality in the quest area.
          Artstation: https://www.artstation.com/jamesmoore
          Sketchfab: https://sketchfab.com/James.Moore

          Comment


            #35
            Originally posted by Moore Game Dev View Post

            Thanks I'll definitely include this inventory check in a future update. I suppose its going to be debatable about how much functionality should be provided (out of the box) or left to the buyer to develop. But there is surely room for some additional functionality in the quest area.
            You're absolutely correct about functionality! For the price, you've already gone above and beyond, imo.

            So I have it working, sort of. I store an array of enemies killed in the player controller, only when NPCDefeated is called (add unique to the EnemyKilled array), then when ever you interact with a quest giver it calls RecheckDefeated, which again calls the NPCDefeated function and passes in each ID from the EnemyKilled array. I haven't thoroughly tested it against other Enemy NPC and other quest givers to ensure there isn't any mix up, but with only one enemy and one kill quest giver it works. I'm not sure how scalable it is though so I would imagine I would need to clear out that entry into the array after the entire quest is completed.

            Similarly though, if I already pick up the bandit sword, Bob doesn't know I have it, so will need to build out the inventory check function.

            Comment


              #36
              Originally posted by cveedub View Post

              You're absolutely correct about functionality! For the price, you've already gone above and beyond, imo.

              So I have it working, sort of. I store an array of enemies killed in the player controller, only when NPCDefeated is called (add unique to the EnemyKilled array), then when ever you interact with a quest giver it calls RecheckDefeated, which again calls the NPCDefeated function and passes in each ID from the EnemyKilled array. I haven't thoroughly tested it against other Enemy NPC and other quest givers to ensure there isn't any mix up, but with only one enemy and one kill quest giver it works. I'm not sure how scalable it is though so I would imagine I would need to clear out that entry into the array after the entire quest is completed.

              Similarly though, if I already pick up the bandit sword, Bob doesn't know I have it, so will need to build out the inventory check function.
              Nice solution there. It should scale up fine as long as all your NPCs have a unique ID.

              Best regards,
              James
              Artstation: https://www.artstation.com/jamesmoore
              Sketchfab: https://sketchfab.com/James.Moore

              Comment


                #37
                Moore Game Dev Hi James! The hit scan for interaction doesn't function when you're in third person. Any recommendations on how to solve this? Currently, the Send Message to Screen node in Process tick isn't hooked up for the message variable, if I populate it with anything, it always stays on screen because, I'm assuming, the camera is hitting my back when in 3rd person. Or just because it have it hard coded lol

                Comment


                  #38
                  Moore Game Dev I solved it, mate. My bad. I have a bad habit of asking for help and figuring it out 6 minutes later. I just changed to scan from the FP cam and attached an arrow to the TP cam and updated Get Object Name Over Cross Hair to use the arrow, plus some updates to the branches in the Process Tick.

                  Comment


                    #39
                    Originally posted by cveedub View Post
                    Moore Game Dev I solved it, mate. My bad. I have a bad habit of asking for help and figuring it out 6 minutes later. I just changed to scan from the FP cam and attached an arrow to the TP cam and updated Get Object Name Over Cross Hair to use the arrow, plus some updates to the branches in the Process Tick.
                    you are awesome
                    Artstation: https://www.artstation.com/jamesmoore
                    Sketchfab: https://sketchfab.com/James.Moore

                    Comment

                    Working...
                    X