Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - quixadhal

Pages: 1 2 3 [4]
46
Code Vault / Buzzzzzz.....
« on: March 13, 2009, 11:47:59 PM »
This is my old mosquito NPC from Nightmare 3.3, back in 1995.  It was amusing.  My co-wizards didn't like it much...

Code: [Select]
inherit "/std/monster";

create() {
  set_name("mosquito");
  set_id( ({ "mosquito", "bug" }) );
  set_short("A bloodsucking mosquito");
  set_long("She is a nasty little bug, out for blood!\n");
  set("race", "bug");
  set_gender("female");
  set_alignment(-100);
  set("aggressive", 100);
  set_speed(30);
  set_moving(1);
  set_level(1);
  set_max_hp(15);
  set_hp(15);
  set_max_mp(100);
  set_mp(100);
  set_overall_ac(1);
  set_skill("defense", 60);
  set_stats("dexterity", 40);
  add_limb("head", "FATAL", query_max_hp()/2, 0, query_level());
  add_limb("torso", "FATAL", query_max_hp()+5, 0, query_level());
  add_limb("left front leg", "left front pincer", query_max_hp()/3, 0, query_level());
  add_limb("left front pincer", "", query_max_hp()/4, 0, query_level());
  add_limb("right front leg", "right front pincer", query_max_hp()/3, 0, query_level());
  add_limb("right front pincer", "", query_max_hp()/4, 0, query_level());
  add_limb("left centre leg", "left centre pincer", query_max_hp()/3, 0, query_level());
  add_limb("left centre pincer", "", query_max_hp()/4, 0, query_level());
  add_limb("right centre leg", "right centre pincer", query_max_hp()/3, 0, query_level());
  add_limb("right centre pincer", "", query_max_hp()/4, 0, query_level());
  add_limb("left rear leg", "left rear pincer", query_max_hp()/3, 0, query_level());
  add_limb("left rear pincer", "", query_max_hp()/4, 0, query_level());
  add_limb("right rear leg", "right rear pincer", query_max_hp()/3, 0, query_level());
  add_limb("right rear pincer", "", query_max_hp()/4, 0, query_level());
  add_limb("beak", "", query_max_hp()/4, 0, (query_level() + query_level()/4));
  add_limb("stinger", "", query_max_hp()/4, 0, query_level());
  set_fingers(2);
  set_wielding_limbs( ({ "front left pincer", "centre left pincer",
                         "front right pincer", "centre right pincer",
                         "beak", "stinger" }) );
  set_spell_chance(5);
  set_spells( ({ "missile", "shock" }) );
  set_chats( 15, ({ "Buzz.\n", "BUZZ!\n", "Hmmmmmmmm\n", "BZZZZZZZZZZ!!!\n" }));
}

void init() {
  if((int)this_player()->query_level() < 10 ) {
    if((string)this_player()->query_name() == "mosquito") return;
    this_object()->kill_ob(this_player(), 0);
  } else {
    switch((string)this_player()->query_position()) {
      case "arch":
      case "wizard":
        if(!random(20)) {
          call_out("god_death_1", 1, this_player());
        }
      break;
      default:
        say("An annoying mosquito dodges away from "+
            this_player()->query_cap_name()+".\n", this_player());
    }
  }
}

void god_death_1(object pl) {
  tell_room(environment(this_object()),
            "The nasty mosquito looks hungrily at the immortal "+
            pl->query_cap_name()+ ".\n");
  call_out("god_death_2", 5, pl);
}

void god_death_2(object pl) {
  tell_room(environment(this_object()),
            "The little bug imagines the sweet taste of "+
            pl->query_cap_name()+ "'s blood...\n");
  call_out("god_death_3", 4, pl);
}

void god_death_3(object pl) {
  tell_room(environment(this_object()),
            "The evil mosquito performs a kamakazi attack on the immortal "+
            pl->query_cap_name()+ "\nand gets a critical hit, "+
            "slaying the mighty god even as she dies in agony!\n",
            pl);
  tell_player(pl, "Bad luck for you!  The tiny mosquito "+
                  "commits suicide, but she gets a critical hit\nand "+
                  "takes you with her!\n");
  pl->quit();
  this_object()->remove();
}

void catch_tell(string str) {
  object ob;
  string who;

  if(!interact("enters", str)) return;
  sscanf(str, "%s enters%*s", who);
  who = lower_case(who);
  ob= present(who, environment(this_object()));
  if(!ob) {
    if(!interact("appears", str)) return;
    sscanf(str, "%s appears%*s", who);
    who = lower_case(who);
    ob= present(who, environment(this_object()));
  }
  if(!ob) return;
  if((int)ob->query_level() < 10 ) {
    if((string)ob->query_name() == "mosquito") return;
    this_object()->kill_ob(ob, 0);
  } else {
    switch((string)this_player()->query_position()) {
      case "arch":
      case "wizard":
        if(!random(20)) {
          call_out("god_death_1", 1, this_player());
        }
        break;
      default:
        say("An annoying mosquito dodges away from "+
            this_player()->query_cap_name()+".\n", this_player());
    }
  }
}

47
Intermud / IRC to I3 gateway?
« on: March 17, 2008, 01:11:33 PM »
This may have been asked before, so if my search skills are inferior, please point me to the right place. :)

I was perusing the release notes for the unreleased copy of Sapidlib, and noticed the lines towards the bottom which give IRC channels as contact information.  While I've used IRC before and have a dusty old client sitting around here somewhere, it occured to me that it would be much simpler if we had a gateway IRC bot which would pass things to and from an I3 (or IMC2 for that matter) channel and its matching IRC channel.

Thoughts, ideas, downloads, already have one running somewhere?

48
Drivers / LDMud driver option
« on: November 10, 2007, 10:09:43 AM »
I have a quick question about one of the driver options in LDMud that isn't quite clear from the documentation.

Code: (./configure --help) [Select]
  --enable-share-variables            default=disabled
        Enable clone initialization from blueprint variable values
Code: (/doc/driver/invocation) [Select]
      --share-variables
      --init-variables
        Select how clones initialize their variables:
          - by sharing the current values of their blueprint
          - by initializing them afresh (using __INIT()).

From reading the configure help, it sounds like the option causes the driver to copy the values of any blueprint object's variables into the clone immediately after creation.  However, after reading the document, I'm not sure if __INIT() is still called (if present) when using the share method.

If __INIT() is still called, it would provide a nice way to minimize special-case init code, as you'd only have to touch things you wanted to be different than the blueprint.  If it is not called at all, then that's a different beastie.

And yes, I'm treading a little ways down the dark path of creating my own mudlib... mainly because LDMud seems to be the only LPC driver which has solid support for PostgreSQL, and I'm toying with the idea of a game which keeps pretty much everything but rooms and code in a SQL database for ease of statistics and balancing.

49
Drivers / FluffOS and the dwlib package
« on: November 05, 2007, 07:51:06 PM »
Ok, so I'm attempting to get an old copy of the FR mudlib to start up again, and of course I'd like to run it under a new driver rather than hack and slash the old driver to get it to compile.

In adopting the local_options from the old fr distribution (which was based off discworld), I started compiling and ran into this error.

Code: [Select]
gcc -I../obj -I.. -D__USE_FIXED_PROTOTYPES__ -rdynamic -O2 -fstrength-reduce -o ../obj/dwlib.o -c dwlib.c
dwlib.c: In function 'f_reference_allowed':
dwlib.c:502: error: 'referrer' undeclared (first use in this function)

Of course, I looked and sure enough, referrer isn't defined.  That would normally not be a big deal, but here's the function:

Code: [Select]
void
f_reference_allowed()
  {
    svalue_t *sv = sp - st_num_arg + 1;
    svalue_t *v;
    object_t *referee = NULL;
    object_t *referrer_obj = command_giver; /* Default to this_player(). */
    const char *referrer_name = NULL;
    int result = 0;
    int num_arg = st_num_arg;
   
    /* Maybe I could learn how to use this :p
    CHECK_TYPES(sp-1, T_NUMBER, 1, F_MEMBER_ARRAY); */
   
    if (sv->type == T_OBJECT && sv->u.ob) {
        referee = sv->u.ob;
    }

    if (st_num_arg > 1) {
        if (sv[1].type == T_STRING && sv[1].u.string) {
            /* We've been passed in a string, now we need to call
             * find_player() */
#ifdef F_FIND_PLAYER
            /* If we have a find_player() efun, then we need to sue
             * the following method.  This hasn't been tested!
             */
             referrer = find_living_object(sv[1].u.string, 1);
#else
            if (simul_efun_ob) {
                push_svalue(&sv[1]);
                v = apply("find_player", simul_efun_ob, 1, ORIGIN_EFUN);

                if (v && v->type == T_OBJECT) {
                    referrer_obj = v->u.ob;
                    referrer_name = sv[1].u.string;
                }
                else {
                    referrer_obj = NULL;
                    referrer_name = sv[1].u.string;
                }
            }
#endif
        }
        if (sv[1].type == T_OBJECT && sv[1].u.ob) {
            referrer_obj = sv[1].u.ob;
            referrer_name = NULL;
        }
    }

    if (referee && (referrer_obj || referrer_name)) {
        result = reference_allowed(referee, referrer_obj, referrer_name);

        pop_n_elems(num_arg);
        push_number(result);
    } else {
        pop_n_elems(num_arg);
        push_undefined();
    }
}

My question (for the driver gurus) is... would I be correct in assuming that I could probably replicate the part of the code for the simul_efun case which seems to use referrer_obj and push the results?  Or is that only for simul_efun calls and there's some other way to return the results?

50
Other / Final Realms
« on: November 04, 2007, 01:32:21 PM »
HELLO out there...there...there..... :)

I was just going through some OLD archives on my hard drive to see what I should keep and what I should pack away, and I stumbled upon an old copy of the Final Realms mudlib.

In fact, three of them.  frmudlib-2.1b4.tgz, frmudlib-3.2b3.tgz, and frmudlib-4.0b1.tgz.

A brief google search only shows that version 3.4 was apparently the last real release of this old game, and unfortunately that isn't in my collection.  Since I had a world converter about 3/4 of the way done for my old Diku, I was considering trying to dig this guy out and see if it could be made to run under FluffOS.

Does anyone have a copy?  fr.imaginary.com is long gone I'm afraid, and that seems to be the only place the actual files were kept.

If anyone would like the older versions I do have, I could probaby find a way to let Crat grab them and then do whatever poking and prodding he feels needs to be done before releasing them (IE: try to find the author, make sure they actually compile, etc).

51
Drivers / ldmud vs. fluffos
« on: October 08, 2007, 09:12:05 PM »
In rooting around trying to find documentation on exactly how the driver boots and what objects get loaded in what order (something you'd really want to know in grisly detail if you wanted to write your own mudlib), it occured to me that ldmud and fluffos are probably more similar than they are different (as opposed to DGD, for example).

So, while I'm not really interested in a holy war between the two, I am rather curious if a mudlib designed for one can be coerced to run on the other, and just how different they really are these days?

Has anyone attempted to run one of the smaller libs (DS, lima) under ldmud?  Is there a smallish lib for ldmud to try under fluffos?  Am I the only one who wonders about mostly-pointless things like this? :)

52
Discworld Discussion / dw_fluffy missing a few things?
« on: September 20, 2007, 04:17:09 PM »
As part of my effort to remember how all these things work, I've downloaded several distros, amongst them, the latest Discworld mudlib.  Via their website, I found the highly amusing and rather useful LPC for Dummies guide, but much to my sorrow, I can't actually try some of the examples since several of the files they use are not part of the standard release.

I was really looking forward to seeing how "/obj/spells/fire_bunny.c" worked too.

In fact, there are no spells or rituals included at all, not even a lowly example of how to make one's own d**n spells and rituals, with blackjack, and hookers.

So, if anyone from Discworld happens to wander by, it might be nice if the distro mudlib could be used to actually run through the "how to use the discworld mudlib" guide. ;)

53
Drivers / Anyone recall TMI2 + vi ?
« on: September 19, 2007, 06:46:23 PM »
I recall an old hack to a MudOS + TMI2 package years ago which incorporated a copy of vi (nvi, I think, although it might have been elvis) so it could be used from inside the mudlib.  Unfortunately, I can't find the dusty old copy I had, so I can't look to see what they did.  Anyone else remember that?

Oh, I'm sure someone will pipe up with how putting the socket into character mode is ebil and wastes bandwidth.  I'll just respond now that it wastes no more bandwidth than shelling into the machine the game runs on and using vim from bash, and it would be nice to have the mud's own security decide what can be edited by whom. *grin*

54
Dead Souls Support / A couple of polish things.
« on: September 16, 2007, 10:02:02 PM »
So, I got ds2.5a12 up and running under fluffos 2.7.  Hooray!  It looks nice and simple so far, I'll hopefully have more time to dig into it this week.  Anyways, I just have a couple of little "polish" suggestions, which aren't critical in any way.

All the files which handle logging in, both the initial install one, and the final one, have extra newlines which place the prompt on the left edge of the screen, below the place it logically should be.  Not a big deal, but an easy fix whenever that file gets visited for something else.

The initial login process (for me, at my terminal size of 34 rows) stops at the "sourcing boards" command.  That is to say, it appears to be frozen.  I let it sit for a few minutes assuming it was loading and indexing something.  When I hit return, it immediately continued on, making me go "D'oh!".  If that's the place it pauses for everyone, a "hit return" prompt would be nice.  If I just got lucky, no biggie.

When doing a short directory listing (ls), I notice some files show up zero padded, others not.  Is there any reason for this, and if so what does it indicate?
Code: [Select]
004 biography.c     1   language.c      002 skills.c
 1   brief.c         001 lines.c         1   speakcolor.c

Finally, just a comment about I3:  I've always liked it and actually added support for it to a couple of old Diku's and a barebones mud.  However, my server was only up for 15 minutes before I got spam from "RSS_Bot@Rock the Halo" on the inews channel.  What do you guys do to smack those people? :)

Thanks!

55
General / Logout AI
« on: September 16, 2007, 04:15:38 PM »
Not sure if this is really a driver question, a design question, or a specific mudlib question.  ???

In any case, I was reading the code for object persistance and it occured to me to ask if it's possible, in MudOS and perhaps under DS, to rehook a player object so that it becomes an NPC when the player logs out, and (if still loaded) again rehook the connection object to it when they log back in?

One of the things I always felt important to a really persistant world, was the idea that all players would be in it.  Just as mobs wander about doing whatever they were coded to do, likewise, players could be sleeping in an inn, or their own castle -- or perhaps they would choose to let the AI roam them about to try and gain minimal treasure.  That would allow really unique objects to exist, and if a player didn't purchase enough traps/guards/other safeguards to protect themselves, they could be stolen.

Not everyone's cup of tea, I'm sure.  But it was a thought, and I figured I'd ask folks who've done low level mudlib coding before I hurt myself too much. :)

56
Design Lab / Perlin Noise and The World(TM)
« on: September 16, 2007, 02:56:51 PM »
Hey all,

I'm just starting to get back into fiddling with muds, so this is mostly just a feeler to see how much anyone else has done with, or is interested in, procedural world generation.

The goal is to have a fairly realistic feeling world, where players really can get lost in thousands of rooms of forest, and be able to have both random encounters and carefully crafted places.  I'd like to spent more of my time working on the carefully crafted places, but not give up that large world feeling.  The old Diku I worked on had several large grassland, jungle, and wooded areas... most of which involved a great deal of cutting and pasting with minor variations.  Yuk. :)

The concept is to use something like Perlin noise (http://en.wikipedia.org/wiki/Perlin_noise) to have a giant semi-realistic world map which can be evaluated in small chunks as players wander into the area.  As a builder wanders around (or looks at an overhead rendering by an external application) and finds a nice looking area, they can edit rooms which then become real rooms.

I know people have done similar things with the old virtual grid system and large ASCII files for the map, but I'd rather avoid the fixed-size file and use a procedure.

The bits involved seem to be:

(1)  A virtual description system that is good enough to let the players "see" what is up ahead, but not sound totally cut-and-pasted or totally random.  Much of that would come down to the number of phrases for each terrain type, and how well they meshed.

(2) A virtual "grid" which is smart enough to load real rooms if they're present or call the procedural generator if not.  Ideally, it would load a block of rooms around the player, and allow them to be unloaded if they were left empty and idle for long enough.  The old nightmare/TMI versions were pretty close to this, as I recall.

(3) The actual terrain generator, which should evaluate all the properties of a given point so a room can be generated to fit.  Assuming the fractal or noise system is tweaked properly, adjacent rooms should be similar to each other more often than not.

Comments?  Suggestions?  Yawn, been done before?

Pages: 1 2 3 [4]