Announcement

Collapse
No announcement yet.

Increase ai speed when overlapping

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

    Increase ai speed when overlapping

    I'm hardly trying to find a way if I can increase the AI walking speed when the player overlaps an actor. And when that actor is being overlapped, it will get destroyed and increase the speed of the AI by a certain ammount. but whatever I'm trying it doesn't want to work properly.

    This is the blueprint(I put a print string to see if it fires, and it does----):

    Click image for larger version

Name:	Screenshot_3.png
Views:	136
Size:	99.3 KB
ID:	1489642

    Click image for larger version

Name:	Screenshot_5.png
Views:	200
Size:	63.3 KB
ID:	1489643


    ----Appearently the speed won't change at all, coming with an error after stopping the game:


    Click image for larger version

Name:	Screenshot_4.png
Views:	133
Size:	48.8 KB
ID:	1489641

    What am I doing wrong??
    Attached Files

    #2
    Is my problem that hard to be solved, or people who know blueprint way better than me think that I'm gonna find out the fixing already right before they will answer? Cause the fixing for this problem is unfindable on internet.

    I know that I've been posting in this website very often ever since I started using unreal engine. But I don't want to give up on this, I want to continue working on this cool program, I want to learn everything I need to become a true programmer. I don't want to end up giving up just how I did in unity (Hope it's allowed to pronounce the name here) so please, give me a chance to continue and fix this problem that I'm stuck on.

    Comment


      #3
      Hello,
      Be sure that if someone has a good idea he would ever have give you.

      I've been away for a long time so i may be wrong but in your second blueprint you put a destroy actor and then cast to another one. I would try to do the destroy at last to be sure that what is done after actually is not ignored as actor is destroyed.

      Comment


        #4
        BlackFace_A

        Everyone is watching Portugal vs Spain! Look, game dev is full of frustrating setbacks.
        You've just gotta push through the pain barrier. That's how big leaps can happen eventually!

        Ok, the Speed-Increase event has nothing to work with. That's why it registers a none error.
        You need to supply a Character or Character AI or something here. Where is the AI object?

        Comment


          #5
          Originally posted by franktech View Post
          BlackFace_A

          You need to supply a Character or Character AI or something here. Where is the AI object?
          That's the problem, If I try to connect the custom event to "Cast To NPC" then the cast node won't fire. It tells me that the cast to npc is not needed but it comes with an error when overlapping with the collectable actor

          Detailed edit: It triggers without the cast node but comes with an error when overlapping occurs, but nothing happens if I add the cast node between the custom event and set max walk speed nodes

          Comment


            #6
            First, did you fix the easy part?

            Destroy Actor: Always put this at the end of the chain of execution.
            Even add a small delay before it, just in case you add to the code....

            Comment


              #7
              Yes, the easy part is already made, but still gives me error with the set max walk speed

              Comment


                #8
                Take a step back and label the two Blueprints. Which Blueprint has the Overlap event?
                It calls an Interface, but where's the interface inside the AI BP? Then drag MaxSpeed...
                You do not need to qualify the reference for the CMC, it already exists in the Blueprint.
                Just drag 'Character-Movement' into the graph drag 'Max-Speed' out and you're done...

                Comment


                  #9
                  Click image for larger version

Name:	Screenshot_3.png
Views:	135
Size:	91.1 KB
ID:	1489730

                  This is how I placed the nodes in the AI BP, but nothing fires. The event Speed Change BI happens only in the player blueprint, because the player touches the collectable actor, and not the AI. But I want my AI to get affected by the event and not the player

                  Comment


                    #10
                    Show the Full-Name of BP that houses the overlap event. What triggers the Overlap...
                    The Player is overlapping the AI and so the AI BP is triggering the Overlap event???
                    Or the AI is overlapping the Player, so the Player Overlap event is being Triggered?

                    Comment


                      #11
                      As it shown in the screenshots above, the guardian is the player, the npc is the AI, and the collectable actor is just a simple actor that has the EventOnBeginOverlap.

                      This is how I made with the collectable actor, if the player overlaps with it, it should trigger the blueprint interface shown above and destroy the actor.

                      The main problem seem to be actually that the Speed Changing BI sends the trigger event to the player, but not to the AI, because the player is the one that overlaps the collectable actor and not the AI.

                      Creating a new blueprint interface, and connecting the Event Speed Change BI to it doesn't seem to send any triggering event through the player blueprint at all.

                      I can't show anymore screenshots cause i am on the phone, and its 23:34 here.

                      Comment


                        #12
                        Originally posted by BlackFace_A View Post
                        I can't show anymore screenshots cause i am on the phone, and its 23:34 here.
                        No worries. Your description is enough....

                        Originally posted by BlackFace_A View Post
                        The main problem seem to be actually that the Speed Changing BI sends the trigger event to the player, but not to the AI, because the player is the one that overlaps the collectable actor and not the AI.
                        Exactly! The Speed-Change event and Interface don't belong inside PlayerBP at all.
                        Instead you need to add that Interface to the NPC and just destroy the Player directly.
                        You can call Destroy-Actor-Player from the collectable actor, w/o going into PlayerBP.

                        Originally posted by BlackFace_A View Post
                        Creating a new blueprint interface, and connecting the Event Speed Change BI to it doesn't seem to send any triggering event through the player blueprint at all.
                        The challenge is architecting this right. How many AI are there? Interfaces are optional esp. if its 'one'...
                        You can use Get-All-Actors-Of-Class (NPC) then Cast-To it and call the Speed-Increase event directly.

                        Otherwise create an Interface inside Player / NPC with the same name, that works differently for each.
                        For example, create an Interface in each called Collectable_Actor_Overlap_Handler or something etc.
                        In the Player implementation -> Destroy Actor->Self. But In the NPC it will bump CMC-MaxWalkSpeed...
                        Use Get-All-Actors-With-Interface to get the Player & NPC objects, and remember to call this in a loop...

                        Comment


                          #13
                          Full delete and edit: I now fixed the problem, both player and npc are now getting the trigger event from the interface.

                          Finally I solved the problem, not only that, but I now learned something new.

                          Thanks

                          Topic solved
                          Last edited by Maker26; 06-16-2018, 07:05 AM.

                          Comment


                            #14
                            I think I've accidently did something and now the SpeedChange_BI doesn't fire anymore in the npc

                            I changed my mind on adding a widget that tells the player how many objects he picked up, the widget now works perfect, but I think I kinda messed up in the CollectableBP and now it doesn't send the trigger event anymore. I can understand that it sends to the player but the npc doesn't get any triggering anymore.

                            I messed up so badly, and I can't even remember how it was before I broken it...
                            Attached Files
                            Last edited by Maker26; 06-25-2018, 05:27 AM.

                            Comment


                              #15
                              I'm starting to lose my mind, and become completely dissapointed to myself that I managed to break the most important thing and now I can't even remember how did I do it last time. Now I'm completely stuck in a never ending nightmare.

                              The SpeedChange Event from the npc doesn't get any signal from the message interface at all even if I attached Get All Actors With Interface with it. Why did I had to remove those nodes?

                              What did I do in that blueprint from the attachement above this comment that it doesn't send to my npc any interface messages to the event???

                              Comment

                              Working...
                              X