Up to Main Index Up to Journal for November, 2018 JOURNAL FOR THURSDAY 8TH NOVEMBER, 2018 ______________________________________________________________________________ SUBJECT: Barriers + a small update DATE: Thu 8 Nov 22:13:46 GMT 2018 A week has gone by since WolfMUD v0.0.11 was released. Can’t hear any shouting or screaming and no angry emails. I take that as being a good sign :) It seems that my hasty, last minute decision to include the reworking of actions has gone down well. Players, authors and developers all seem to like how it turned out. I really like working on features that make the world seem more alive. The trouble is all of your NPCs, creatures and critters are running amok! I’m looking at adding barriers before continuing with testing. Barriers are things that are invisible but prevent certain mobiles from passing through. For example, you can put mobiles into an area and corral them by placing barriers they cannot move through. Therefore they cannot wander off into other areas[1]. The first thing I need to do is come up with the syntax for a barrier. The one I’m working with at the moment looks like: Barrier: EXIT→S DENY→CREATURE,NPC ALLOW→IMP Barriers work by matching aliases. If any of a mobile’s aliases matches ALLOW they can pass. If not specifically allowed and an alias matches DENY they can’t pass. If they are not specifically allowed and not denied they can pass. Barrier is a pair list. However, DENY and ALLOW are comma separated lists of keywords with no white space. Otherwise ‘DENY→CREATURE, NPC’ results in NPC being seen as a keyword with no value specified. Not too sure about using the comma separated list, but it works for now. Barriers are also a good example of using aliases to group things together, here I’m using CREATURE for any animal like mobile and NPC for any ‘person’ type mobile that is not a player. The next thing I need to think about is how/where to define barriers. As an attribute of a location? Or as a narrative at a location? As an example let’s assume that we want to stop the mouse escaping from the tavern when the door is opened. We want a barrier preventing mobiles with the alias MOUSE from going east, through the door. If the barrier is defined as a narrative at the location we would have: %% Ref: L3 Name: Tavern entrance Aliases: TAVERN ENTRANCE Exits: E→L5 S→L4 SW→L2 W→L1 Inventory: L3N1 L3N2 You are in the entryway to the dragon's breath tavern. To the west you see an inviting fireplace and south an even more inviting bar. Eastward a door leads out into the street. %% Ref: L3N1 Narrative: Name: the tavern door Aliases: DOOR Door: EXIT→E RESET→1m JITTER→1m OPEN This is a sturdy wooden door with a simple latch. %% Ref: L3N2 Narrative: Barrier: EXIT→E DENY→MOUSE %% If a barrier is defined as an attribute of the location we would have: %% Ref: L3 Name: Tavern entrance Aliases: TAVERN ENTRANCE Exits: E→L5 S→L4 SW→L2 W→L1 Inventory: L3N1 L3N2 Barrier: EXIT→E DENY→MOUSE You are in the entryway to the dragon's breath tavern. To the west you see an inviting fireplace and south an even more inviting bar. Eastward a door leads out into the street. %% Ref: L3N1 Narrative: Name: the tavern door Aliases: DOOR Door: EXIT→E RESET→1m JITTER→1m OPEN This is a sturdy wooden door with a simple latch. %% Actually, in the first instance, the door and barrier are both narratives and could be combined: %% Ref: L3 Name: Tavern entrance Aliases: TAVERN ENTRANCE Exits: E→L5 S→L4 SW→L2 W→L1 Inventory: L3N1 You are in the entryway to the dragon's breath tavern. To the west you see an inviting fireplace and south an even more inviting bar. Eastward a door leads out into the street. %% Ref: L3N1 Narrative: Name: the tavern door Aliases: DOOR Door: EXIT→E RESET→1m JITTER→1m OPEN Barrier: EXIT→E DENY→MOUSE This is a sturdy wooden door with a simple latch. %% Maybe the answer is to allow both — as a location attribute or as a narrative. Either way, I hope to have a working implementation I can share soon. Thinking about it, if an item had a barrier attribute it would be a portable barrier… In other news, I’ve just updated the public dev branch with a small update. I’ve taken the code from the ACT command that turns ‘a frog’ into ‘the frog’ or ‘an apple’ into ‘the apple’ and created a more general TheName as a method of attr/Name. I’ve also added ‘some’ to the mix. So ‘some apples’ becomes ‘the apples’ for example. The ACT command has been updated to use TheName, as will more of the commands as and when they are updated. -- Diddymus [1] Okay, currently not true. You could pick up a creature, walk through a barrier carrying said creature, then drop it in another area. Assuming we had barriers implemented that is… Up to Main Index Up to Journal for November, 2018