Game Development Community

Dedicated Server Datablocks

by Robert Stewart · in RTS Starter Kit · 02/25/2005 (6:16 pm) · 9 replies

I have a server setup so it creates some units, like riflemanBlock it works fine when i host with the graphical server thing, that is just like the client one. But when i use the dedicated one it says riflemanBlock is not a member of GameBaseData. thanks

#1
02/26/2005 (1:17 am)
Sounds like the problem that Stephen Zepp explains a solution to at:
http://www.garagegames.com/mg/forums/result.thread.php?qt=23223
if not let us know and we can keep looking.
#2
02/26/2005 (3:30 pm)
Hmmm, i dont think that is the same problem because... i have function RTSConnection::createPlayer(%this, %spawnPoint, %index)
{
switch(%index)
{
case 0:
%data = riflemanBlock;
case 1:
%data = Block;
case 2:
%data = Block;
case 3:
%data = Block;
}
in the server gameConnection.cs file. and i dont think it is getting any input from clients at this point. also it gets the index right, so it recieves %index = 0; and then it says that riflemanBlock is not a member of GameBaseData, thanks for the link though.
#3
02/26/2005 (3:54 pm)
There were some inconsistencies in how datablocks were loaded server side when we moved to a pure dedicated client setup--mostly because when you run dedicated, it does not load in anything that is in the /client directory.

Additionally, I've been popped before with a similar error that seemed to get fixed by making sure that:

A) my files that defined the datablocks were exec'd in on the server,

B) they were exec'd in in the correct order (after GameBaseData is loaded in, and after UnitBaseBlock is loaded in).

C) Fiddling around with the order until it doesn't report the error any longer,

D) Making sure everything was spelled correctly (doesn't appear to be the problem in this case, but you didn't give us all of the scripts, so it's something to check).

Sorry I couldn't give an exact fix--this was a long time ago.
#4
02/26/2005 (4:42 pm)
When exactly does GameBaseData and UnitBaseBlock get loaded?, also it looks like the standard configuration of init.cs has all the datablocks been executed, such as rifleman.cs.
#5
02/26/2005 (5:07 pm)
EDITed
#6
03/23/2005 (3:40 pm)
Ok renewing this because I still cant get this to work. Ive tried loading scripts from the client onto the server, no difference. Any other ideas? Thanks for any help.
#7
04/01/2005 (5:25 am)
This seem to happen when rifleman.cs isn't executed in the right place. Doing it just in init.cs doesn't work. You have to include
exec("~/server/scripts/avatars/rifleman.cs");
also inside
server/scripts/core/game.cs - function onServerCreated()
#8
04/01/2005 (10:59 am)
It appears it is been executed in there too, as exec("~/server/scripts/avatars/rifleman.cs");

Here is my order for game.cs
exec("~/server/scripts/audio/audioProfiles.cs");
   exec("~/server/scripts/audio/player.cs");
   exec("~/server/scripts/fx/player.cs");
   exec("~/server/scripts/avatars/base.cs");
   exec("~/server/scripts/avatars/pathManager.cs");
   exec("~/server/scripts/avatars/player.cs");
   exec("~/server/scripts/avatars/1.cs");
   exec("~/server/scripts/avatars/2.cs");
   exec("~/server/scripts/avatars/3.cs");
   exec("./centerPrint.cs");
   exec("./commands.cs");
   exec("./game.cs");
   exec("./centerPrint.cs");
   exec("./commands.cs");
   exec("./gameConnection.cs");
   exec("~/server/scripts/avatars/rifleman.cs");
   exec("./item.cs");
   exec("./radiusDamage.cs");
   exec("./shapeBase.cs");
   exec("./teams.cs");
   exec("./triggers.cs");
   exec("./weapon.cs");
   exec("./buffs.cs");
   exec("~/server/scripts/globals.cs");
   exec("~/server/scripts/items/camera.cs");
   exec("~/server/scripts/items/crossbow.cs");
   exec("~/server/scripts/items/staticShape.cs");
   exec("~/server/scripts/items/building.cs");
   exec("~/server/scripts/1/1.cs");
And init.cs
exec("./scripts/audio/audioProfiles.cs");
   exec("./scripts/audio/player.cs");
   exec("./scripts/fx/player.cs");
   exec("./scripts/fx/environment.cs");
   exec("./scripts/core/centerPrint.cs");
   exec("./scripts/core/commands.cs");
   exec("./scripts/avatars/base.cs");
   exec("./scripts/avatars/player.cs");
   exec("./scripts/avatars/8.cs");
   exec("./scripts/avatars/7.cs");
   exec("./scripts/avatars/6.cs");
   exec("./scripts/avatars/5.cs");
   exec("./scripts/core/gameConnection.cs");
   exec("./scripts/core/item.cs");
   exec("./scripts/core/radiusDamage.cs");
   exec("./scripts/core/shapeBase.cs");
   exec("./scripts/core/teams.cs");
   exec("./scripts/core/triggers.cs");
   exec("./scripts/core/weapon.cs");
   exec("./scripts/core/stats.cs");
   exec("./scripts/core/buffs.cs");
   exec("./scripts/core/4.cs");
   exec("./scripts/core/3.cs");
   exec("./scripts/globals.cs");
   exec("./scripts/2/2.cs");
   exec("./scripts/1/1.cs");

   exec("./scripts/items/camera.cs");
   exec("./scripts/items/crossbow.cs");
   exec("./scripts/items/staticShape.cs");
   exec("./scripts/items/building.cs");
   exec("./scripts/core/game.cs");
   exec("./scripts/avatars/rifleman.cs");
   exec("./scripts/Units/rifleman.cs");
#9
04/13/2005 (8:38 am)
Hey when does gamebasedata get loaded? ive tried exec the rifleman.cs file everywhere.