SterkOks Posted July 19, 2017 Share Posted July 19, 2017 I am trying to make a player house for SSE, and I've already gotten everything mostly set up. I'm trying to add a custom faction to the house so that the items in the house can be owned, but I also want the player to already be a resident. I have a script set up to add the player to the faction but it won't compile because the compiler doesn't recognize the faction, which I created in the CK in my plugin. The script reads; ScriptName RSFHFactionScript01 extends quest{This script will add the player to the Riversplit Farmhouse faction}Event OnInit () Game.GetPlayer().AddToFaction(RSFHFaction01)EndEvent When I try to compile it I get an error saying that it cannot find my custom faction (variable RSFHFaction01 is undefined), here's a screen grab of compiler. https://image.prntscr.com/image/eHcbwrJuQA_fgTEiHsuo5Q.png I have no idea how to make the compiler recognize this. Someone told me I need to make the variable public? What does that mean, and how do I make it happen? Thank you for taking the time to read this, and thank you in advance for your response. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted July 19, 2017 Share Posted July 19, 2017 You need to add a property entry to the script for your faction and then after compiling you need to highlight the script entry, click the properties button and fill the faction property with the correct data. Example: ScriptName RSFHFactionScript01 extends quest {This script will add the player to the Riversplit Farmhouse faction} Faction Property RSFHFaction01 Auto Event OnInit() Game.GetPlayer().AddToFaction(RSFHFaction01) EndEvent Link to comment Share on other sites More sharing options...
SterkOks Posted July 19, 2017 Author Share Posted July 19, 2017 (edited) You need to add a property entry to the script for your faction and then after compiling you need to highlight the script entry, click the properties button and fill the faction property with the correct data. Example: ScriptName RSFHFactionScript01 extends quest {This script will add the player to the Riversplit Farmhouse faction} Faction Property RSFHFaction01 Auto Event OnInit() Game.GetPlayer().AddToFaction(RSFHFaction01) EndEvent This worked perfectly, thank you! Just for anyone's future reference, after compiling you open the plugin in the CK, connect the QUEST with the SCRIPT, then open the SCRIPT in properties and auto fill the data there. The answer confused me, luckily there are plenty of polite and helpful people on the Nexus chat. Screenshots will follow. EDIT: Screenies.https://image.prntscr.com/image/u_61Xb1cRWek6chOHDk-5A.pnghttps://image.prntscr.com/image/NcWcOdS3RACBMDWH33TJnA.png Edited July 19, 2017 by SterkOks Link to comment Share on other sites More sharing options...
ben446 Posted April 25, 2018 Share Posted April 25, 2018 i know this is an old thread, but I kinda have the same issue, the only difference is I want to add the faction to the player when they buy the house, I have a script for purchasing the house which works off if statemments(obviously) would I be able to add the same property at the start of the script then add the other part under the if statement that refers to the player having the gold required to purchase the house. thank you in advanced, I can read scripts but cant write them so after two days this really has done my head in, id rather be nav meshing at this point in time rather than trying to sort this script out Link to comment Share on other sites More sharing options...
IsharaMeradin Posted April 25, 2018 Share Posted April 25, 2018 i know this is an old thread, but I kinda have the same issue, the only difference is I want to add the faction to the player when they buy the house, I have a script for purchasing the house which works off if statemments(obviously) would I be able to add the same property at the start of the script then add the other part under the if statement that refers to the player having the gold required to purchase the house. thank you in advanced, I can read scripts but cant write them so after two days this really has done my head in, id rather be nav meshing at this point in time rather than trying to sort this script outYes. Keep in mind if this is a stock script adding a property will cause issues to arise should the mod be uninstalled mid-game. In that scenario you would be better off with a local variable for your faction and assigning the correct faction via the GetFormFromFile function. Link to comment Share on other sites More sharing options...
ben446 Posted April 26, 2018 Share Posted April 26, 2018 thank you so much for your help. id been trying for days to add what was needed. I can read scripts so I knew where it had to go just couldn't work out what had to go there. Thanks for fixing my headache Link to comment Share on other sites More sharing options...
Recommended Posts