Skip to content
Aardwolf MUD Blog
Aardwolf MUD Blog

Aardwolf MUD News and Updates.

Aardwolf MUD Blog
Aardwolf MUD Blog

Aardwolf MUD News and Updates.

Lua Object Progs Enhancements – Test port.

Lasher, August 3, 2008

Part of the reason for starting this blog was to give more detail on the background of things that will never be announced on the live port because they are “behind the scenes”. This post covers some changes to the Lua integration. If you’re not interested in the building / Lua side of the MUD, skip this post.

New Lua MUD function: getobj
The function ‘getobj’ works similar to getmob/getroom and can search in a room, on a character or inside another item. Full syntax with examples can be seen at:

Getobj Lua Function Documentation / Examples

New Object Properties available in Lua:

Property Description
obj.aname Returns the object name with A/AN/THE on the front of the object name removed, but with color codes intact. Useful for constructing messages containing the object name without running into problems such as “The a long sword glows brightly.”
obj.room ROOM var if the item is in a room or NIL.
obj.char CH var if the item is on a character, or NIL.
obj.inside OBJ var if the item is in a container, or NIL.
obj.root The top level container if the item is insider another container. Returns a copy of itself if not in a container.
obj.loctype Used to check the type of location an item is in. See below for list of values.

obj.loctype returns one of :

Value Description
OBJ_LOC_PLAYER Object is on a player
OBJ_LOC_MOB Object is on a mob
OBJ_LOC_ROOM Object is in a room.
OBJ_LOC_CONTAINER Object is in a container.
OBJ_LOC_NOWHERE Object is nowhere (auction or bug)

New Lua Object Trigger Type: Expire
There is a new object trigger type : ‘expire’. If an item has a timer, any Lua scripts attached to an expire trigger will be executed just before the item is removed from the game.

Most of these changes were added to make use of the expire trigger type. You need to be able to know where an item is when it expires to decide what to do. You might want an item to damage everyone in the room or blow up a door to the north (open it) when it expires, but need to know if it is actually in a room first. Another item may have an expire script that does something to a player holding it – before proceeding you need to be able to make sure the item is actually being carried by someone.

To see the infamous exploding pie triggers and how simple they are, check out the bottom of:

Lua MUD Object Prog Documentation

Please note that rawDamage is not yet tested or documented and should not be used until announced.

Development free mudLuaMudMUD Equipment

Post navigation

Previous post
Next post

Related Posts

Lua Object Progs – First pass.

July 30, 2008

Short post because most of the content is elsewhere. A basic test version of object progs in Lua is now on the test port. Full details are on the Lua coding page : Lua MUD object progs With this type of trigger now in place, it makes sense to revisit…

Read More

Links:

  • Aardwolf Home
  • Web Client
  • Blog Home

Recent Posts:

  • Skeletal Remains area / few other changes.May 16, 2025
  • Revenge change, Premonition and Solidify buffs, other changes.March 16, 2025
  • Multiple Race Changes and other updates.October 27, 2024
  • Races: Human, Halfling, Sprite, Triton, Wolfen and VampireJuly 27, 2024
  • Race Rewrite – Framework and OverviewJune 22, 2024
  • Race Rewrite – Individual Race ChangesJune 22, 2024
  • Fantasy Fields goal, recon change, others.June 22, 2024
  • New Automated Reboots / Ice Age, Other Changes.April 21, 2024
  • New Race Modifiers, Other Changes.April 13, 2024
  • Gquest changes, keys, resistance changes, more.March 30, 2024
  • An Auspicious Star’s Zenith area and new goal in Sanctity of Eternal Damnation.February 17, 2024
  • New Blindmode color codes, Automatic note formatting.February 17, 2024
  • New blind Accessibility features, Premonition instinct, others.January 21, 2024
  • Season of DragonsJanuary 21, 2024
  • New area quests (goals), public manor rooms, other changes.December 17, 2023
  • Oracle Class Additions – 5 new Abilities.December 17, 2023
  • Shaman and Guardian Update, Other ChangesNovember 11, 2023
  • Subclass changes, Paradise Lost Goal, others.September 9, 2023
  • New areas, other changes July 15th 2023.July 15, 2023
  • Classchange rewrite and instinct / mastery rebuildsJuly 15, 2023
©2025 Aardwolf MUD Blog | WordPress Theme by SuperbThemes