Jump to content

teleportation enchantment???


MrBrady

Recommended Posts

how do i make an item (enchantment/spell) that teleports user to a location. not the mark/recall spells, but to a dertermined location. i.e. a ring, or ruby slippers that takes you "home" (a cell wiht no doors out, a dimentional home)????
Link to comment
Share on other sites

Ghan-Buri-Ghan's Scripting for Dummies (I've never touched it, really!), page 63:

 

Positioning an object in the world or in an interior cell

 

Position, float_enum_x, float_enum_y, float_enum_z, float_enum_zRot

(for outdoors)

 

PositionCell, float_enum_x, float_enum_y, float_enum_z, float_enum_zRot, “cellID”

(for interior / exterior cells)

 

Player -> position –23515, -15355, 3355, 90
"Actor_ID" -> PositionCell, -254, 475, -376, 360, "Balmora, Council Club"

 

The classic application for this function is the teleport ring, transporting the player to certain locations. However, it can also be used to warp NPCs or objects to a new location. Note that this function only accepts literal values as arguments. (This probably changes with Tribunal).

 

Sample Script: A simple teleport ring could look like this:

 

Begin TeleportScript
;Attached e.g. to a ring
short status
short button
short OnPCEquip
if ( MenuMode == 1 )
return
endif
if ( OnPCEquip == 1 )
Set Status to 10
Set OnPCEquip to 0
Endif
If ( status == 10 ); Display menu
MessageBox "Teleport me to", "Balmora", "Vivec", "Cancel"
Set Status to 20
Elseif ( status == 20 ); wait for response
Set button to GetButtonPressed
If ( button == -1 ); no answer yet
Return
Elseif ( button == 0 ); selected Balmora
Player -> PositionCell -21278, -17613, 534, 0, "Balmora (-3, -3)"
Elseif ( button == 1 ); Selected Vivec
Player -> Position 29872, -82108, 578, 180
Elseif ( button >= 2 ); selected cancel
Set status to 0
Endif
Endif
End

 

Note that both targets are outdoor cells and the different formats used. If you try to teleport to an unsafe place (clipping with an object or out in the void), you will instead be placed at the next safe location.

 

You can also relocate NPCs or objects with this function.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...