pldggs Posted November 26, 2004 Share Posted November 26, 2004 I'm trying to script a teleport function tant marks the start position on initial use, then recalls on the second use. I'm using Cast "Mark","Player"When it hits this code, the game crashes. What am I doing wrong? Link to comment Share on other sites More sharing options...
Marxist ßastard Posted November 26, 2004 Share Posted November 26, 2004 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 More sharing options...
Abramul Posted November 27, 2004 Share Posted November 27, 2004 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.<{POST_SNAPBACK}>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 More sharing options...
Marxist ßastard Posted November 27, 2004 Share Posted November 27, 2004 You could certainly try. The method is theoretically sound, but you won't catch me doing it anytime soon. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.