Jump to content

[LE] HELP - Blink Teleport Script


Recommended Posts

I need some help to develop a blink-like teleport spell, (teleport player to cursor)

 

So I have the syntax for basic teleportation:

 

Scriptname TeleportScript extends activemagiceffect
ObjectReference Property Loc auto
Actor Property Caster auto
Event OnEffectStart(Actor Target, Actor Caster)
Caster.MoveTo(Loc)
EndEvent
And I know that you need an ObjectReference. So I tried to make the spell archetype as Spawn Scripted Ref, then the spell "Explosion" is empty (Empty.nif) and I created an Empty Static Object that is spawned by the explosion. The problem is I can't seem to reference the static object.... And I have no idea where to go. If anyone could help me that would be appreciated. Thanks.
Link to comment
Share on other sites

Have your script in the spawned reference and move the player to the ref when it loads instead. Something like this:

 

Scriptname TeleportScript extends objectreference

 

Event OnLoad()

Game.GetPlayer().MoveTo(self)

EndEvent

Edited by FrankFamily
Link to comment
Share on other sites

YOU HAVE NO IDEA HOW MUCH I APPRECIATE YOU RIGHT NOW!!! I have been trying to make additions to my nexus mod, all my ideas require scripts and so far this is the only one working. Thank you SO much!! It's been an absolute headache, I am new to scripting so I am getting used to it all. I have so many annoying scripts that I need to get working

Edited by MaskedpENGUiN
Link to comment
Share on other sites

Speaking of which can you possibly help me with this issue?

 

I am trying to make a quest stage that has multiple objectives, like for example killing 4 specific npcs, then the stage advances.

So far I've tried to make a Global variable and for each Actor have a script that adds 1 to the variable like so:

 

GlobalVariable Property count auto
Event OnDeath()
count.Mod(1)
EndEvent
Now I want to have an If statement that checks when the Global variable is = to 4,
then it advances the stage. here is the script but when I compile I get an error say missing EOF at 'If'
Scriptname AAA1TestScript extends Quest
GlobalVariable Property counter auto
Quest Property akQuest auto
If counter.GetValue() == 4
akQuest().SetStage(30)
akQuest().SetObjectiveDisplayed(30,1)
EndIf
Once again help is appreciated and excuse my terrible programming :)
Link to comment
Share on other sites

Thing is when does AAA1TestScript run? It isn't clear in your post. I'd put all that within the OnDeath in the script that goes in the actors, as in:

 

Scriptname IncreaseVarAndCheck extends Actor

 

GlobalVariable Property counter auto
Quest Property akQuest auto

 

Event OnDeath()
count.Mod(1)
;also complete the objective relative to this actor?
If counter.GetValue() == 4
akQuest().SetStage(30)
akQuest().SetObjectiveDisplayed(30,1)
EndIf
Endevent

Alternatively if you are completing objectives as each one dies you could get rid of the global and just check that all objectives are completed right after, and if so advance the stage. With: https://www.creationkit.com/index.php?title=IsObjectiveCompleted_-_Quest

Scriptname CompleteObjectiveAndCheck extends Actor

 

Quest Property akQuest auto
Int Property ThisActorsObjective auto; to be filled in ck in the actors with their objective

 

Event OnDeath()
akQuest.SetObjectiveCompleted(ThisActorsObjective, true)
If akQuest.IsObjectiveCompleted(1) && akQuest.IsObjectiveCompleted(2) && akQuest.IsObjectiveCompleted(3) ; etc, replace with the relevant numbers
akQuest().SetStage(30)
akQuest().SetObjectiveDisplayed(30,1)
EndIf
Endevent
Edited by FrankFamily
Link to comment
Share on other sites

  • Recently Browsing   0 members

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