Up to Main Index Up to Journal for January, 2024 JOURNAL FOR SATURDAY 20TH JANUARY, 2024 ______________________________________________________________________________ SUBJECT: WolfMUD public dev branch update, new OnDeath field+ONCE attribute DATE: Sat 20 Jan 20:24:11 GMT 2024 As promised, I’ve been busy working on WolfMUD. Mostly committing outstanding changes and fixing bugs as I come across them. I’ve not been as busy as I would have liked. Real file, especially work, keep getting in the way :/ I’ve also been revisiting combat. Last time I said: “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.” Turns out that is not the whole story, there is also an issue with messaging. In core.state there are two methods: subparse and subparseFor. Both of these methods are broken in the sense that they make a mess of message handling. I found this out while implementing an “OnDeath” attribute, which I discussed last time. I’m not very happy with the solution I came up with, but it works, therefore I’ve committed the fix :( Related, but not fixed yet, I’m still not happy with the whole way item resets and respawning are handled. The issues became more apparent when experimenting with “loot drops” and the new OnDeath functionality. I’ve been playing with getting the ugly imp, down in the caves, to drop loot when killed. Any loot items I’ve given the alias “LOOT” — it makes item management easier. Example of the modified data/zones/zinara_caves.wrj file: %% Ref: M3 Name: an ugly imp Alias: +UGLY:IMP CREATURE Location: L4 Description: @M1 Body: HAND→2 Health: @M1 Armour: @M1 Damage: @M1 Inventory: O2 O3 Holding: O3 Wielding: O2 Action: @MOBILE OnAction: $ACT chitters. : $ACT bares its teeth. : $ACT slowly swishes its tail. : $ACT makes a lurid face at you. : HIT ANY PLAYER : HIT ANY SLUG : @ACT_MOVE OnDeath: REMOVE ALL LOOT : DROP ALL LOOT Reset: @MOBILE OnReset: @M1 %% Ref: O3 Name: a small leather pouch Aliases: +SMALL:POUCH +LEATHER:POUCH LOOT Inventory: O4 Cleanup: @ITEM Reset: @SPAWN WAIT This is a small pouch made of soft dark leather. %% Ref: O4 Name: a small crystal Alias: CRYSTAL SAPPHIRE Cleanup: @ITEM Reset: @SPAWN This is a small sapphire blue crystal. While you are examining the crystal it twinkles as you turn it this way and that. %% With the modifications the ugly imp should drop the pouch it is holding when it is killed: [Bend in passage] The passage here takes a sharp bend. It runs to the north and also to the east. You see an ugly imp here. You see exits: north, east >kill imp You attack the ugly imp! With a flourish, your shortsword carves into the ugly imp. The ugly imp stops holding a small leather pouch. The ugly imp drops a small leather pouch. You kill an ugly imp! >l [Bend in passage] The passage here takes a sharp bend. It runs to the north and also to the east. You see a small leather pouch here. You see the corpse of an ugly imp here. You see exits: north, east > Success! We kill the imp and it drops the loot — a pouch with a crystal inside. At the moment you can take the dropped pouch and it keeps spawning crystals :/ What we want is for the imp to respawn with another pouch containing another crystal. But to do that the crystal has to be spawnable… To solve the spawning problem, the RESET field has a new ONCE attribute. To fix the above problem ONCE can be specified for the crystal: %% Ref: O4 Name: a small crystal Alias: CRYSTAL SAPPHIRE Cleanup: @ITEM Reset: @SPAWN ONCE This is a small sapphire blue crystal. While you are examining the crystal it twinkles as you turn it this way and that. %% The ONCE attribute causes the spawnable flag to be cleared for items that are spawned. Full details on the OnDeath field and ONCE attribute can be found in docs/zone-files.txt For now I’ve committed the OnDeath field and ONCE attribute changes, but not made any zone changes while I continue experimenting. Feel free to join in, the imp OnDeath field and crystal Reset ONCE attribute can be applied to your local zone file along with the changes below :) A number of changes and fixes are now available on the public dev branch: • 5c4036d core,docs: add ONCE attribute to RESET field (item spawns once) • c9bb4d2 core,docs: new OnDeath field added, combat updated • b063fd5 core: fix subparse and subparseFor message handling • 2ef6f43 core: DROP command should check if item is spawnable • e193504 core: fix attacker's name for "… attacks you!" message • 8593633 data: add +LEATHER:BELT bound qualifier for plain belt • 391bf2c data: fix aliases for glass ball GLASSBALL → +GLASS:BALL • d14f77a core: improve help system and simplify Help command processor • 635a296 core: add missing male/it tests • d2abe73 core: export core.PreferredOrdering • 2d01dd5 core: fix you→your typo in #EVAL command message • b2e9630 core: prevent corpses piling up, Cleanup before original Reset • 9ef27c3 core: update Thing.Marshal to write singular/plural fieldnames • cf93457 core: fix thinko in Thing.Unmarshal, fixes EXIT invalid in zone files • a97f7f0 core: log warnings in Thing.Unmarshal for unknown fields/attributes • 47091ce data: fix OnCombar←OnCombat typo affecting rabbit+frog • cba6d7a core: Fix typo in GET command if actor tries to get self Please note that OnDeath and Once are still a work in progress and as such may have some unintended side effects… -- Diddymus Up to Main Index Up to Journal for January, 2024