Resetting a Quest Alias

Post » Thu Jun 21, 2012 6:12 am

I am trying to have a script that returns if the player is detected on update. The only way I could see of doing this is by using IsDetectedBy(Alias) where the alias is the nearest actor determined by the alias conditions.

I had it working like so:
Quest1:Register for update(10)Event OnUpdate()   Quest2.Start()   Quest2.setstage(0)EndEventQuest 2:If (game.getplayer().IsDetectedBy(alias))   dostuffEndIfalias.clear()stop()

Having one quest purely for the sake of starting another quest seems really dumb, so I've been trying to get it working in a single quest using TryToReset(), TryToClear(), and Clear(), but the actor alias always seems to be 'None'.

How can I have it so that the alias is reset to the nearest actor every update? Or is there an easier way simply to tell if the player is detected or not?
User avatar
Katie Louise Ingram
 
Posts: 3437
Joined: Sat Nov 18, 2006 2:10 am

Post » Thu Jun 21, 2012 10:29 am

alias.clear - Is the alias tagged as Optional?

Only optional ones can be cleared


Detection
Despite all of this >>> http://www.creationkit.com/Detection - You are doing what appears to be the recommended thing http://www.creationkit.com/IsDetectedBy_-_Actor (although it recommends checking update every second, rather than 10, as you are ... and also hints that non-combat actors are a bit rubbish at detection)

(Mt CK isn't open .... I don't suppose there's a Story Manager Event for OnDetected, is there? I don't remember one, though ...)
User avatar
David John Hunter
 
Posts: 3376
Joined: Sun May 13, 2007 8:24 am

Post » Thu Jun 21, 2012 3:21 pm

Strangely, having now removed all attempts to reset the alias, I'm finding the alias is now not getting set in the first place. I have it set to find closest matching reference in loaded area where IsActor=1. This seemed to work fine when the quest was started by the other quest, but not when the quest is started with Start Game Enabled.
User avatar
Guinevere Wood
 
Posts: 3368
Joined: Mon Dec 04, 2006 3:06 pm

Post » Thu Jun 21, 2012 5:06 pm

Start game enabled means that it will run immediately ... without the player actually being in the cell in question (if the PC is on the cart into Helgen, for example). I am not at all sure that Find-Closest will work under those circumstances (I assume when other quests previously started it, the PC was in the cell in question?)

I would avoid Start-Game-Enabled if at all possible ... much goes on with the PC on game-start-up ... So it can be a bit of a nightmare
User avatar
Kim Kay
 
Posts: 3427
Joined: Fri Oct 13, 2006 10:45 am


Return to V - Skyrim