Announcement

Collapse
No announcement yet.

[KISMET] Make things follow the player?

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

    [KISMET] Make things follow the player?

    Hi,

    For my project, I was wondering if by using kismet if i could make something follow the player, for example: a ball.

    I wish to have the ball floating and follow the player at about chest/head height and i was going to attach a face to it that uses Matinee to look at the player. I was told once that you can make enemies attack you by setting the gametype to CTF and just give the player the flag, that way the enemies try to kill the player for the flag. But is it possible to do this with just a static mesh? if so, i could use some elaboration. I would be greatly appreciative of any help given.

    --Also to note, I still can't script for **** so kismet-only advice is what I'm after.--

    #2
    Hey Crow! There's a bunch of ways to do it... Some ideas off the top of my head :-

    1. You could use Attach-to-Actor to link the ball to the player.
    This is the simplest to implement, but its the least convincing if you need an organic look. For example if the player jumps then the ball will jump instantly too.

    2. Make the ball an Interpactor (with Collision). Then use Set Actor Location on the Interpactor (Mover) to move it based on the movement of the Player to trail behind.
    The is a predictable system but it won't be as rigid looking as #1, because you can delay the ball and offset it to lag behind the player.

    3. Make the ball into a KActor and use an Add Velocity loop to impart a force on the KActor ball making it follow the player.
    This is the most convincing approach but requires a little more tweaking.

    Overall, the difference depends on the results you want. Must the ball move in a real-world organic way?

    Comment


      #3
      thank you again frankit, and the ball does need to be organic looking since im just using it as something to attach a face to. i shall try your advice(s) and hopefully i dont mess anything up :P

      Comment


        #4
        kind of embarrassing, but whats a velocity loop? i cant find it, nor have i used it/heard of it before.

        EDIT

        heh, nevermind, i think i figured out what you meant

        EDIT

        actually, im still stumped. ._.

        Comment


          #5
          Its good that you're thinking of using the Kactor / Rigid Body, because its the only one that will account for collisions with static meshes etc... Lookup 'Add Velocity' node... back in a sec...

          Comment


            #6
            is Set Velocity the same as Add Velocity? because thats all i can find. when i try fiddling around with it, my editor crashes lol

            Comment


              #7
              Add a spherical mesh to your map and enable collision i.e. StaticMesh'EngineMeshes.Sphere...
              F4.. Set the physics to Phys_RigidBody
              Add a key pressed event that uses Get Location (mesh) Add Float (add 100 to z etc)... Set Velocity (mesh)...

              Comment


                #8
                I did that and nothing happened. I looked up tutorials on how to use Get Location and stuff and found this one where someone made a turret that follows and shoots you. when he used Get Location, all it did was tell the engine where you or the object are in the world. i fiddled with it as much as i could but it still isn't following me, i just got it to look at me.

                http://i.imgur.com/po34mca.png this is what my kismet sequences look like

                (btw, i used a couch as a test object)

                EDIT

                i forgot that you mentioned the Add Velocity loop but even when I tried that, it didnt work. it just made the couch twitchy.

                http://i.imgur.com/SnVNbgi.png this is my kismet sequence with the set velocity node.

                Comment


                  #9
                  Couch must be the Target of Set Velocity and you must supply a velocity.
                  In this case you can get the location / vel of the player and assemble a vector that will make the ball chase the player.
                  Mag could be 1000 etc...

                  Comment


                    #10
                    ugh, im sorry frankit, nothing is working. I think i am either completely brainless or that this requires some sort of scripting because everytime someone mentions these sequences, they are also talking about scripting.

                    wouldnt it be possible to spawn a stock NPC and just make them invisible with a blank material, then attach an actor to them? im sure there is some easy way to make them follow you, or at least make them follow a pre-made path (which was also a future question)

                    my end goal was to make a face follow the player with a trigger attached to it so when the player gets stuck they could press E on it and it would give hints. i plan to make my game relatively difficult so i wanted the face to look organic since the player might need them often, but if i cant figure this out, i could always do the cheap way (like i always do) and just make that face hide around the area where the player would have to find them to get hints. i just wanted to make it follow the player to freak them out a few times when they first see it and not understand what is following them, then realize that it is friendly. (still working on that horror game i started a long time ago, this is like the tenth time i started over since i keep learning new things. mostly thanks to you too)

                    but really tho, i have seen some videos online of people testing out their AI following scripts. idk if they did it in kismet, but im sure there is a way.

                    Comment


                      #11
                      Don't worry, attacking or following AI code is very doable in Kismet. But you need to break the problem down into smaller chunks and solve each stage before connecting all the dots. Basically you need to persevere a bit more. If I was in your shoes. I would create the ball in the earlier step. Then I'd add key pressed events to move the ball manually using Get Location / Add Float / Set Velocity as outlined above. Get that part working.

                      Then add the 'following' part by getting the Player location and backing out a directional vector that can be supplied to Set Velocity to make the ball travel in the direction of the player. This isn't Quaternions or anything, its just vector math. But you need to start by using two Get Actor Locations at a minimum (Ball + Player), then you must use a series of Get Vectors / Add Floats and then finally reassemble the Vectors again using Set Vector, before supplying them to Set Velocity. You just need to work through the steps in small chunks. Doing this in script won't be any easier.

                      Comment


                        #12
                        i know, you're right. I just haven't really been in a 'persevere' type of mood and i just can't seem to complete any of these steps. plus the more i ask and try, the more i seem to fail and worry im becoming a bother because i just can't figure this stuff out. :s

                        i probably just need a break. i might approach this problem another day. ill try to learn more Kismet stuff and maybe along the way i can figure out my problem or just get a bit better with kismet in general. I paused the development of this game for too long and forgot most of my old knowledge.

                        even though i couldn't figure out this problem, your help is still invaluable to me, frankit.

                        Comment

                        Working...
                        X