Jump to content

AddToFaction Won't Compile


MackenzieBeyer

Recommended Posts

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 undefined
C:\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

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 by Rasikko
Link to comment
Share on other sites

 

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

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...