Game Development Community

BDD Store information

by Versini Benjamin · in Torque 3D Beginner · 12/17/2013 (2:00 am) · 3 replies

Hi,

Im new in torque3D :) I have test to create an Multiplayer RPG and i have a read the docs. It's not indicated how to store information in BDD (Txt, SQl, xml or other) have you an exemple ? (It's for store information if server down...)

About the author

Recent Threads


#1
12/17/2013 (10:14 am)
Versini,

This is some old code that can give you idea of how to write to an existing text file.

==============================
function questCodexAppend(%quest, %progress, %missionQuest)
{

// Loaded in missiondownload on Client side


//Gets the File for appending

%file1 = new FileObject();

%fileSelector = "./CharacterQuestSaveFiles/QuestCodex.txt";

echo("questCodexAppend( opening Items for Append " @ %quest);


%fileName = expandFileName( %fileSelector );
echo( "questCodexAppend( Attempt to open " , %file1);
%fileIsOpen = %file1.openForAppend( %fileName);
echo( "questCodexAppend( Open for Append " , (%fileIsOpen ? "succeeded" : "failed" ) );

if( %fileIsOpen ) {

%file1.writeLine(%progress @ " " @ %quest @ " " @ %missionQuest);
}

%file1.close();
%file1.delete();
schedule(500, 0, questCodexWriteTemp);
}
#2
12/17/2013 (10:19 am)
Yes, it's perfect for an prototype :) (If my prototype is good, I think to go in source of Torque to integrate the sql and add script function for connect, requete...)

(Sorry for my bad english, im french)
#3
12/17/2013 (11:49 am)
Versini,

I am glad it will help you. The SQL integration is something that I will need to implement as well when the time comes. It is hard to make RPG's but it is an amazing learning experience.

Good luck!