Elementargewalt Posted March 3, 2021 Share Posted March 3, 2021 (edited) Hello there, i want to change the adamantium perks to require, you guessed it, adamantium.I´ve set up the perks to have the respective condition, which refers to my custom adamantium-misc item.But the point is, i want to make it so, that if you get these perks, with each rank you should loose one of these misc-items. This will require a script i guess, and i have absolutely no idea how to set this up correctly. A blueprint for such a script and the right way to implement/ attach it would be much appreciated... Can anyone help me with this? Thanks in advance EDIT: I´ve tried it on my own, but it will not do anything ingame. I can pick the perk only if i got adamantium in my inventory, but if i choose the perk, the adamantium-misc item won´t get removed...here is the script i use- it is attached to a dummy quest: Scriptname AAATestScript extends QuestPerk Property Adamantium01 Auto ConstPerk Property Adamantium02 Auto ConstPerk Property Adamantium03 Auto ConstMiscObject Property Adamantium_Required Auto ConstEvent OnInit() if (game.getplayer().hasperk(Adamantium01) == true) game.getPlayer().RemoveItem(Adamantium_Required) endifEndEvent EDIT 2: Ok, i noticed, that the script indeed does remove the specific item from the players inventory, but only on a new game start/ safe load. So if i fail to have the respective perk on game load, it won´t remove the item in question later on when taking the perk. i have to find a way to make the script check periodgly if the player has the respective perk and if he has, to end the permanent checking, i guess... Edited March 3, 2021 by Elementargewalt Link to comment Share on other sites More sharing options...
niston Posted March 4, 2021 Share Posted March 4, 2021 Try OnLoad instead of OnInit. Link to comment Share on other sites More sharing options...
Elementargewalt Posted March 4, 2021 Author Share Posted March 4, 2021 If i try to use the OnLoad Event instead of OnInit, the script fails to compile. Link to comment Share on other sites More sharing options...
NoCashNoExp Posted March 5, 2021 Share Posted March 5, 2021 (edited) The problem: You need to detect when the player has acquired a new perk and run your code. Sadly, I don't think there's a way to do this using a quest script. If you don't mind modifying the vanilla perk record, you can create a fragment script on the perk itself that runs when the perk gets added and removes the item. Edited March 5, 2021 by NoCashNoExp Link to comment Share on other sites More sharing options...
Recommended Posts