Jump to content

Adamantium perk should require adamantium- need help with custom script...


Recommended Posts

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 Quest

Perk Property Adamantium01 Auto Const

Perk Property Adamantium02 Auto Const

Perk Property Adamantium03 Auto Const

MiscObject Property Adamantium_Required Auto Const

Event OnInit()
if (game.getplayer().hasperk(Adamantium01) == true)
game.getPlayer().RemoveItem(Adamantium_Required)
endif
EndEvent

 

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

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

  • Recently Browsing   0 members

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