Runtime Error 91

So getting an error here.

I’ve been developing a project for many years now. It is a heavily modified version of Mirage Source, and I’ve recently attempted to update the networking system to use packet buffers.

However, after doing the conversion, I’m getting this error when I try to connect: Runtime Error 91: Object variable or With block variable not set.

It highlights the following line of code within Sub IncomingData:

TempPlayer(index).buffer.WriteBytes buffer()

Any help would be appreciated. Thanks.

either TempPlayer or the .buffer variable has not been initialized

I’ve copied everything over from Skywyre so not sure what I’m missing here


I’m just wondering. In my source, I have a lot of “player(index).”, where as in SkyWyre it uses "TempPlayer(index)."

Should I replace these and use TempPlayer? Do you think that’s what the issue is, because TempPlayer doesn’t hold any value as it’s never set?

If you have not already added this then make sure you add
Set TempPlayer(Index).Buffer = New clsBuffer
to the Sub ClearPlayer as that will initialize the buffer for use.

No it’s still producing the error. Would it be affected now that I’ve added multiple characters per account?

Multiple character’s does not mean an edit to this sub/line

Make sure you have the correct Enums in the correct order at a guess. And if it was originall player(index)…. then change it back and test?

Well, what I have is Player(Index) which uses the AccountRec (TempPlayer on Skywyre), and Player(Index).Char(x) which uses the CharacterRec (or whatever it is) I’ve checked over both sources to ensure that it’s right and it seems to be correct, just not sure why it’s producing this error.

Log in to reply