Jump to content

Scripting help


OminousVoice

Recommended Posts

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

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

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

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

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

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

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

  • Recently Browsing   0 members

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