iller Posted September 10, 2012 Share Posted September 10, 2012 (edited) Hi, I need help with a script. I'm making a quest mod, and I would like to trigger a certain quest stage when the character enters a limited area around a certain point. I did this when I made a quest mod for Oblivion, but as we all know Bethesta has changed the scripting system quite a lot for Skyrim. I used a "get distance" script in Oblivion similar to this one: begin gamemodeif ( Player.GetDistance xmarker <= 1000 )setstage MyQuest 10endifend The point is "xmarker" and "1000" is the area around it. My question is, how should I write this script with Papyrus? The if statement (red) is what I want to know the most, I know how to do the setstage part with Papyrus. Thanks in advance! Edited September 10, 2012 by iller Link to comment Share on other sites More sharing options...
jshepler Posted September 10, 2012 Share Posted September 10, 2012 http://www.creationk...ObjectReference is the direct answer to your question, but I think you might want to consider a volume trigger so that you wouldn't have to constantly poll the distance. Link to comment Share on other sites More sharing options...
iller Posted September 10, 2012 Author Share Posted September 10, 2012 (edited) Thanks for your reply. I managed to get a script together from what you linked, but unfortunately it didn't work. Here it is: Event OnTriggerEnter(ObjectReference akActionRef) if(akActionRef == Game.GetPlayer()) && (Game.GetPlayer().GetDistance(Xmarker) + " 5") MyQuest.setstage(30) endifEndEvent Nothing happens when I stand close to the xmarker. I'm not really sure if I'm putting the script in the right place though, should it be in the quest script or in the xmarker itself? The problem is though, if I put it in the xmarker I can't define the xmarker. Is there a way to tell the script to make the object which the very script is attached to into a property itself, no matter what it is? In this case the xmarker. Just like Game.GetPlayer, when it comes to the player. Or is it simply something wrong with the script? Edited September 10, 2012 by iller Link to comment Share on other sites More sharing options...
jshepler Posted September 10, 2012 Share Posted September 10, 2012 I don't really know, I haven't done one yet, but it looks like you attach the script to the trigger, not the marker or quest. Also, it looks like you resize the trigger to cover the area you want. OnTriggerEnter would/should fire when an actor enters the area - you shouldn't need to also call GetDistance. Link to comment Share on other sites More sharing options...
iller Posted September 11, 2012 Author Share Posted September 11, 2012 Thank you very much. I got it working. It was as you said, I didn't need the get distance part. I didn't know about the t-box. I shall read stuff more carefully in the future. :) Link to comment Share on other sites More sharing options...
Recommended Posts