The library defines the /warp
type which you can use to create warps. All you have to do is define a sub-type of /warp
), open the map editor, and place the warp on two tiles. When you run the game, the player will be teleported from one tile to the other when they step on the warp.
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 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.
Version 1 (posted 02-11-2012)