![]() |
MUD's
I think it's time I've learned how to work with MUD databases/scripts... and I'm looking for someone to teach me. You can reach me whichever way possible, but I suppose an IM would be the best way to teach(and what I'd prefer). If you're willing to sit down with me and teach me the basics of how to work with MUD's and .ini's, go ahead and initiate here or in an IM. After that I will most likely always refer back to you for questions.
Thanks in advance! |
Well, there's different ways to make MUD's, but Inverness have taught me alot of what I can of MUDs :o
Well, for Ini files.. Make a wnpc or somewhere to store this script (To make custom objects): PHP Code:
("file_ini" as used above) PHP Code:
PHP Code:
NPC Code: All credits to Inverness though :p And I would suggest you to check out his two mudlibs that he released, it's worth learning from :) |
Well I plan on going through and making the ini objects manually... I just needed to know how to load data from them. Thanks!
|
Dusty, you still make the ini objects from scratch when using what Chompy posted here...it's just a database of sorts with which instances of objects can be copied from.
So what Chompy has there joins the class to blank object and you copy in script like so... PHP Code:
|
My maketype function was just to see if I could replicate object instancing like how its built-in.
It would probably be more manageable to do something like: PHP Code:
Also one can define public function objecttype(). I'd really like if there was a function onJoined() you could define just for classes that would be run the instant the class is joined and before the next class is joined. I'd also like a function onLeaving() that would be run when an object leaves the class; including when the object is destroyed. Graal would wait until onJoin() or onLeave() are completed before continuing(); Example: PHP Code:
Quote:
Quote:
I currently don't even use an object for each item anymore as arrays are easier to handle, though I may change that if I find a performance difference. |
Quote:
|
Quote:
|
Quote:
Anyways, Dusty, how's it going with the MUD? |
Great! I had a talk with Andrew and I've started from scratch. Instead of worrying about indexing each item on the server in a database, I've instead appended timevar2 onto the player's clientr.var for the weapon, and added it into the data. That way the only way to create a duplicate weapon would be if the the same weapon is created in the very same second. Also eliminates the need for indexing. When the item is dropped, it'll drop its unique index with it. I want to create something more advanced than just a timevar2 ID... but since it's being stored in a clientr.var, I'm trying to keep the size down... :/ If Stefan would fix the RC bugs that wouldn't be a problem.
|
Quote:
And it's good to hear that it's going great :) |
Setting attr's in RC with long clientr.vars will cut the longer clientr.vars if they exceed a certain character limit.
|
Quote:
To bad that Stefan didn't do anything about it back then.. |
I simply used a serverr.muditemcounter integer to give items IDs. However I just index items per object like you would in an array. I suggest you just do it like that unless you have a reason why every item in existence needs its own ID.
Fancy IDing systems are just a hassle. |
| All times are GMT +2. The time now is 04:09 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.