Going Hostile Script Issues

Post » Sat Jun 23, 2012 11:25 pm

All I need is for the speaker to go hostile at the end of his dialogue. I've used the script where the Mythic Dawn guy goes hostile at the end of his quest as a template:

I have this as a script fragment in the dialogue, defining Elric and the faction.


Elric.AddtoFaction(QutCollElricHostileFaction)Elric.SetAv("Aggression", 1)Elric.StartCombat(Game.GetPlayer())


The Full text of the generated script is as follows (in case there's something wrong there: I've had several simple script fragments bugging out this evening for some reason):


;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 1Scriptname TIF__0100EBAC Extends TopicInfo Hidden;BEGIN FRAGMENT Fragment_0Function Fragment_0(ObjectReference akSpeakerRef)Actor akSpeaker = akSpeakerRef as Actor;BEGIN CODEElric.AddtoFaction(QutCollElricHostileFaction)Elric.SetAv("Aggression", 1)Elric.StartCombat(Game.GetPlayer());END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin commentReferenceAlias Property Elric  AutoFaction Property QutCollElricHostileFaction  Auto


And the error I get is:


Starting 1 compile threads for 1 files...Compiling "TIF__0100EBAC"...c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0100EBAC.psc(9,6): AddtoFaction is not a function or does not existc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0100EBAC.psc(10,6): SetAv is not a function or does not existc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0100EBAC.psc(11,6): StartCombat is not a function or does not existNo output generated for TIF__0100EBAC, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on TIF__0100EBAC

Am I doing something wrong in the syntax of these functions? It doesn't seem to be getting hung up on the definitions, though, so that's something. :tongue: Still getting the hang of the new scripting language, so I'm sure I'm missing something obvious, but I need another pair of eyes.
User avatar
Chris Duncan
 
Posts: 3471
Joined: Sun Jun 24, 2007 2:31 am

Post » Sun Jun 24, 2012 8:00 am

Those functions are not members of http://www.creationkit.com/ReferenceAlias_Script. Try calling them instead on Elric.http://www.creationkit.com/GetActorReference_-_ReferenceAlias.

Have a read of this for more information on this sort of thing - http://www.cipscis.com/skyrim/tutorials/externalaccess.aspx

Cipscis
User avatar
Jessie Butterfield
 
Posts: 3453
Joined: Wed Jun 21, 2006 5:59 pm

Post » Sat Jun 23, 2012 10:59 pm

Wonderful! I think this is the third time you've helped me with a script, Cipscis, or maybe I've just seen you help other people. You are now officially my script guru (and thanks for sharing information on your site: everything is helpful). The only computer languages (post-BASIC, yes, I'm THAT old) I've learned are through mod-scripting, but I'm a determined bastard. Thanks for being patient and helpful.
User avatar
Stephanie Valentine
 
Posts: 3281
Joined: Wed Jun 28, 2006 2:09 pm


Return to V - Skyrim