bwins95 Posted June 3, 2013 Share Posted June 3, 2013 I'm trying to make a mod where you drop a book and click on it. when you click on the book you can pick it up or enter it. I've spent all day working on this and this is all I've been able to get. when I try to compile it it says the buttons need defining, but I don;t know how to do it. This just a test script to see if I could make it work, so the book, message and transport location is the first thing I found. ScriptName booktest Extends ObjectReference Actor Property PlayerREF AutoMessage Property aaaaaabook AutoObjectReference Property aaUnderforgeTotem AutoFunction OnActivate(ObjectReference akActionRef) aaaaaabook.Show() If ButtonChoice0 == 0 Debug.notification("You've picked up the book") AddItem(aaUnderforgeTotem) ElseIf ButtonChoice1 == 0 Debug.notification("You've entered the book") PlayerREF.MoveTo(Game.GetPlayer(), 120 * Math.Sin(Game.GetPlayer().GetAngleZ()), 120 * Math.Cos(Game.GetPlayer().GetAngleZ()), Game.GetPlayer().GetHeight() + 2) EndifEndFunction I've tried the creationkit.com menu tutorial, but it doesn't make any sense to me. Link to comment Share on other sites More sharing options...
Ghaunadaur Posted June 3, 2013 Share Posted June 3, 2013 Every variable and property of your script needs to be declared. Also, you might want to use event OnActivate() not function. ScriptName booktest Extends ObjectReference Actor Property PlayerREF Auto Message Property aaaaaabook Auto ObjectReference Property aaUnderforgeTotem Auto Event OnActivate(ObjectReference akActionRef) int ButtonChoice = aaaaaabook.Show() If ButtonChoice == 0 Debug.notification("You've picked up the book") AddItem(aaUnderforgeTotem) ElseIf ButtonChoice == 1 Debug.notification("You've entered the book") PlayerREF.MoveTo(Game.GetPlayer(), 120 * Math.Sin(Game.GetPlayer().GetAngleZ()), 120 * Math.Cos(Game.GetPlayer().GetAngleZ()), Game.GetPlayer().GetHeight() + 2) Endif EndEvent Link to comment Share on other sites More sharing options...
bwins95 Posted June 4, 2013 Author Share Posted June 4, 2013 (edited) Every variable and property of your script needs to be declared. Also, you might want to use event OnActivate() not function. ScriptName booktest Extends ObjectReference Actor Property PlayerREF Auto Message Property aaaaaabook Auto ObjectReference Property aaUnderforgeTotem Auto Event OnActivate(ObjectReference akActionRef) int ButtonChoice = aaaaaabook.Show() If ButtonChoice == 0 Debug.notification("You've picked up the book") AddItem(aaUnderforgeTotem) ElseIf ButtonChoice == 1 Debug.notification("You've entered the book") PlayerREF.MoveTo(Game.GetPlayer(), 120 * Math.Sin(Game.GetPlayer().GetAngleZ()), 120 * Math.Cos(Game.GetPlayer().GetAngleZ()), Game.GetPlayer().GetHeight() + 2) Endif EndEvent Thank you.The funny thing is, I had something like this at one point, but it wouldn't compile, so i changed things. Edited June 4, 2013 by bwins95 Link to comment Share on other sites More sharing options...
Recommended Posts