Jump to content

Teleporting Npcs Script Help


pyrotx

Recommended Posts

I'm trying to create a teleporting spell for any npc that casts the spell. The problem is, the only way I know to make a teleportation spell is so the spell summons an activator, then the activator moves the caster to it, in other words the only script is on the activator. So far I've only been able to make this work for the player. The reason being, I don't know how to tell that BLEEPING activator that it's supposed to move the caster of the spell. As it has no idea who the caster is if it's not the player or a SINGLE specific npc, like for example Lydia. However, as I said I was hoping it could be any npc that casts the spell.

 

Basically can someone tell how to reference the caster of a spell in an activator script please?

Link to comment
Share on other sites

Two questions:

1)Where do you want to teleport - to a specific location or random place (like for example, to where cursor is pointing at)?

2) How do you imagine the way by which NPCs will use this spell (since their AI doesn't know how, when and to what purpose use the teleportation spell)?

Link to comment
Share on other sites

  • 2 weeks later...

Hello!

 

I have a problem with MoveTo. I placed two actors and two markers. In a quest the actors should travel to their own markers as soon as the quest's stage will be 40. So I made this script at the Quest Window's Quest Stages tab under stage 40:

setObjectiveCompleted(30)
setObjectiveDisplayed(40)

Alias_WreckDawnXmarker.GetReference().Disable()
Alias_BumblebeeDawnXmarker.GetReference().Enable()
Alias_DanRu.GetReference().Enable()
debug.notification("FLY AWAY1")
Alias_Hogg.GetRef().MoveTo(Alias_HoggBumblebeeDawnRef.GetRef())
debug.notification("FLY AWAY2")
Alias_Bjan.GetRef().MoveTo(Alias_BjanBumblebeeDawnRef.GetRef())
debug.notification("FLY AWAY3")

I think it's working, because in game the two actor disappear (and I get all 3 debug notifications), but when I travel to the place they should be after the teleportation, I can't find them. Then if I travel back to their original place, they are there again.

 

I think after they teleport, they go back to their original place. I don't know why and what should I do instead.

I thought that maybe AI packages do this, but I don't use any of them.

 

Gilron

Edited by Gilron
Link to comment
Share on other sites

Well, I was first planning to make it a short range spell, "where the cursor is pointing". Second I plan to add a damage portion in the destruction school, this way is can be used as an attack. Since this is mainly what the ai understands.

Link to comment
Share on other sites

Reply to Gilron:

 

What you need to do is add an AI Package to each Npc to make them travel and wait at a specific location.

 

Next make sure that the AI Package can only take effect at the appropriate quest stage. This can be done by creating a new AI package and under the conditions tab add the condition--- GetStage or whatever it's called, then select the quest you want, then the quest stage.

 

Also make sure that this new AI Package in at the top of the load order/ at the top of the characters AI Package list.

Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

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