MackenzieBeyer Posted October 1, 2018 Share Posted October 1, 2018 I am trying to add an NPC to a faction at a certain stage of a quest. It never compiles. I'm not sure what I'm doing wrong. Here's my script: Alias_Chef.GetReference().AddToFaction(AHEnemyFaction) And here are the errors: C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_ChefForceGreet_010141E9.psc(15,39): variable AHEnemyFaction is undefinedC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_ChefForceGreet_010141E9.psc(15,26): AddToFaction is not a function or does not exist Link to comment Share on other sites More sharing options...
Evangela Posted October 1, 2018 Share Posted October 1, 2018 (edited) Add AHEnemyFaction as a property to the stage fragment. Use the property window. Do not actually declare it in the stage fragment field. Change current code to this: (Alias_Chef.GetReference() as Actor).AddToFaction(AHEnemyFaction) Edited October 1, 2018 by Rasikko Link to comment Share on other sites More sharing options...
MackenzieBeyer Posted October 1, 2018 Author Share Posted October 1, 2018 Add AHEnemyFaction as a property to the stage fragment. Use the property window. Do not actually declare it in the stage fragment field. Change current code to this: (Alias_Chef.GetReference() as Actor).AddToFaction(AHEnemyFaction) What type of property? An integer? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 1, 2018 Share Posted October 1, 2018 AHEnemyFaction needs to be a Faction property. After all you want to add the alias reference to the faction that you've called AHEnemyFaction. To do this in a fragment, you'll need to comment out your line of code (put ; in front) and then compile. The script has to exist before you can add a property to it. Once you've compiled and added your property, you can go back and remove the comment mark ( ; ) and re-compile. Link to comment Share on other sites More sharing options...
MackenzieBeyer Posted October 1, 2018 Author Share Posted October 1, 2018 AHEnemyFaction needs to be a Faction property. After all you want to add the alias reference to the faction that you've called AHEnemyFaction. To do this in a fragment, you'll need to comment out your line of code (put ; in front) and then compile. The script has to exist before you can add a property to it. Once you've compiled and added your property, you can go back and remove the comment mark ( ; ) and re-compile.I did all of that and it still says it's undefined. I made it a property in the stage, used the semi colon and I still get the same error. Link to comment Share on other sites More sharing options...
Recommended Posts