Setting a Quest Alias property from another script

Post » Tue Oct 20, 2015 12:34 pm

Is it possible to set a property on a script via another script. I have the following:

FollowerSkillAliasScript Property MessageFunction Auto

I can fill the quest and alias property in the CK, and call it with

MessageFunction.DisplayMessage()

However this points to a specific quest and alias. I need to change the alias that it points to as and when required, the quest remains the same

User avatar
Louise Lowe
 
Posts: 3262
Joined: Fri Jul 28, 2006 9:08 am

Post » Tue Oct 20, 2015 11:57 pm

I have taken a different approach, and used an array as i wasn't able to set the property on the fly (would be interested in knowing if this is possible).

The array method works as i needed.

User avatar
Jhenna lee Lizama
 
Posts: 3344
Joined: Wed Jun 06, 2007 5:39 am

Post » Wed Oct 21, 2015 2:26 am

You can get the quest's aliases on the fly by using the Quest.GetAlias() function. The only catch is you need to use the Alias's ID number. To find this, you can expand one of the first columns on the Quest Alias tab (which is normally shrunk down to be invisible by default, if I recall correctly)

Then you'd need to cast the alias as your script type. So, something like:

Alias targetAlias = YourQuest.GetAlias(3)FollowerSkillAliasScript MessageFunction = targetAlias as FollowerSkillAliasScriptMessageFunction.DisplayMessage()

Script is untested, and I'm a little rusty, but I think that should work. :)

User avatar
Solina971
 
Posts: 3421
Joined: Thu Mar 29, 2007 6:40 am

Post » Tue Oct 20, 2015 2:40 pm

Thanks Egocarib, i probably should have elaborated further in my original post. I have a quest which has over 100 potential alias's, out of which only 2 will fill when the quest starts. All these alias's are potential followers and the player can have two followers. I needed to find which alias had been filled, and then display the message appropriate to that alias. Each alias would potentially have a different message.

I used the following function

Spoiler
Function IdentifyFollower01()    int iElement = MessageFunctionArray.Length        While iElement            iElement -= 1                ReferenceAlias CurrentFollower01 = FollowerArray01[iElement]                    if CurrentFollower01.GetReference() as Actor == FollowerRef01.GetReference() as Actor                        MessageFunctionArray[iElement].DisplayMessage()                            Return                    endif        EndWhileEndFunction

What this does, is run through the list of all potential alias's and compares it to the FollowerDialogue quest (FollowerRef01 points to the Follower on that quest). Once it has found a match, it then displays the message appropriate to the alias. I did have to set the messages in the message array to mirror the alias's. This seems to work as required, given the limted testing that i have carried out

User avatar
Jessica Stokes
 
Posts: 3315
Joined: Fri Jul 28, 2006 11:01 am


Return to V - Skyrim

cron