Jump to content

Scripting 'Mark' and 'Recall'


pldggs

Recommended Posts

The game probably crashed because that code was encountered within a global script, or within the local script for an object that can't cast spells. On top of that, "Mark" is a spell that gets targetted at the casting actor, and, if that actor isn't the PC, bad things happen.

 

It'd be safer to simply use Mark and Recall abilities rather than regular spells:

 

If ( CellChanged )
 Player->RemoveSpell "Mark Teleport Ability";Remove all these spells once they've done their deed
 Player->RemoveSpell "Recall Teleport Ability"
EndIf

[...]

Player->AddSpell "Mark Teleport Ability"
Player->PositionCell 0 0 0 0 "MY MAGIKAL LAND OF MISTIRI!!!11!"
DisableTeleport;Don't want the PC teleporting out of your magikal land of mistiti, do you????//?

[...]

Player->AddSpell "Recall Teleport Ability"
EnableTeleport

 

If you've got Tribunal or Bloodmoon as a dependency and can always know that the PC is in an exterior cell, or in a specific interior cell, there's an easier way to do this that won't erase the player's current Mark:

 

Set XPos to ( Player->GetPos X )
Set YPos to ( Player->GetPos Y )
Set ZPos to ( Player->GetPos Z )
Set ZRot to ( Player->GetAngle Z )
Player->PositionCell 0 0 0 0 "MY MAGIKAL LAND OF MISTIRI!!!!11!"
DisableTeleport

[...]

Player->Position XPos YPos ZPos ZRot
;Player->PositionCell XPos YPos ZPos ZRot "TESUREE DUNGEN!!!1! BEWERE OF TRAPS!!! LOL"
EnableTeleport

 

If you can stand having the player get teleported to the exact same position every time he teleports out of your magikal land of mistiri, regardless of where he was when he got teleported in, you can do it the Daedric Special way:

 

Player->PositionCell 0 0 0 0 "MY MAGIKAL LAND OF MISTIRI!!!!11!"
DisableTelePort

[...]

Player->PositionCell 0 0 0 0 "TESUREE DUNGEN!!!1! BEWERE OF TRAPS!!! LOL"
EnableTeleport

Link to comment
Share on other sites

The game probably crashed because that code was encountered within a global script, or within the local script for an object that can't cast spells.  On top of that, "Mark" is a spell that gets targetted at the casting actor, and, if that actor isn't the PC, bad things happen.

Can you cause the "Player" object to cast the spell? (And would this go through the casting animation?)

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...