pawn to a certain pos
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
pawn to a certain pos
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
like if the pawn dies in a firefight, he runs back to where he was and attacks the pawn/player he fought
Herp derp.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
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.
Last edited by paradoxnj on Tue Jul 17, 2007 8:51 pm, edited 1 time in total.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
- ardentcrest
- Posts: 735
- Joined: Wed Jan 25, 2006 10:55 pm
- Location: Ireland
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 Evil :twisted:](./images/smilies/icon_twisted.gif)
DAM YOUR QUICKER THAN ME![Laughing :lol:](./images/smilies/icon_lol.gif)
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 Evil :twisted:](./images/smilies/icon_twisted.gif)
DAM YOUR QUICKER THAN ME
![Laughing :lol:](./images/smilies/icon_lol.gif)
He's a Bot Jim, But not as we know It.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
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.
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.
Herp derp.
- ardentcrest
- Posts: 735
- Joined: Wed Jan 25, 2006 10:55 pm
- Location: Ireland
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
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 :wink:](./images/smilies/icon_wink.gif)
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 :wink:](./images/smilies/icon_wink.gif)
Pain is only psychological.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
<_< with that technique the bots are gunna run in circlesJuutis 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.
DAMMNIT JAY RELEASE!!!!!!!!!!!!!!!
Herp derp.