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

SetLocation online kills audio?

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
Post Reply
User avatar
Bleeder91[NL]
OldUnreal Member
Posts: 1062
Joined: Sun Oct 04, 2009 7:22 pm

SetLocation online kills audio?

Post by Bleeder91[NL] »

So I have this custom Teleporter item that teleports a player back and forth between two actors. For some reason going from one end to the other causes the audio to go silent when you move away from it, as if your ears are still standing back there. Any clue as to what causes this (OpenAL, Online dedicated)?
It's pretty much just a setlocation and all the setrotation from Teleporter, except I slammed it into a pawn for the postrender2d.
Image
User avatar
gopostal
OldUnreal Member
Posts: 1005
Joined: Thu Jul 31, 2008 9:29 pm

Re: SetLocation online kills audio?

Post by gopostal »

I've used that method a bunch without issues. In fact I had a whole map that used personal teleportation with this method so players could have their own houses in a clan village. I never saw any oddness like this.

If you want you can test it on my server? Maybe it's something weird in your particular setup. Sounds like the server and the client don't agree on the location data.
I don't want to give the end away
but we're all going to die one day
User avatar
Bleeder91[NL]
OldUnreal Member
Posts: 1062
Joined: Sun Oct 04, 2009 7:22 pm

Re: SetLocation online kills audio?

Post by Bleeder91[NL] »

It really is the strangest thing, because it doesn't look like a client-server desync. It's a complete chaos once you go out of default playsound radius because AI will stop hearing/seeing you, BUT they can still attack you when you shoot them and they can still hit you in your current location. Additionally chat messages don't go through anymore.
Last edited by Bleeder91[NL] on Sun Jan 13, 2019 1:35 pm, edited 1 time in total.
Image
User avatar
Bleeder91[NL]
OldUnreal Member
Posts: 1062
Joined: Sun Oct 04, 2009 7:22 pm

Re: SetLocation online kills audio?

Post by Bleeder91[NL] »

Might as well share the code:

Code: Select all

//=============================================================================
// Warpfield. Spawned via an inventory item.
//=============================================================================
class Warpfield expands Pawn;

var Warpfield OtherEnd;

var transient float LastUdpTime;
var transient byte TeleportCount;

var PlayerPawn POwner;

Replication
{
      Reliable if(Role==ROLE_Authority&&bNetInitial) POwner;
}

simulated event PostRender2D(Canvas C, vector Pos)
{
      local PlayerPawn P;
      local float XL,YL;
      local float Dist;
      
      P=Level.GetLocalPlayerPawn();
      if(Health5) return; else TeleportCount++; }
            else { TeleportCount=0; LastUdpTime=Level.TimeSeconds; }
            
            if(!Other.bCanTeleport) return; else if(!bool(OtherEnd)) { Destroy(); return; }
            if(!bool(PlayerPawn(Other))||PlayerPawn(Other).Health
Image
User avatar
gopostal
OldUnreal Member
Posts: 1005
Joined: Thu Jul 31, 2008 9:29 pm

Re: SetLocation online kills audio?

Post by gopostal »

Why are you doing it like this?

Code: Select all

TeleC.ClientSetLocation(OtherEnd.Location+Offset,OtherEnd.Rotation);
I'm the first to admit that there's a ton of 227 that I'm not familiar with but it seems to me like you'd want the server to do the SetLocation here and not the client. Swap this out for a normal SetLocation command and I'll bet that fixes you. It explains the weird desync too.
I don't want to give the end away
but we're all going to die one day
User avatar
Bleeder91[NL]
OldUnreal Member
Posts: 1062
Joined: Sun Oct 04, 2009 7:22 pm

Re: SetLocation online kills audio?

Post by Bleeder91[NL] »

Nah, I do a normal setlocation before that. The reason I use that function is because afaik it's unused, so I use that to replicate some client-side stuff that should happen in the HUD.
I'm starting to think the problem is deeper than just the teleporter, I now have the issue happening when I ghost around the map for a bit when suddenly it does the same thing. The teleporter's the only thing that can force this behaviour though...
Changing sound device didn't work either.
Image
User avatar
gopostal
OldUnreal Member
Posts: 1005
Joined: Thu Jul 31, 2008 9:29 pm

Re: SetLocation online kills audio?

Post by gopostal »

I did a test map locally with a version of your code and didn't have a problem. I had to change more than I'd like though so I'm not sure how valid my local test was.

You should write a mod that logs location from the server side and from the client too and see if they agree. At least you'd be able to see when it happens if they aren't in sync.
I don't want to give the end away
but we're all going to die one day
User avatar
Bleeder91[NL]
OldUnreal Member
Posts: 1062
Joined: Sun Oct 04, 2009 7:22 pm

Re: SetLocation online kills audio?

Post by Bleeder91[NL] »

I've finally managed to pinpoint the problem to this right here:

Code: Select all

Teleport:
      While(!SetLocation(Owner.Location+Owner.CollisionRadius*VRand()*vect(1,1,0))) Sleep(1.0);
      GoTo'Begin';
A part of my Minion's state that teleports it to the owner once out of range. I'm 100% sure this worked just fine but for some reason it no longer does and instead locks up the player's audio, chat system and whatnot. And ONLY during net play. Is this 227 or is this something I did or did I not give enough info? Anyone an idea?
Image
User avatar
Bleeder91[NL]
OldUnreal Member
Posts: 1062
Joined: Sun Oct 04, 2009 7:22 pm

Re: SetLocation online kills audio?

Post by Bleeder91[NL] »

Fixed the problem, I used a customized destroyed() on the pawn which was missing RemovePawn(). I guess that really screwed up the pawnlist because weird shit happened. Oh well, another thing learned. :)
Image
Post Reply

Return to “UScript Board”