MUDlib
Can someone post a tutorial link or care to get me started on how to make a
mudlib system? |
Same here, can someone explain it in detail aswell or point us to thread that will.
|
|
It still don't teach me the exact thing about mudlibs and how to make them.
|
Sort of helps, thanks
|
yeah an articles covering:
Quote:
|
Quote:
PHP Code:
str,2 int,-1 dex,1 luck,0 |
huh?
|
Was just an example, array can be good, if you know a good way to get info from it. Else normal variables should be fine.
|
I prefer to use some other character to divide the values.
So bonus would be: "str:3:luk:3" Then we use itemarray[index].tokenize(":"); |
The way I did it was something like:
temp.stats = { "str=10", "dex=6", .. }; temp.player_stats.loadvarsfromarray(temp.stats); echo("Str: " @ temp.player_stats.str); Not sure of the exact function name, but it was something like that. It can all be found in the link Twinny posted, in the 'mudclient' and 'mudfunctions' classes. |
The way it is done on Kingdoms is to separate each part of the mudlib and use the best way to implement it:
- The items are some kind of TStaticVar, real objects, using normal variable names - When saving or loading you can write your own function to make the file look good (separate file for each player) - For displaying the items on clientside you write a function which takes the visible items and useful item attributes (e.g. name, icon) and set some client. strings; this function is called each time an item is changed or modiified - For being able to communicate between server and client you assign each object you create an unique id which only works as long as the server is up (should not be saved) (client.mud_item123 on clientside, player.items[0].id==123 on serverside) - The available item types are stored in archetypes; when saving an item of the player then you only save the differences between the current item and the original archetype to minimize the file size and to make it possible to change the archetype without changing each player item file (changing the icon of the archetype will change the icon for all item instances in players inventories except for items that got an unique icon (icon has been changed)) It would probably be good if there would be some item system which can be used on each server, I have not checked yet the zip that has been attached though. |
Are this TStaticVar objects clientside or serverside?
I don't think i'm satisfied with the mudlib I made, i'm thinking of a way to make a general data-handling system that could be applied to items and many other things. |
This could a very newbish question but where are the actual vars for the MUDitem itself stored, is it stored in a folder in the file browser maybe or some class?
|
In folder in filebrowser.
|
All times are GMT +2. The time now is 12:24 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.