Top Mud Sites Forum

Top Mud Sites Forum (http://www.topmudsites.com/forums/index.php)
-   MUD Builders and Areas (http://www.topmudsites.com/forums/forumdisplay.php?f=8)
-   -   OLC for LPC? (http://www.topmudsites.com/forums/showthread.php?t=196)

tehScarecrow 11-15-2004 08:47 PM


Ogma 11-16-2004 01:36 AM

Yeah, my OLC for LPC is called emacs and scp, but you could probably use vi, or kate or even notepad.

And 'snippets' are a DIKUivative thing, not lpmud.

tehScarecrow 11-16-2004 09:24 PM

Well, I meant online room creation, so that I don't have to use notepad, pico etc. to make rooms.

kaylus1 11-17-2004 01:18 AM

While there aren't any that I know of, of the top of my head at least, it is not anything hard to do. If there were any out there, though, they would be suited to the mudlib they were created for an would require a small amount of LPC to change them to work with your mudlib.

That being said, the small amount that you would need to know would probably be only slightly less than the amount needed to create your own online building tools. Again, it is all very dependent on what mudlib you are running.

Althought the word 'snippet' may be a DIKUivative thing, as Ogma put it, there are many pieces of code about the net, areas, lockers and pawnshops, guild objects. Quite a few are written for older 2.4.5 code though and would require substantial knowledge of your own mudlib to convert them.

I constantly convert ideas from DGD, Amylaar and MudOS mudlibs between each other and even over to Pike language just for fun and it also helps hone my skills in dealing with more complex issues in my own code.

I am going to assume you are using a fairly new mudlib and decent driver and that your mudlib supports 'bin'-type commands (i.e. /cmds/player, /cmds/ghost, etc). So what you will need to do is start looking at these and start by making a simple hello world command.

After you complete that successfully start looking at other code and learn how to use the input_to efun, which allows you to redirect input to a function, then you can make an interactive command, i.e. to ask a user input.

After that it's all downhill, and the rest is how you want to make it. Do you want the command to create the object and save it as pure data so that it can be loaded with a load_object type of efun? Or do you want the command to write out the code into a .c file so that it appears as any hand-written room would?

If you choose the first just clone your object type you are creating, have the users input define the properties and use a save_object, voila. If you choose the latter, then have the program collect all the data (name, short, long, etc) and at the end of the input have it write_file it to the appropriate file (in LPC).. i.e.

[code]
string short_desc, long_desc;
int armor;
....
code to get input here
....
void write_out() {
  string buf;

  buf = "/* Auto Room */\ninherit ARMOR;\nvoid create() {\n";
  buf = sprintf(buf, "%s    set_short(\"%s\");\n", buf, short_desc);
  buf = sprintf(buf, "%s    set_long(\"%s\");\n", buf, long_desc);
  buf = sprtinf(buf, "%s    set_armor(\"%s\");\n}", buf, armor);

  write_file("/domain/fooland/fooarmor.c", buf);
  write("Armor done!\n");
}
[/quote]

That is just an example and will vary depending on mud/driver combinations, and there are many different things you will have to decide. Do you want the command to build all things, or are you going to make seperate commands for different object types. How are you going to make sure that someone doesn't use the command at the same time and overwrite variables? How about giving the command permissions to write in certain directory? What if...? What if...?

All of them are easy problems to overcome, I have such code on my mud, different commands for building different things with a menuing system built. It takes time, but in the end you will come out better for having even attempted it.

Best of Luck,
Kaylus

rotm_adm 11-18-2004 01:44 PM


Ogma 11-18-2004 06:59 PM

Oh...you want Online. In that case I use ed.


All times are GMT -4. The time now is 12:00 PM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Top Mud Sites.com 2022