The library is simple but can be used in more complex ways. It comes with five demos that show how to use it in different ways. The demos are:
- conditional-warp-demo - Shows how to create a warp that only works if the mob using it meets certain criteria. Also shows how to create a warp with two destinations that picks a destination based on the mob using the warp.
- one-way-demo - Shows how to create warps that only work in one direction.
- simple-demo - Shows the basic usage of the library - creating pairs of turfs that teleport the player back and forth when stepped on.
- transition-demo - Shows how to implement a simple fade in/out transition when a warp is used.
- warp-function-demo - Shows how to customize multi-tile warps by overriding the warp_function proc.
Version History
Version 2 (posted 02-14-2012)- Added support for multi-tile warp areas. By default, the library will group all adjacent turfs in the same warp area and treat them as a single entrance/exit point. If you place the same warp area on both sides of a three tile wide doorway, the library will treat each group of three turfs as a single group and will know to move objects to the other group.
- Added partition.dm which contains the warp.partition() proc. This proc is used to split the turfs in a warp into disjoint sets, which is needed for multi-tile warps.
- Updated the default behavior of destination(). If the warp has a target type defined, it finds a turf in that area. If it contains two turfs, it returns the one the object isn't on. Otherwise, it calls warp_function().
- Added the warp.warp_function() proc. By default, this proc partitions the turfs and defines the destination to be the first turf found in a different set.
- Updated the simple-demo to include a multi-tile warp and icons for the warp areas.
- Added the warp-function-demo which shows how to modify warps by overriding their warp_function proc.
- Added the transition-demo which shows how to create transitions between screens.
- Removed the advanced-demo and door-demo.
- Initial version.
Still, this is something that I use so I figured there's no harm in making it available to other people. Also, it could be useful to have some simpler libraries so people can get used to using libraries (running demos that come with them, including them in projects, etc.).