Could someone help make me a teleport to target perk effect?

Post » Wed Jun 20, 2012 9:23 pm

if anyone could do this.. i am trying to make a spell that allows me to teleport to a target when a condition function is met? id like it to be activated after the perk was allocated and it to be a 'entry point- apply sneaking spell'
thanks so much for taking the time to read!
User avatar
Melanie Steinberg
 
Posts: 3365
Joined: Fri Apr 20, 2007 11:25 pm

Post » Wed Jun 20, 2012 7:45 pm

In essence, you'd probably make a new Effect with a script similar to this:
Scriptname dkeDarkEnergyEffect extends activemagiceffectdkeQDarkEnergy	 Property myQuestScript			   AutoReferenceAlias	 Property Alias_dkeTargetMarker	   AutoReferenceAlias	 Property Alias_dkeSkyrimReturnMarker AutoActor  aPlayerstring sMessage1 = "Dark Energy cannot be used during combat."Event OnEffectStart(Actor Target, Actor Caster)  aPlayer   = Game.GetPlayer()   if (aPlayer.IsInCombat())    Debug.Notification(sMessage1)  elseif (!myQuestScript.bMyCondition)	  ; do nothing because custom condition is not met  else    if (!myQuestScript.bTarget)	  Alias_dkeSkyrimReturnMarker.GetReference().MoveTo(Caster)	  myQuestScript.bTarget = true	  aPlayer.MoveTo(Alias_dkeTargetMarker.GetReference())    else	  myQuestScript.bTarget = false	  aPlayer.MoveTo(Alias_dkeSkyrimReturnMarker.GetReference())    endif  endifEndEvent;Event OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect);endEvent;Event OnEffectFinish(Actor Target, Actor Caster);endEvent
Then you make a new Spell with that Effect, and place a mechanism in game to allow the spell to be learned (e.g. a spellbook - not quite sure what you mean by "perk" in this context).
My example script is based on a hidden quest, which I find a convenient method of tracking what's going on, but you could use global variables and explicit object references if you prefer.
It moves an X-marker to the player's current position in Skyrim, in order to return there the next time the spell is used.
If the player goes into sneak mode before using the spell, they will remain in sneak mode - not sure if that's what you wanted?
User avatar
darnell waddington
 
Posts: 3448
Joined: Wed Oct 17, 2007 10:43 pm


Return to V - Skyrim