Game Development Community

Exec-ing player.cs at mission load time?

by Mike Stoddart · in Torque Game Engine · 07/24/2002 (2:00 pm) · 5 replies

I've modified my game to exec the player.cs file (and other player files) inside sendLoadInfoToClient in missionInfo.cs.

Can anyone see any potentially negative side effects of doing this?

It *seems* to be working fine (note the emphasis), but that's no guarantee that it's problem free.

Thanks

#1
07/24/2002 (2:38 pm)
I haven't looked very carefully, but does this mean player.cs will get exec-ed every time the mission cycles?

I'm not sure if:
a) that doesn't happen anyway (but i don't think it does)
or b) it causes a problem,

It's just what immediately occured to me.
#2
07/24/2002 (3:08 pm)
Yes I guess so. Basically, in the mission file, I specify which player classes (i.e. player script files) should be loaded for that mission. Each mission will use different classes, and they won't necessarily use all of them.

I guess there's no way to un-exec a script file? Thought not!

So if a script file is execed twice, would that cause any problems?

Thanks
#3
07/24/2002 (3:28 pm)
I don't know if it will cause a problem, but just because you don't want some classes in a mission doesn't mean you shouldn't load them. I would have thought that it would be better to restrict the player's class options elsewhere.

But I'm not particularly up on these bits, so don't take me too seriously ;)
#4
07/24/2002 (3:41 pm)
Maybe I'm trying to be too clever for my own good. :P

Hmmmm
#5
07/24/2002 (10:07 pm)
I am not 100% sure mike about this mike, but from memory...

At mission load (or client join) the server sends the datablocks to the client in the sendLoadInfoToClient command.

This means that playing in a single player game this would seem to work fine but a remote client would die badly. You get a similiar problem if you do the following:

Have multiple clients on a server and then change the player datablock run settings on the server. The server player values will speed up but the remote clients will not be updated with the new info so you get nasty sync errors.