I've got a problem with my script.
After solving the major headache of Perk Property, I ran into something I can't explain.
My script is supposed to add all basic alchemy perks to the player according to his level.
(So someone with level 60 alchemy, should get alchemist rank 1,2,3 and 4)
Problem: Only the first perk gets added (the one without an if-statement around it) Other addperk commands seem to fail. Although debug messages pop up when placed in the if-statement.
Info:
Debug.MessageBox(playerAlchemy) outputs 100 (my skill is 100, so this is correct)
The if-statement checks seem to work, according to debug messages placed in them.
I have set Alchemy1 to Alchemist00, which has the correct ID (be127)
Alchemy2 to Alchemist20,
Alchemy3 to Alchemist40,
Alchemy4 to Alchemist60,
Alchemy5 to Alchemist80.
I have placed a simple object in the world, which I activate manually.
The script:
Scriptname BBB_Scripttest extends ObjectReference{Test adding perks}Perk Property Alchemy1 AutoPerk Property Alchemy2 AutoPerk Property Alchemy3 AutoPerk Property Alchemy4 AutoPerk Property Alchemy5 AutoEvent OnActivate(ObjectReference akActionRef)int playerAlchemy = Game.GetPlayer().GetActorValue("Alchemy") as int;{Alchemy (Alchemist)}Game.GetPlayer().addperk(Alchemy1)Debug.MessageBox(playerAlchemy)if playerAlchemy >= 20 Game.GetPlayer().addperk(Alchemy2)endifif playerAlchemy >= 40 Game.GetPlayer().addperk(Alchemy3)endifif playerAlchemy >= 60 Game.GetPlayer().addperk(Alchemy4)Endifif playerAlchemy >= 80 Game.GetPlayer().addperk(Alchemy5)endifendEventWhat am I missing here?
Cheers,
Badboyd
