g0hahi Posted November 14, 2022 Posted November 14, 2022 I added some if conditionals to a quest script that checks if the pc has a certain perk, but it wouldnt work so i made another quest with these functions: Spoiler function checkperk1() if (game.getplayer().hasperk(testperk)) debug.messagebox("yes") else debug.messagebox("no") endif EndFunction function checkperk2() if (playerref.hasperk(testperk)) debug.messagebox("yes") else debug.messagebox("no") endif EndFunction they worked, correctly returned yes, however when i added and called them from the original quest they both returned false.
alex77r4 Posted November 15, 2022 Posted November 15, 2022 1 hour ago, g0hahi said: function checkperk1() if (game.getplayer().hasperk(testperk)) debug.messagebox("yes") else debug.messagebox("no") endif EndFunction function checkperk2() if (playerref.hasperk(testperk)) debug.messagebox("yes") else debug.messagebox("no") endif EndFunction Where is the definition of testperk and playerref? Have you defined the Properties? Have you filled it in Creation Kit? Have you take a look to your Papyrus0.log to try find yours errors?
Seijin8 Posted November 15, 2022 Posted November 15, 2022 2 hours ago, g0hahi said: however when i added and called them from the original quest they both returned false When a quest runs, it saves a version of the original script. You may need to stop the quest, wait a second, and restart it for the new properties to be recognized.
g0hahi Posted November 15, 2022 Author Posted November 15, 2022 9 hours ago, alex77r4 said: Where is the definition of testperk and playerref? Have you defined the Properties? Have you filled it in Creation Kit? Have you take a look to your Papyrus0.log to try find yours errors? I've defined the properties, and filled them in ck, i just forgot to paste them, mb. The log gives me a bunch of "cannot call x function to a none object" errors
alex77r4 Posted November 15, 2022 Posted November 15, 2022 20 minutes ago, g0hahi said: I've defined the properties, and filled them in ck, i just forgot to paste them, mb. The log gives me a bunch of "cannot call x function to a none object" errors That mean the properties are not correctly defined or linked. Or as Seijin8 say, you have trash inside the savegame. Try cleaning the savegame or starting a New Game. You can add more code to try discover what is happening: function checkperk2() If testperk == None debug.messagebox("testperk is NONE and the next verifications go to fail") endif If playerref == None debug.messagebox("playerref is NONE and we can't call hasperk over NONE") endif if (playerref.hasperk(testperk)) debug.messagebox("yes") else debug.messagebox("no") endif EndFunction
g0hahi Posted November 15, 2022 Author Posted November 15, 2022 8 minutes ago, alex77r4 said: That mean the properties are not correctly defined or linked. Or as Seijin8 say, you have trash inside the savegame. Try cleaning the savegame or starting a New Game. You can add more code to try discover what is happening: function checkperk2() If testperk == None debug.messagebox("testperk is NONE and the next verifications go to fail") endif If playerref == None debug.messagebox("playerref is NONE and we can't call hasperk over NONE") endif if (playerref.hasperk(testperk)) debug.messagebox("yes") else debug.messagebox("no") endif EndFunction thanks, i fixed it meanwhile. the quest wasnt in my plugin fml
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now