Author Topic: Create Generic Datablocks?  (Read 5631 times)

I want to create some generic datablocks on server startup that could be used to send lots of static information to the client. Is there a way to do this?

RESOLVED: TorqueScript actually includes a datablock class called SimDataBlock for just this purpose! Reference: http://docs.garagegames.com/tge/official/content/documentation/Engine/Reference/classSimDataBlock.html
Also, here's some more on datablock classes: http://tdn.garagegames.com/wiki/TorqueScript_Quick_Reference_2#Current_Datablock_Classes_and_associated_Object_Classes
« Last Edit: October 01, 2014, 12:25:04 AM by Greek2me »

Wait, so if you make a simDatablock, and assign values to it, it will be sent to the client when they load, with the values? I have pondered about this a few times for syncing client and server objects.

What's the point though? Why not send those values through clientcmds?

What's the point though? Why not send those values through clientcmds?

I'm thinking about using them for sending lots of information about default game mode settings, like this:
Code: [Select]
datablock SimDataBlock(Slayer_GameModeData)
{
// Game mode settings
className = "CTF";
name = "Capture the Flag";
useTeams = true;
useRounds = true;

// Default minigame settings
// Anything not defined here will use global defaults
default_title = "test CTF minigame";
default_weaponDamage = false;

// Locked minigame settings
// Cannot be changed.
locked_playerDatablock = nameToID("PlayerStandardArmor");

// Teams
teamCount = 1;

// Prevent team from being deleted
team0_disable_delete = true;
team0_disable_edit = false;

// Default team settings
team0_default_name = "Red";
team0_default_botFillLimit = -1;

// Locked team settings
team0_locked_color = 0;
};
There could be hundreds of values within this datablock.

It's much more difficult to send an entire object with server/client commands.
« Last Edit: October 01, 2014, 07:43:36 AM by Greek2me »

This will be very interesting.

I thought this was going to be "Create Generic Databases" and I was going to suggest Sassy or something like that.

« Last Edit: October 01, 2014, 10:56:33 AM by Ipquarx »