Game Development Community

Dynamic Interior Creation

by Mike Kuklinski · in Torque Game Engine · 12/04/2004 (12:46 pm) · 9 replies

Has anyone released a patch or anything along those lines that fixes the problem regarding client-side interiors?

When you create an interior on a server, any clients currently on CTD.

#1
12/12/2004 (7:13 pm)
Mike, I am looking for the same solution. If, however, you are looking to spawn interiors into a game from the client, I can point you in the right direction. How specifically are you wanting to create the interiors?
#2
12/13/2004 (1:25 pm)
I want the server to be able to do like new Interior(bleh) and not crash every client.
#3
12/13/2004 (2:05 pm)
I put something like this in starter.fps/server/scripts/commands.cs:

function serverCmdcreateObject(%client)
{

%position = "0 0 240"; // location
%rotation = "1 0 0 0";  // rotation
%name = "starter.fps/data/interiors/interiorfile.dif"; 
// make sure to put in a proper file name

	%newobj = new InteriorInstance()
   	{
      	position = %position; 
       	rotation = %rotation; 
      	scale = "1 1 1";
      	interiorFile = %name; 
      	showTerrainInside = "0";
   	};
	
	MissionGroup.add(%newobj);
	
}



Then somewhere in your client side scripts call this:
(I put mine in starter.fps/client/scripts/playGui.cs and call createObject from a GUI Button)

function createObject(){
          commandToServer('createObject', "");
}

This way you can call createObject(); from anywhere on the client and it will send the message to the server to create the object on the server and subsequently to all the clients connected. In order to save the changes to the game mission once you create the new object you will need to saveMission(); somewhere in the server side scripts.

Good Luck!
#4
12/13/2004 (2:41 pm)
Thats not what i want to do... I never said I wanted the client to tell the server to create that (note, I could have gotten that far quite easily)...

As I said previously, my issue is that when the server creates an interior, it crashes all the clients.
#5
12/13/2004 (2:59 pm)
@Mike
Are you sure the crash not comming from the interiorinstances onadd function ?
#6
12/14/2004 (10:55 pm)
You are aware that the crash is occuring due to interactions with the lightmap manager, yes?
#7
11/20/2005 (12:07 pm)
@Ben: Any way to get around this? I too would like to dynamically create interiors.

...I know, it's an old post...

-Tim
#8
11/20/2005 (12:12 pm)
You could remove the lighting that torque likes to do on interiors, and just implement your own dynamic lighting(or maybe use the lighting kit) for interiors. It is not that hard really. Although TSE features the ability to do this out of the box I think. Oh and Tim, I used that resource Attachable SceneObjects in Hierarchical.. and it works for moving interiors, we were discussing this before. However at the moment nothing can ride on the interior while moving, not very well anyway.
#9
11/20/2005 (12:20 pm)
@Robert: Thanks for the info. I've been following Anthony's resource thread too. I'm also following Simon Duggan AIMovingInteriors progress, hopefully we'll see that become a reality too.