Tutorials: wallsets and custom monsters, objects, etc

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
User avatar
Sophia
Concise and Honest
Posts: 4306
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Tutorials: wallsets and custom monsters, objects, etc

Post by Sophia »

The reason just setting the definition to nil doesn't work is that obj has a metatable that appends every newly created archetype's key to a hidden array as soon as it is created. Iterating over a Lua table has no particular order, so doing it this way ensures that you can iterate over archetypes in the order they're listed in objects.lua, which is usually what people are expecting to happen, and (since I was also expecting it to work this way!) got rid of a bunch of insidious bugs in early versions of DSB that didn't do it this way. When you nil the entry in obj the hidden entry still exists and DSB gets confused. I could probably fix this, if it's actually something people care about.
User avatar
Ser Xav
Lo Master
Posts: 449
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: Tutorials: wallsets and custom monsters, objects, etc

Post by Ser Xav »

Ok, thanks, so sounds like not possible to suppress? I'll have a go at the custom class, thanks. Should be relatively easy to do this I think.
Post Reply