Blockland Forums > Modification Help
Iban Explains it All
<< < (37/39) > >>
Iban:
I don't even know what version of CityRPG you have and I can't remember how I did clothing back then. I think outfits listed specific nodes and their corresponding color ID on the array is what painted it. There were exceptions for things like "skin" and "gender" but for the most part it was raw input.

I just reread your post and it's more focused on the instantination of a new profile when a client enters the server. Look at sassy.cs (or don't because sassy is loving terrible) and find the functions called in package.cs in GameConnection::onClientEnterGame.
heedicalking:

--- Quote from: Iban on May 16, 2011, 08:01:33 PM ---I don't even know what version of CityRPG you have and I can't remember how I did clothing back then. I think outfits listed specific nodes and their corresponding color ID on the array is what painted it. There were exceptions for things like "skin" and "gender" but for the most part it was raw input.

I just reread your post and it's more focused on the instantination of a new profile when a client enters the server. Look at sassy.cs (or don't because sassy is loving terrible) and find the functions called in package.cs in GameConnection::onClientEnterGame.

--- End quote ---
Do you have any databases you would recommend using? I just realized scriptojects are much more efficient for storing data and using it than arrays or any variable type. I have attempted creating saving systems that used local and global variables assigned for players and it was just a mess. I would like to be able to use a database and experiment before I go writing my own.
Nexus:
I have used this in the past to store data:


--- Code: ---function CreateDataSO()
{
if(isObject(DataSO))
DataSO.delete();

if(isFile("config/server/SaveData.cs"))
exec("config/server/SaveData.cs");

if(!isObject(DataSO))
new ScriptObject(DataSO){};

for(%a=0; %a<ClientGroup.getCount(); %a++)
LoadData(clientgroup.getobject(%a));
}

function SaveData(%cl)
{
if(!isObject(DataSO))
CreateDataSO();
DataSO.SaveData[%cl.bl_id] = %cl.info TAB %cl.name;
DataSO.Save("config/server/SaveData.cs");
}

function LoadData(%cl)
{
if(!isObject(DataSO))
return CreateDataSO();
%path = DataSO.SaveData[%cl.bl_id];

if(%path $= "")
DataSO.SaveData[%cl.bl_id] = 0 TAB %cl.name;
%cl.info = getWord(%path, 0);
//would of course be repeated for more information loading
}

function DeleteData(%cl)
{
if(!isObject(DataSO))
CreateDataSO();
DataSO.SaveData[%cl.bl_id] = "";
SaveData(%cl);
LoadData(%cl);
}
--- End code ---

I haven't really tested this, but it should work fine.
heedicalking:
it doesn't really look like it would work at all?
Nexus:

--- Quote from: heedicalking on May 16, 2011, 08:51:10 PM ---it doesn't really look like it would work at all?

--- End quote ---

what, why?  It works fine so far.   This is a question?
Navigation
Message Index
Next page
Previous page

Go to full version