Up to Main Index                           Up to Journal for January, 2024

                    JOURNAL FOR SATURDAY 6TH JANUARY, 2024
______________________________________________________________________________

SUBJECT: A return to WolfMUD
   DATE: Sat  6 Jan 18:52:27 GMT 2024

First entry for 2024, happy new year!

This week I had a proper WolfMUD Wednesday and I’ve been picking up WolfMUD
development again. After a year of abstinence I looked at my code and cringed
a little. Has my coding style really changed so much over the past year?

I’ll not be mentioning the ‘M’ word so much, for a while at least. This has
annoyed some people who really like my programming language. Then again,
working on my language annoyed people who wanted me working on WolfMUD… :|

I’ve had to turn to the journal, which has been very useful. I went back in
time and tried to work out what I was working on, plans I had and what I may
have been thinking. I started making a todo list as I read the journal and
poked around the WolfMUD codebase…

I have several outstanding changes I’m currently poking at. One appears to be
a change in an attempt to avoid corpses piling up. There are also changes to
the help system adding redirects to topics. Otherwise there are only a few
minor clean-ups outstanding.

I’ve poked at combat a bit and see that combatants don’t drop any loot. Seems
a little odd. Why would I move on to the help system and leave that out? It
appears that dropping loot was “complex” at the time and didn’t play well with
item spawning and resets.

I noticed a typo in data/zones/zinara.wrj where OnCombat was spelt OnCombar.
This prevents combat actions being used for the rabbit and frog.

At some point I did have warnings logged for unknown fields and attributes,
but it was turned off during development because it was too noisy. I guess
reimplementing the warnings and improving them would be a good idea.

Another issue I spotted: EXITS and EXIT should be valid in zone files but only
EXITS actually works.

Another typo spotted in messages from the #EVAL command.

I think the first proper change I want to make, after handling the outstanding
items on my list, will be to add an OnDeath attribute to mobiles. The OnDeath
attribute would contain a list of commands to perform when mobiles/NPCs die.

For example:


  %%
       Ref: M3
      Name: a small frog
     Alias: FROG CREATURE
  Location: L36
    Health: MAXIMUM→3 @MOBILE
  Holdable: HAND
    Action: @MOBILE
  OnAction: $ACT croaks a bit.
          : $ACT leaps high into the air.
          : $ACT hops around a bit.
          : HIT ANY PLAYER
          : @ACT_MOVE
  OnCombat: [%D] tr[ies/y/ies] to grab [%a] but [%a.they] jump[/s] and poke[/s]
            [%d.them] in the eye.
          : [%D] lunge[s/] for [%a] but miss[es//es] and go[es//es] sprawling
            across the ground.
          : [%D] grab[s//s] for [%a] but [%a.they] jump[/s] out of
            [%d.their][/r/] hand and hit[/s] [%d.them] in the eye.
   OnDeath: $ACT gives a final croak.
     Reset: @MOBILE
   OnReset: A frog hops into view.
  %%


This is similar to OnAction but runs through each OnDeath entry one at a time
in order. This nicely decouples the handling of what to do when something dies
by providing a hook to hang actions off of. I might then be able to implement
the sweet little flow girl “properly” ;)

For now I’ve been working my way through the list, and keep adding to it. I’ll
soon have lots of little fixes ready to push out to the public dev branch.

--
Diddymus


  Up to Main Index                           Up to Journal for January, 2024