HailHell Posted February 7, 2015 Share Posted February 7, 2015 i tried simply addign this line but it does not work, even if i include properties or try to make them via the properties button plz help PlayerRef.AddToFaction(FalmerFaction) Link to comment Share on other sites More sharing options...
Mattiewagg Posted February 7, 2015 Share Posted February 7, 2015 What doesn't work? Link to comment Share on other sites More sharing options...
HailHell Posted February 7, 2015 Author Share Posted February 7, 2015 When i add PlayerRef.AddToFaction(FalmerFaction) to the papyrus fragment it throws errors at me, i want to change an npc's faction depending on player choice so that the npc attacks the player if he chooses wrong. Link to comment Share on other sites More sharing options...
skinnytecboy Posted February 7, 2015 Share Posted February 7, 2015 (edited) Try Game.GetPlayer().AddToFaction(FalmerFaction) Obviously you need to set faction in properties first. :blush: Edited February 7, 2015 by skinnytecboy Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 7, 2015 Share Posted February 7, 2015 In your line of code PlayerRef & FalmerFaction both require properties. You can avoid a property for PlayerRef by using Game.GetPlayer() as skinnytecboy suggested. The FalmerFaction must have a property set up before it can be used in the fragment. What errors are being thrown at you? Link to comment Share on other sites More sharing options...
HailHell Posted February 7, 2015 Author Share Posted February 7, 2015 does not work, even if i include properties or try to make them via the properties button plz help PlayerRef.AddToFaction(FalmerFaction) i cant use game.getplayer() because it is for an npc Link to comment Share on other sites More sharing options...
ArronDominion Posted February 7, 2015 Share Posted February 7, 2015 If you are wanting to change the npc faction (assuming the speaking npc), what is here currently will change the player's faction membership. akSpeaker is used for the speaking NPC. akSpeaker.AddToFaction (FalmerFaction) It is helpful to post full error messages since the error message provides useful information on the specific problem and hints on what you need to change (won't tell the solution though) Please post the error message so we can help you better Link to comment Share on other sites More sharing options...
HailHell Posted February 7, 2015 Author Share Posted February 7, 2015 when i add properties: faction property A00FFactHell autoactor property A00FQAya autoA00FQAya.AddToFaction(A00FFactHell) Starting 1 compile threads for 1 files...Compiling "TIF__02020D4E"...D:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02020D4E.psc(9,0): no viable alternative at input 'faction'D:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02020D4E.psc(9,17): no viable alternative at input 'A00FFactHell'D:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02020D4E.psc(12,8): no viable alternative at input '.'D:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02020D4E.psc(21,13): script property NewProperty already definedD:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02020D4E.psc(21,13): script variable ::NewProperty_var already definedD:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02020D4E.psc(21,13): script property NewProperty already has a get function definedD:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02020D4E.psc(21,13): script property NewProperty already has a set function definedNo output generated for TIF__02020D4E, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on TIF__02020D4E----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- when i dont add properties: A00FQAya.AddToFaction(A00FFactHell) Starting 1 compile threads for 1 files...Compiling "TIF__02020D4435345"...D:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02020D4435345.psc(18,13): script property NewProperty already definedD:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02020D4435345.psc(18,13): script variable ::NewProperty_var already definedD:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02020D4435345.psc(18,13): script property NewProperty already has a get function definedD:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02020D4435345.psc(18,13): script property NewProperty already has a set function definedNo output generated for TIF__02020D4435345, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on TIF__02020D4435345 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- when i try to click the properties button with the code i get an error message saying: errors encountered while attempting to reload the script! Link to comment Share on other sites More sharing options...
ArronDominion Posted February 7, 2015 Share Posted February 7, 2015 Ok, this is a weird CK bug. Comment out your current fragment, and do a simple function such as Utility.wait (0.1). Compile that, and add the properties after. Once the properties are added, remove the wait, and uncomment your original fragment Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 7, 2015 Share Posted February 7, 2015 You cannot add properties inside of a fragment. Fragments are functions and properties must be defined outside of them. Also, you cannot add properties to a script that does not yet exist. Here is what you need to do:In the fragment box type the following ;place holder textCompile the script fragment.OK to close out the questRe-open the quest.Go to the stage, click on the properties button and add your properties.Replace the place holder text with your fragment codeCompile Should have no errors throughout the process unless your script code itself has issues. Link to comment Share on other sites More sharing options...
Recommended Posts