Scriptname AddThunderPerk extends ObjectReference
Perk property ThunderPerk auto
Event OnRead()
Game.GetPlayer().AddPerk(ThunderPerk)
Debug.Trace("Heart of Thunder added")
EndEvent
Scripting help
#11
Posted 16 February 2012 - 01:11 AM
#12
Posted 16 February 2012 - 01:21 AM
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
#13
Posted 16 February 2012 - 02:48 PM
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 by OminousVoice, 16 February 2012 - 06:47 PM.
#14
Posted 16 February 2012 - 06:49 PM
#15
Posted 16 February 2012 - 08:43 PM
#16
Posted 16 February 2012 - 08:58 PM
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.
#17
Posted 17 February 2012 - 04:30 AM
#18
Posted 17 February 2012 - 05:05 AM
Edited by omega2008, 17 February 2012 - 05:16 AM.
#19
Posted 17 February 2012 - 01:47 PM
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.
#20
Posted 17 February 2012 - 05:00 PM
so 4 lines should do
Scriptname AddThunderPerk extends ObjectReference Event OnRead() game.GetPlayer().AddPerk(ThunderPerk) endEvent



Sign In
Create Account

Back to top








