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

Check a neighboring zone for players (solved)

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

Check a neighboring zone for players (solved)

Post by gopostal »

I'm having trouble getting this to work and I can't find an example in code to follow. There's for sure an easy solution but it's opaque to me.

I created a mod that makes several unique zone actors and I placed them into a map. Imagine three rooms in a row A>B>C, each with a unique zone actor in them. Say (RoomZone) RZA, RZB, RZC.

I need to know if there is a player in RZA and RZB but not RZC. I am almost there in using

Code: Select all

      if((Self.ZonePlayerCount == 0) && (RZB.ZonePlayerCount == 0))

in the code of RZA but the casting to RZB to check for players there fails. I know I could ForEach my way across this but is there a more elegant way?

Edit: I'm sorry guys, my brain decided to just stop working. I got it:

Code: Select all

local RZB RZB1;

      if((Self.ZonePlayerCount == 0)  && (RZB1.ZonePlayerCount == 0))
Like always, the act of typing out the question often solves it for you right directly after hitting [POST].
Last edited by gopostal on Mon Sep 11, 2017 12:46 am, edited 1 time in total.
I don't want to give the end away
but we're all going to die one day

Return to “UScript Board”