Is there any list of words like akSpeaker, akActivator, ...?
I want to know because i want to make in quest script something like
akSpeaker.startcombat(Game.GetPlayer())
But replace akSpeaker by another nonunique actor (mabye alias?)
akSpeaker.startcombat(Game.GetPlayer())
Post the whole script because what your saying doesnt make sense. The akSpeaker is just a variable name, specifically an "argument Form" which means it was provided by a function or event.
akSpeaker is for dialoge topic fragments(complicating for me)
If you want to call this from a stage fragment, then make a property for the alias using the Property button in the stage fragment you wish to use, and then put this into script field:
(MyAlias.GetReference() as Actor).StartCombat(Game.GetPlayer())
I see now. Your dealing with topic info fragment scripts. Yes the way to do it is to put the other actor in a quest alias and then make it a property of the fragment script. I will do it the fast way.
Actor kPlayer = Game.GetPlayer()
Quest kQuest = Quest.GetQuest("YourQuestName")
kQuest.GetAliasByName("Bad Guy 1").GetActorReference().StartCombat(kPlayer)
kQuest.GetAliasByName("Bad Guy 2").GetActorReference().StartCombat(kPlayer)
kQuest.GetAliasByName("Bad Guy 3").GetActorReference().StartCombat(kPlayer)
Terra Nova beat me to it because Im slow
So, I tried it today and it dont compile
Actor kPlayer = Game.GetPlayer()
Quest kQuest = Quest.GetQuest("_MTAttackQuest")
kQuest.GetAliasByName("Killer").GetActorReference().StartCombat(kPlayer)
This is my version of script and this is error mesage
Starting 1 compile threads for 1 files...
Compiling "TIF__01000D90"...
D:\Programy\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__01000D90.psc(10,21): GetQuest is not a function or does not exist
D:\Programy\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__01000D90.psc(10,21): cannot call the member function GetQuest alone or on a type, must call it on a variable
D:\Programy\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__01000D90.psc(11,7): GetAliasByName is not a function or does not exist
D:\Programy\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__01000D90.psc(11,32): none is not a known user-defined type
D:\Programy\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__01000D90.psc(11,52): none is not a known user-defined type
No output generated for TIF__01000D90, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__01000D90
GetQuest() is a SKSE function which you obviously don't have installed. For the time being go with my example.
Yeah you're working with topic fragments.. someone more experienced with those will have to chime in. All I know is, akSpeaker doesn't have to be anything specific. It will automatically point to the NPC that owns that dialoge IIRC.
Ok I'll chime in this point then and being a papyrus beginner myself I think I know what you're getting at
Terra's
(MyAlias.GetReference() as Actor).StartCombat(Game.GetPlayer())
will work for akSpeaker but if you want a specific actor or reference alias you'll have to add Properties to the script. If you want a specific actor (example, Saadia) you can name them directly or if its an alias you'll have to get who the alias points to (thats what the .GetReference() as Actor is for) i.e.
;fragment start stuff
Saadia.StartCombat(Game.GetPlayer()
;fragment ending stuff
Actor Property Saadia Auto
will do, if want a reference alias in a quest instead (could be anyone)
;fragment starting stuff
(AliasActor.GetReference() as Actor).StartCombat(Game.GetPlayer())
;fragment ending stuff
ReferenceAlias Property AliasActor Auto
will do. Now with fragments that have properties you have to jump through hoops to add them as you can't add properties until the script has compiled and it won't compile without properties...
so you have to: add the lines you want to the fragment (minus properties) and attempt to compile it, the compiler will throw out errors stating it can't compile but do you want to save the source file anyway, choose YES and save the file.
Next open the source file and add the Property lines to the end of the fragment, re-compile this time it should compile and you should have a working script.
n.b. if anyone knows a more efficient method I'd love to hear it.
Yes these do require SKSE psc files to be installed.
I recommended this because properties and fragments are a nightmare for most begginers. You can copy/paste this snippet anywhere and it will work as long as it compiles and the quest/aliases exist.
SKSE http://skse.silverlock.org/
Documentation
http://www.creationkit.com/GetQuest_-_Quest
http://www.creationkit.com/GetAliasByName_-_Quest
http://www.creationkit.com/GetActorReference_-_ReferenceAlias
http://www.creationkit.com/StartCombat_-_Actor
I tried to compile and it says "GetReference is not a function or does not exist"
(Attacker.GetReference() as Actor).StartCombat(Game.GetPlayer())
Using this script, all Properties filled clearly
I tried some examples from http://www.creationkit.com/Bethesda_Tutorial_Quest_Loose_Ends (where they are using GetReference), but with same results. Is GetReference in some library that have to download?
In my defense I did say using properties was the correct way to do this. The snippet I posted was just intended to make it work, its idiot proof. Writing the script out like that allows you to design the functionality without committing to all the additional property creation steps.