Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   MUDlib (https://forums.graalonline.com/forums/showthread.php?t=71292)

ArushenP2P 01-06-2007 06:27 PM

MUDlib
 
Can someone post a tutorial link or care to get me started on how to make a
mudlib system?

Angel_Light 01-07-2007 07:50 AM

Same here, can someone explain it in detail aswell or point us to thread that will.

Twinny 01-07-2007 08:16 AM

http://forums.graalonline.com/forums...=1#post1262165

Look at the mud system Thamhic used.

ArushenP2P 01-07-2007 10:38 AM

It still don't teach me the exact thing about mudlibs and how to make them.

Angel_Light 01-07-2007 12:11 PM

Sort of helps, thanks

projectigi 01-14-2007 01:47 AM

yeah an articles covering:
Quote:

-basic mudlib idea
-what fields?
sure an item is like name, description
but then like bonuses, whats smarter?
bonus.str = 3
bonus.int = -2
or bonus = {"str", 3}, {"int", -2 }

etc
would be nice =/

Chompy 01-14-2007 06:53 PM

Quote:

Originally Posted by projectigi (Post 1264630)
yeah an articles covering:

would be nice =/

PHP Code:

function onCreated()
{
  array = { 
"str"2"int", -1"dex"1"luck"0};
  for( 
08+= 2;)
    echo( array.
subarrayi2));


Outputs:

str,2
int,-1
dex,1
luck,0

projectigi 01-14-2007 10:36 PM

huh?

Chompy 01-14-2007 11:23 PM

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.

Inverness 01-14-2007 11:40 PM

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(":");

ApothiX 01-15-2007 03:57 PM

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.

Admins 01-15-2007 04:07 PM

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.

Inverness 01-16-2007 02:02 AM

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.

Angel_Light 01-16-2007 02:29 AM

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?

Inverness 01-16-2007 02:46 AM

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.