A complete solution to create custom doors.
Requires DataManager!
Simply use /dfw
(configurable) to receive instructions on how to use this script.
You can find the configuration file in server/data/custom/__config_DoorFramework.json
.
cmdStaffRank
rank necessary to use the command.1
by default (moderator).collision
whether doors should have collision.true
by default.cmd
command name to be used."dfw"
by default.sound
sound to be used if none was specified for/dfw sound
."fx/doorw1.wav"
by default.
You can also use this as an API to make doors in your own scripts.
DoorFramework.createRecord(
recordId,
id used in other functions
name,
text displayed on the door
model,
path to the mesh for the door's appearance
cellDescription,
cell to which the door leads
location,
location to which the door leads. Must haveposX
,posY
,posZ
,rotX
,rotZ
sound
sound to be played when the door is activated
)
DoorFramework.getRecord(recordId)
returns{
refId,
refId
generated for the door record in miscellaneous record store
location,
location given increateRecord
cellDescription,
cell given increateRecord
sound
sound given increateRecord
}
DoorFramework.removeRecord(recordId)
removes the record. Doesn't despawn all the door instances or remove the generated custom record!DoorFramework.spawnDoor(
recordId,
cellDescription,
cell in which to spawn the door (should be loaded)
location
location at which to spawn the door
)
DoorFramework.isDoor(refId)
returns whether a givenrefId
is used by the DoorFrameworkDoorFramework.getDoor(refId)
returns therecordId
of the door withrefId
DoorFramework.useDoor(pid, recordId)
makes the player withpid
use the door withrecordId
. Normally is automatically called when a player activates the door.