Jump to content

Teleport-on-hit scripted effect?


xunderxdosedx

Recommended Posts

Hi, I'm relatively new to modding, and I have no experience at all with Papyrus, so I was hoping to get a question or two answered here.

I'm trying to come up with ability that can be applied to NPC's which mimics Orchendor's teleport. If you're not immediately familiar, Orchendor from the Spellbreaker quest has a unique ability; essentially a 100% magic resistance with a scripted effect that causes him to teleport to one of the strategically placed X markers in the room where you fight him if he gets attacked in melee several times. Lots of people know that. It's often cited as a major reason for using Orchendor as a Dead Thrall, except it doesn't seem to work outside of the room in Bthardamz where the fight takes place. He appears to teleport, but only blinks invisible for a second and runs away, for example he can't teleport out of a corner when a Forsworn has him backed into it because he's not actually teleporting.

To experiment, I took Orchendor's teleport ability [it's just called "abTeleportation"] and put it on Serana. Just like a thralled Orchendor, she would take several hits then blink away and reappear nearby, invariably just going invisible for a second rather than teleporting. Just to check, I took her all the way back to the boss room in Bthardamz and console-spawned a bunch of Draugr to fight her. Sure enough, the effect worked like a charm in that particular room.

Long story short, I figured out that the teleport effect only works when it's moving an NPC from one predetermined "pad" to another, if there isn't one close by then it doesn't work, and there aren't very many in-game.

Barring the solution which immediately comes to mind [hand-placing teleport markers in every nook and cranny of the vanilla game, no thank you], is there some way to edit the script so that it uses some other criteria as the teleport destination? For example, behind the attacker, to a nearby idle marker, or some randomly-selected point within a limited radius?

Ultimately what I'm trying to accomplish is a little script which I can add to any follower NPC that teleports them out of tight spots [possibly with the bat visuals that Harkon uses when he teleports, I don't know how to change the visual/audio effect in the vanilla script either]. The immediate thing I want to use it for is a tiny Serana overhaul, but the script itself would probably be handy to a lot of modders that make custom followers too.

Any help at all would be appreciated, I'm sorry if this is tl;dr, I figured it was best to be specific about my questions.

Link to comment
Share on other sites

You could prior to the teleport place several xMarkers a certain distance out but at different angles from the actor. Then have the actor process which markers are in LOS, then randomly pick one and teleport. There is of course the risk factor that they could teleport to a merker in mid-air just past the edge of a cliff, but I think acceptable in that they teleported in a hurry due to being under duress.

 

At least that's my theory. I've not looked into the scripting possibilities of it.

Link to comment
Share on other sites

You could prior to the teleport place several xMarkers a certain distance out but at different angles from the actor. Then have the actor process which markers are in LOS, then randomly pick one and teleport. There is of course the risk factor that they could teleport to a merker in mid-air just past the edge of a cliff, but I think acceptable in that they teleported in a hurry due to being under duress.

 

At least that's my theory. I've not looked into the scripting possibilities of it.

Thanks for the quick reply, I'm looking into it but as I said my own skills with Papyrus are sub-par at best.

I've tried reverse-engineering the teleport effects added in some other mods, but so far I haven't had a whole lot of luck in figuring out what to do because as far as I can tell nobody has done what I'm trying to do before, and they all work with their own scripts so I'm assuming that I can't simply re-purpose an existing in-game script.

There are a few mods which allow a player to teleport behind an NPC, and I think that maybe causing your follower to teleport behind their attacker might be a quick and easy solution, I'm just not sure how to execute it.

Link to comment
Share on other sites

You probably would be better off with your own script than trying to repurpose one. Not saying it isn't possible. You just have more control over things. A repurposed script cannot be edited or it will break it's original purpose. Whereas your own script can be modified as much as necessary.

 

If the script is on the follower, when conditions are correct, spawn an Xmarker at specific coordinates distanced so far from their attacker. Then teleport to the Xmarker. Teleporting is the easy part. Calculating where to spawn the Xmarker is not so easy (at least for me -- I've not figured out the math stuff, cos sin etc.. in Papyrus)

Link to comment
Share on other sites

You probably would be better off with your own script than trying to repurpose one. Not saying it isn't possible. You just have more control over things. A repurposed script cannot be edited or it will break it's original purpose. Whereas your own script can be modified as much as necessary.

 

If the script is on the follower, when conditions are correct, spawn an Xmarker at specific coordinates distanced so far from their attacker. Then teleport to the Xmarker. Teleporting is the easy part. Calculating where to spawn the Xmarker is not so easy (at least for me -- I've not figured out the math stuff, cos sin etc.. in Papyrus)

That actually helps a lot. I'm going to start playing with some ideas and see if any of them work. Thanks!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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