Magnusen2 Posted August 11, 2016 Share Posted August 11, 2016 (edited) Ok so i created a perk point script to use in my mod. Scriptname xxxPerkPointBook extends ObjectReference Message Property PerkMessage Auto Event OnEquipped(Actor reader) Int PerkPoints = game.GetPerkPoints() if (reader != Game.GetPlayer()) return endif int ibutton = PerkMessage.show() if reader != game.GetPlayer() if ibutton == 0 if PerkPoints <= 253 Game.ModPerkPoints(1) debug.Notification("Perk point added") else debug.Notification("You can't add more perk points") endif elseif ibutton == 1 if PerkPoints <= 251 Game.ModPerkPoints(3) debug.Notification("3 perk points added") else debug.Notification("You can't add more perk points") endif elseif ibutton == 2 if PerkPoints <= 249 Game.ModPerkPoints(5) debug.Notification("5 perk points added") else debug.Notification("You can't add more perk points") endif elseif ibutton == 3 if PerkPoints <= 244 Game.ModPerkPoints(10) debug.Notification("10 perk points added") else debug.Notification("You can't add more perk points") endif elseif ibutton == 4 if PerkPoints <= 229 Game.ModPerkPoints(25) debug.Notification("25 perk points added") else debug.Notification("You can't add more perk points") endif elseif ibutton == 5 if PerkPoints <= 204 Game.ModPerkPoints(50) debug.Notification("50 perk points added") else debug.Notification("You can't add more perk points") endif elseif ibutton == 6 if PerkPoints > 0 Game.ModPerkPoints(0) debug.Notification("All perk points removed") else debug.Notification("You don't have perk points to remove") endif endif endif EndEvent It functions through a book that displays a message box in which the user can select how many points he wants. The problem: The message displays fine but no notification nor perk points is given to the user. Any help on this? Edited August 11, 2016 by Magnusen2 Link to comment Share on other sites More sharing options...
lofgren Posted August 11, 2016 Share Posted August 11, 2016 The line immediately after showing the message says that the rest of the script should only execute if the reader is not the player. Link to comment Share on other sites More sharing options...
Magnusen2 Posted August 14, 2016 Author Share Posted August 14, 2016 The line immediately after showing the message says that the rest of the script should only execute if the reader is not the player.Removed that line. Message Property zxxxPerkPointBookMessage Auto Function OnEquipped(Actor reader) Int PerkPoints = game.GetPerkPoints() if reader != game.GetPlayer() return endIf Int iButton = zxxxPerkPointBookMessage.show() if iButton == 0 if PerkPoints <= 253 Game.ModPerkPoints(1) debug.Notification("Perk point added") else debug.Notification("You can't add more perk points") endif elseif iButton == 1 if PerkPoints <= 251 Game.ModPerkPoints(3) debug.Notification("3 perk points added") else debug.Notification("You can't add more perk points") endif elseif iButton == 2 if PerkPoints <= 249 Game.ModPerkPoints(5) debug.Notification("5 perk points added") else debug.Notification("You can't add more perk points") endif elseif iButton == 3 if PerkPoints <= 244 Game.ModPerkPoints(10) debug.Notification("10 perk points added") else debug.Notification("You can't add more perk points") endif elseif iButton == 4 if PerkPoints <= 229 Game.ModPerkPoints(25) debug.Notification("25 perk points added") else debug.Notification("You can't add more perk points") endif elseif iButton == 5 if PerkPoints <= 204 Game.ModPerkPoints(50) debug.Notification("50 perk points added") else debug.Notification("You can't add more perk points") endif elseif iButton == 6 if PerkPoints > 0 Game.ModPerkPoints(0) debug.Notification("All perk points removed") else debug.Notification("You don't have perk points to remove") endif endif EndFunction But now there's another problem. When i read the book a notification appears that one perk point was added, but the message box that was supposed to appear to let the player choose how many points he wants doesn't. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 14, 2016 Share Posted August 14, 2016 Did you fill the message property with the correct message form?Did you add the menu buttons to the message form? Link to comment Share on other sites More sharing options...
NexusComa Posted August 14, 2016 Share Posted August 14, 2016 This part is where your problem is ... check it out. Int iButton = zxxxPerkPointBookMessage.show() Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 14, 2016 Share Posted August 14, 2016 This part is where your problem is ... check it out. Int iButton = zxxxPerkPointBookMessage.show()Explain how that is a problem for the OP. The syntax is correct. Link to comment Share on other sites More sharing options...
Magnusen2 Posted August 14, 2016 Author Share Posted August 14, 2016 (edited) Did you fill the message property with the correct message form?Did you add the menu buttons to the message form?Yes Edited August 14, 2016 by Magnusen2 Link to comment Share on other sites More sharing options...
cdcooley Posted August 14, 2016 Share Posted August 14, 2016 If the message property isn't filled the Show() function always returns 0 which would give one perk point in your code. Double check that the property is filled. And make sure you aren't testing on a save game that had seen a previous version of that script where that property wasn't filled. Property values get stored with a saved game. Link to comment Share on other sites More sharing options...
Magnusen2 Posted August 14, 2016 Author Share Posted August 14, 2016 If the message property isn't filled the Show() function always returns 0 which would give one perk point in your code. Double check that the property is filled. And make sure you aren't testing on a save game that had seen a previous version of that script where that property wasn't filled. Property values get stored with a saved game.Started a new game and the message shows up. It looks like the book is busted for my previous playthrough.Thanks everyone. Link to comment Share on other sites More sharing options...
Recommended Posts