realtime paths

you know… ive been working with this idea for a long time… and today it just hits me… the result for making paths in gameblender… but, it was way too simple to have not been done before, i think its old news but i guess it wouldnt hurt to post
if youre asking what a path is, well in this case its your characters movement trail that an enemy can follow(around corners, into corridors, spiral staircase, anything)…

this is a basic basic demo but can easily be built upon… adjust the enemies speed if hes too fast
let me know what you think or if im wasting your time :slight_smile:

sounds like a cool concept, but, how do I implement it?

yep, i used a very similar method for the main enemy spaceship on the 6th level of indianjoe

Kool, how about if in a game you need the NPC characters to follow the ‘squad leader’ controlled by the player? Funky… :smiley:

There you have a use for this funky scripting! :smiley:

I like it… [took me time to figure out was was going on though… knowing that me python skills are barely over zero… don’t make fun of ME!]

sounds like a cool concept, but, how do I implement it?

select the main player, give it an always sensor(true pulse on, pulse of 4-10) >> python controller(“getPos”)

select the “track” box… this is what the enemy tracks to and moves towards so we will set this box along the path of the character…
give it a collision sensor >> 2 python controllers “setPos” and “remove”

now give the enemy an always sensor >> motion acutator(so he keeps moving forward) and a track actuator(track to “track” object)

give camera logic bricks always(true pulse off) >> python(“start”)

if you wanna know what the scripts do:
start = sets initial path list so theres no python errors
getPos = adds the current position of the main player to a list of coordinates that create a path
setPos = sets the position of the track object to the first value in the path list
remove = after enemy reaches that first position and touches the track object, it removes the first value of the path list which means the track object will now move to the next value in the list

and fred, thats a decent idea!

Nice script! You probably could do this for a race AI as well, have a position setter (the square) and then have the cars follow the path. It would be a great easy way to do it.


i don’t get why you take the collision sensor for the tracker box.

i cant get the link :frowning:
i copy it in a new window to and all that but it dident work
is it just me?

Blengine’s site appears to be down, ask him.

ok sorry for the stupid question…
yeah his site is down, is he still around?

Crap :frowning: site is down, and I was really intrested in that script. :stuck_out_tongue:

I still have that file. I downloaded it when his site was up, if anyone wants it I’ll get it uploaded to my site and allow you to download it. :smiley:

Can you upload it? please? :smiley:

Ok here it is:

I know this is a REALLY old thread, but does on anyone happen to have these two blends. Both sites seemed to have gone down.

JD-MULTI should have it, but he is in spain right now :frowning: