For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

How to determine if a PlayerPawn is looking at something.

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
スマイル・ドラゴン
OldUnreal Member
Posts: 1263
Joined: Sun Feb 10, 2008 9:07 pm

How to determine if a PlayerPawn is looking at something.

Post by スマイル・ドラゴン »

I'm redoing a mod I lost when my harddrive got misplaced, it features deadly versions of decorations that attack players by slowly scooting their way to them and detonating violently when close enough but only if they aren't being looked at. If they are looked at then they behave like normal decorations and can be pushed around by the player harmlessly.

How would I go about detecting this? I can't use "PlayerCanSeeMe()" due to a bug that causes the check to return true if your back is completely turned against the actor. So I need a way of determining if a PlayerPawn is rotated towards the actor within 180 degrees of view.
“I am the dragon without a name.”
Ðàrk-_¦_-Ñïght.: / κυνικός Δράκων / スマイル・ドラゴン / Draco Nihil
User avatar
[]KAOS[]Casey
OldUnreal Member
Posts: 4497
Joined: Sun Aug 07, 2011 4:22 am
Location: over there

Re: How to determine if a PlayerPawn is looking at something.

Post by []KAOS[]Casey »

Last edited by []KAOS[]Casey on Wed Nov 02, 2016 10:06 pm, edited 1 time in total.
User avatar
スマイル・ドラゴン
OldUnreal Member
Posts: 1263
Joined: Sun Feb 10, 2008 9:07 pm

Re: How to determine if a PlayerPawn is looking at something.

Post by スマイル・ドラゴン »

Random question: If I was using UT99, how fast is "FastTrace()"?
“I am the dragon without a name.”
Ðàrk-_¦_-Ñïght.: / κυνικός Δράκων / スマイル・ドラゴン / Draco Nihil
User avatar
[]KAOS[]Casey
OldUnreal Member
Posts: 4497
Joined: Sun Aug 07, 2011 4:22 am
Location: over there

Re: How to determine if a PlayerPawn is looking at something.

Post by []KAOS[]Casey »

far as I know, all fast trace does is check for BSP, and would not hit if actors were in the way. It is faster since it's ignoring the possibility of hitting actors, but I wouldn't really consider using it unless you're doing a lot of traces, or if you only need to trace BSP. In your case, if you wanted to be safe, fast trace would be the way to go.

Also note you can do foreach traceactors and ignore all actors that aren't A == Level But that's obviously slower since it goes in/out of uscript for each actor it finds.

Return to “UScript Board”