Papyrus snippet in dialogue topic mostly useless..

Post » Mon Nov 19, 2012 2:07 pm

The only code that I've managed to have work in a "papyrus snippet" box on a dialogue topic has been stuff like..

GetOwningQuest().SetStage(x)

In the past (Oblivion, F03, etc.), it was easy to do something like..

MyRef.MoveTo(Player)Player.AddItem F00000412 20
(probably incorrect but you get the gist)

I tried to do what I thought would be the equivalent in the new scripting system, but have so far been unsuccessful. These are things I've tried with no success..

GetOwningQuest().Alias_MyRef().MoveTo();;GetOwningQuest().Alias_MyRef().StartCombat(Game.GetPlayer());;Alias_MyRef().MoveTo()

Those worked fine when put in a Quest stage result script, but putting a SetStage() in the dialogue Papyrus snippet so that I can run something in a resulting script seems convoluted. Does anyone have any suggestions?
User avatar
Enie van Bied
 
Posts: 3350
Joined: Sun Apr 22, 2007 11:47 pm

Post » Mon Nov 19, 2012 12:23 pm

Yes, you need to use http://www.creationkit.com/Variables_and_Properties_(Papyrus). (The 'Alias_' thing works in quest scripts because those properties are added to them automatically.)

Properties can only be added to a script that already exists, so when you want to add a papyrus fragment to a dialogue info, put a semicolon in the fragment, hit Compile, then OK. Then reopen the info and select the script (in the box at the lower right) and then you can add properties. You should always use a property of type Actor called PlayerRef instead of Game.GetPlayer(), as it is much faster - and I suspect the same may be true of using a Quest type property, rather than GetOwningQuest(), but have not tested it. If you call the property by exactly the same name as the thing that it applies to, the property will be autofilled: and this makes your life much simpler if ever you need to fill the properties again after you've forgotten writing the code, so I strongly advise doing it.
User avatar
Phillip Brunyee
 
Posts: 3510
Joined: Tue Jul 31, 2007 7:43 pm

Post » Mon Nov 19, 2012 5:45 am

As said above, you need to add your Properties. Unless the code fragment is in the actual Quest script (like a Stage for example), you cannot reference the aliases without filling in a Reference property.

Some people make that mistake, thinking that the dialogue scripts are included in the quest script.
User avatar
Steve Smith
 
Posts: 3540
Joined: Sat Jun 30, 2007 10:47 am


Return to V - Skyrim