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 filter to only return vertical walls

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
Post Reply
User avatar
gopostal
OldUnreal Member
Posts: 1005
Joined: Thu Jul 31, 2008 9:29 pm

How to filter to only return vertical walls

Post by gopostal »

Let me give a bit of "why": in the game I'm trying to emulate there are random graffiti sprays on houses and walls spread across the map. I'd like to mimic that effect and I plan to use the following method...

I'll pick four or five random pathnodes at the beginning of the game. At those places I'll spawn a projectile that will random direction out until it hits level. This part I've already done but I'd like to further filter the returns so it spawns the graffiti on 90 degree vertical walls. Would you think it was a better method to return the orientation of the surface or search for the group of the texture and only apply it to ones that have "wall" as the group?

Or is there just a better random surface method that I'm not considering?
I don't want to give the end away
but we're all going to die one day
User avatar
Feralidragon
OldUnreal Member
Posts: 239
Joined: Thu Jul 24, 2008 6:57 pm

Re: How to filter to only return vertical walls

Post by Feralidragon »

If you do a trace or if you use a projectile, one of the vectors that you get from hitting a wall is HitNormal, which is a vector which indicates the surface direction.

Therefore, all you have to do is to check if the Z axis of HitNormal is zero, or at least very close to zero due to floating point arithmetic errors which may result in a HitNormal.Z to become slightly different from zero even with perfectly full 90º vertical walls.
Last edited by Feralidragon on Fri Mar 30, 2018 3:10 pm, edited 1 time in total.
User avatar
gopostal
OldUnreal Member
Posts: 1005
Joined: Thu Jul 31, 2008 9:29 pm

Re: How to filter to only return vertical walls

Post by gopostal »

Thank you! I'll try this across a few maps and see the results. I'm thinking I might have to further refine some checks because this seems an overly broad way I'm trying to do this.

Follow up: I was able to script this correctly and tested it across multiple maps. It looks good the vast majority of times so I'm pretty happy. Thank you Ferali!!
Last edited by gopostal on Fri Mar 30, 2018 5:52 pm, edited 1 time in total.
I don't want to give the end away
but we're all going to die one day
Post Reply

Return to “UScript Board”