OminousVoice Posted February 16, 2012 Author Share Posted February 16, 2012 I thought I'd try a simpler approach. So I gave this a whirl. It compiles fine but still does nothing in game. Is there any way I can check the script is even being run? Scriptname AddThunderPerk extends ObjectReference Perk property ThunderPerk auto Event OnRead() Game.GetPlayer().AddPerk(ThunderPerk) Debug.Trace("Heart of Thunder added") EndEvent Link to comment Share on other sites More sharing options...
draenn Posted February 16, 2012 Share Posted February 16, 2012 Hi, try this :Scriptname AddThunderPerk extends ObjectReference Perk property ThunderPerk auto auto State waiting Event OnRead() Game.GetPlayer().AddPerk(ThunderPerk) Debug.Trace("Heart of Thunder added") GoToState("allDone") EndEvent endState State allDone endState Link to comment Share on other sites More sharing options...
OminousVoice Posted February 16, 2012 Author Share Posted February 16, 2012 (edited) Hi, try this :Scriptname AddThunderPerk extends ObjectReference Perk property ThunderPerk auto auto State waiting Event OnRead() Game.GetPlayer().AddPerk(ThunderPerk) Debug.Trace("Heart of Thunder added") GoToState("allDone") EndEvent endState State allDone endState I tried this and it didn't for for me. It's bugging me. The syntax and logic all seem fine in all examples above, but they're having no effect in my game. I think I may be missing something fundemental, like I've neglected to do something basic to get it all to function. I've made the book and placed it in game. I've added a script to it in the CK. Defined 'ThunderPerk' with the dropdown box. Written/amended the script. Compiled it, and saved the plugin. I've even made sure the compiled .pex file is in my scripts folder. I don't know what I could be missing. Edited February 16, 2012 by OminousVoice Link to comment Share on other sites More sharing options...
OminousVoice Posted February 16, 2012 Author Share Posted February 16, 2012 I made sure logging etc was enabled in the .ini. Checked my logs and found that the script wasn't even being called. There was quite literally no trace in the log. I still have no idea what to do. Link to comment Share on other sites More sharing options...
ctzto Posted February 16, 2012 Share Posted February 16, 2012 Do you have to add a property to Game.GetPlayer()? For instance like how you added ThunderPack to HasPerk(ThunderPack). So let's say Game.GetPlayer(akActor)? Or does the script Game.GetPlayer already know you mean the main character you're controlling? Sorry I'm new to papyrus scripting myself. Link to comment Share on other sites More sharing options...
OminousVoice Posted February 16, 2012 Author Share Posted February 16, 2012 Do you have to add a property to Game.GetPlayer()? For instance like how you added ThunderPack to HasPerk(ThunderPack). So let's say Game.GetPlayer(akActor)? Or does the script Game.GetPlayer already know you mean the main character you're controlling? Sorry I'm new to papyrus scripting myself. As far as I know Game.GetPlayer() doesn't need a property attached. Link to comment Share on other sites More sharing options...
draenn Posted February 17, 2012 Share Posted February 17, 2012 did you try to add the perk with the console to see if it is working ? Link to comment Share on other sites More sharing options...
SirArindel Posted February 17, 2012 Share Posted February 17, 2012 (edited) Hi, try replacing Debug.Trace with Debug.MessageBox, that will show you if it works right when you read the book. According to the wiki, Debug.Traces saves the Debug text into a log/txt file. Use MessageBox instead to find if it works. Debug.Notification to show the message at the Top-left corner. Edited February 17, 2012 by omega2008 Link to comment Share on other sites More sharing options...
OminousVoice Posted February 17, 2012 Author Share Posted February 17, 2012 did you try to add the perk with the console to see if it is working ? The perk adds fine with the console. Hi, try replacing Debug.Trace with Debug.MessageBox, that will show you if it works right when you read the book. According to the wiki, Debug.Traces saves the Debug text into a log/txt file. Use MessageBox instead to find if it works. Debug.Notification to show the message at the Top-left corner. My latest revision includes debug.notification. Still nothing. As I said earlier, it seems the scripts function isn't being called when it should. Link to comment Share on other sites More sharing options...
Jugg3r Posted February 17, 2012 Share Posted February 17, 2012 I dont think you need to check if the player has the perk, 'caus he wont gain it again anyways. so 4 lines should do Scriptname AddThunderPerk extends ObjectReference Event OnRead() game.GetPlayer().AddPerk(ThunderPerk) endEvent Link to comment Share on other sites More sharing options...
Recommended Posts