Page 1 of 1

pawn to a certain pos

Posted: Tue Jul 17, 2007 8:06 pm
by darksmaster923
sup yall, i am trying to make the pawn to a dynamic X-Y-Z location
like if the pawn dies in a firefight, he runs back to where he was and attacks the pawn/player he fought

Posted: Tue Jul 17, 2007 8:20 pm
by paradoxnj
You need to somehow save the position where the pawn/player died, then set the pawn/player to that position when you respawn.

Posted: Tue Jul 17, 2007 8:26 pm
by darksmaster923
well i did in 3 variables
but i have no idea to get the pawn over there

Posted: Tue Jul 17, 2007 8:48 pm
by paradoxnj
There should be a scripting command to set the target to the player/pawn name who killed you. That would probably be the best thing to do since you don't want to assume that the player/pawn will not move after you die.

Posted: Tue Jul 17, 2007 8:51 pm
by darksmaster923
yeah but that will like teleport him

Posted: Tue Jul 17, 2007 8:54 pm
by paradoxnj
You were too quick. I edited my post. See above.

Posted: Tue Jul 17, 2007 8:54 pm
by ardentcrest
Search the demos there is one where the bots if they see you move to your spot.

ie They move X,Y,Z to your X,Y,Z

find that demo look at the bots script and you will be 1/2 way there.

Infact, download all the rf demos see what they can do, most of this is scripts. Look at the scrits and learn. :twisted:


DAM YOUR QUICKER THAN ME :lol:

Posted: Tue Jul 17, 2007 9:01 pm
by darksmaster923
hmm i just got an idea

from the docs

self.last_enemy_yaw

Returns the last known yaw of the previously targeted enemy.

self.last_enemy_pitch

Returns the last known enemy pitch of the previously targeted enemy.

self.last_enemy_range

Returns the last known enemy range of the previously targeted enemy.

Posted: Tue Jul 17, 2007 9:04 pm
by ardentcrest
sorry I lost your train of thought at the end of your post :twisted:

or did you hit submit before you could FINS...

Posted: Tue Jul 17, 2007 9:09 pm
by darksmaster923
ardentcrest wrote:sorry I lost your train of thought at the end of your post :twisted:

or did you hit submit before you could FINS...
? well i was showing the vars becuz they could be very helpful( to me anyway)

Posted: Wed Jul 18, 2007 10:56 am
by Juutis
That's very tricky without proper pathfinding.

You could make the pawn run towards the position where he died, but the level would have to be really simple. With a complex level it's very unlikely that running straight will get you where you want. Though I think there are ways to increase the possibility for the pawn reaching the point.

You could use the GetCollideDistance() command to make the pawns a bit aware of their surroundings. Then if they run into a wall and have two options, left and right, they could pick the one that's more likely to get them to the target point. I'm not sure how to do that exactly, but I think you could use the command to get many distances to the walls in different directions from the pawn and compare the results. For example, if the command returns 100 when getting the distance to the wall directly in front of the pawn, 200 to the left, 5000 to the back and 3200 to the right, it would probably mean that you can't go forward or left and back is the way you came from so going right is the only option. You would then rotate the pawn, move it there and scan the surroundings again.


Let's hope Jay finishes the pathfinding and makes another community release soon. :wink:

Posted: Wed Jul 18, 2007 5:42 pm
by darksmaster923
Juutis wrote:That's very tricky without proper pathfinding.

You could make the pawn run towards the position where he died, but the level would have to be really simple. With a complex level it's very unlikely that running straight will get you where you want. Though I think there are ways to increase the possibility for the pawn reaching the point.

You could use the GetCollideDistance() command to make the pawns a bit aware of their surroundings. Then if they run into a wall and have two options, left and right, they could pick the one that's more likely to get them to the target point. I'm not sure how to do that exactly, but I think you could use the command to get many distances to the walls in different directions from the pawn and compare the results. For example, if the command returns 100 when getting the distance to the wall directly in front of the pawn, 200 to the left, 5000 to the back and 3200 to the right, it would probably mean that you can't go forward or left and back is the way you came from so going right is the only option. You would then rotate the pawn, move it there and scan the surroundings again.


Let's hope Jay finishes the pathfinding and makes another community release soon. :wink:
<_< with that technique the bots are gunna run in circles

DAMMNIT JAY RELEASE!!!!!!!!!!!!!!!