|1st Jan 2002, 10:23 PM||#1|
Join Date: Jan. 1st, 2002
Various ScriptedPawn questions
I am making a Terrorist actor that sub-classes ScriptedPawn. I can make him play animations, give him a gun, and make him die when shot enough.
How can I make him do the following?:
1.) Detect that the player is in his FOV
2.) Turn towards the player (the compiler doesn't allow it in any of my functions)
3.) Aim at the player at look like it's doing so
4.) Shoot at the player until he's dead or out of view
5.) Find the best path to a given actor
6.) AND, find a hostage with a given tag
Do I have to use states? If so, how?????
Thanks in advance,
|1st Jan 2002, 10:50 PM||#2|
Hey, I plan to do soemthing similar, when I start, I try to contact you.
|2nd Jan 2002, 03:05 PM||#3|
1) Normal(OtherPlayer.Location - Location) dot vector(ViewRotation) > someFloatValue
2) maybe TurnTowards(anActor), this is a latent function so it can only be used in state code, not in functions
3) I think that should be an animation
4) dunno, have a look at Botpack.Bot
5) also look at Botpack.Bot and the FindSpecialAttractionFor() function in Botpack.CTFGame
6) same like 5)
I guess you've got to use lots of states like other ScriptedPawns and UT's Bots.
|2nd Jan 2002, 07:44 PM||#4|
Join Date: Jan. 1st, 2002
1.) Your first response... What is it for, and exactly what is the syntax? It has interested me. Isn't there a bPlayerInView variable somewhere? SeePlayer doesn't seem to get called.
2.) TurnTo(Player.Location) doesn't seem to work, even inside state code. Is there a way to accomplish this using plain math?
3.) It IS an animation!! Thank you!
4.) Yeah, I'll take a peek at that. Thanks.
5.) Isn't there a FistBestPathTo(actorName) inside ScriptedPawn? Anyway, I'll take a look at that.
6.) I looked. The Mod Developer's guide at unreal.epicgames.com has a way to perform functions with a desired actor.
THANKS FOR ALL YOUR HELP!!
|12th Jan 2002, 06:38 PM||#5|
This is the dot product of two vectors: "Other.Location - Location" is the vector starting at the location of the actor this function is called from and ending at the location of actor Other. Normal() returns a vector with the same direction but a length of 1 Unreal unit. vector(ViewRotation) is a vector of length 1 pointing in the same direction as the rotator ViewRotation. The dot product of these two vectors can be:
> 0 (the vectors somewhat point in the same direction with a value of 1 indicating exactly the same direction)
< 0 (the vectors point in opposite directions, again -1 means exactly the opposite direction)
== 0 (both vectors form an angle of exactly 90°)
(I hope this is what you wanted to know)#
You could use Tick(), Timer() or state code with Sleep() to change the Rotation property (maybe with some vector math if you're not used to rotators.)
|19th Jan 2002, 01:02 PM||#6|
Normal(OtherPlayer.Location - Location) dot vector(ViewRotation) > someFloatValue
does the bot have to be looking dirctly at the OtherPlayer, or does the some FloatValue indicate a variance? I want
"Detect that the player is in his FOV "
but like a cone.....
Im not sure if I said that right
Call me Erdrik
Boycott Fox!!! Down with the Evil Overlords!