Jump to content

URGENT: How do add a perk at a certain "rank"?


Recommended Posts

My mod, Automatic Boring Perks, has probably broken several thousand save games, and I need to fix it ASAP.

 

The problem: Each level of a perk also has ranks. So if you have Gunslinger01, and then tell it to addperk Gunslinger01, you get Gunslinger01, rank 2. What is rank 2? Nothing. Your perk menu only shows levels, not ranks. Ranks is a vestigial element from the Skyrim leveling system. Thus you're not getting the +20% damage from Gunslinger01.

 

So I need to fix this ASAP, because most people don't realize it's not working, because it shows they have the perk, but they don't realize that their weapon damage hasn't gone up.

 

What I need: I need a command that will add a perk at a specific rank. OR... I need the command to remove a perk completely. The new version has to be coded from scratch (lost my base file, yes I'm a dumbass), and I need to make it ASAP to fix everyone's save game before they realize I broke them and do weird Internet people things to me!

Link to comment
Share on other sites

Relax. :smile: Num Ranks works, you just missed an important part that will make it work.

 

If I try to explain what I did to get this working(beth does the EXACT same thing) you'll get confused. So I'll use a screenshot of a WORKING mod I finished long time ago:

http://imgur.com/GdYrt9L

 

Priority doesn't have be the same way I set up, as long as the lowest is highest in the list and so forth.

 

So yeah, if the perk will have 30 ranks, there needs to be 30 ranks in the Perk Entry field, so that when addperk is called, it will go up 1 rank.

 

Last bit of advice, if you want to know how to do something in game, look for how Beth did it and reverse engineer. It's how I'm able to do all sorts of crap in their games. ..Some stuff though takes a while to figure out.

Edited by TheDungeonDweller
Link to comment
Share on other sites

The problem is, there is no "gunslinger01 rank 2." And considering the mod added it every time someone leveled up, we got a problem.

 

Right now the only way I see to fix it is, upon leveling up, it removes all of the possible perks (So remove Gunslinger01", and then adds them back. It would obviously be much better if I could do "Does player have Gunslinger01 rank 1?" and then do relevant commands.

 

So the question remains: How do I query what rank of a perk someone has?

Link to comment
Share on other sites

You could clean it up with a onint() quest and detect if it has a perk to remove perk until all is gone than add perk once.

 

I couldnt be bothered to look up the perk names but you can do that.

scriptname FixPerksScript extends quest

perk property rooted01 auto
perk property rooted02 auto
perk property rooted03 auto
perk property paintrain01 auto
perk property paintrain02 auto

event onInit()
	if (Game.GetPlayer().HasPerk(rooted01))
		StartTimer(0.5, 1)
	endif
	if (Game.GetPlayer().HasPerk(rooted02))
		StartTimer(1.0, 2)
	endif
	if (Game.GetPlayer().HasPerk(rooted03))
		StartTimer(1.5, 3)
	endif
	if (Game.GetPlayer().HasPerk(paintrain01))
		StartTimer(2.0, 4)
	endif
	if (Game.GetPlayer().HasPerk(paintrain02))
		StartTimer(2.5, 5)
	endif
endevent

Event OnTimer(int aiTimerID)
	if aiTimerID == 1
		if (Game.GetPlayer().HasPerk(rooted01))
			Game.GetPlayer().RemovePerk(rooted01)
			StartTimer(0.0001, 1)
		else
			Game.GetPlayer().AddPerk(rooted01)
		endif
	endif
	if aiTimerID == 2
		if (Game.GetPlayer().HasPerk(rooted02))
			Game.GetPlayer().RemovePerk(rooted02)
			StartTimer(0.0001, 2)
		else
			Game.GetPlayer().AddPerk(rooted02)
		endif
	endif
	if aiTimerID == 3
		if (Game.GetPlayer().HasPerk(rooted03))
			Game.GetPlayer().RemovePerk(rooted03)
			StartTimer(0.0001, 3)
		else
			Game.GetPlayer().AddPerk(rooted03)
		endif
	endif
	if aiTimerID == 4
		if (Game.GetPlayer().HasPerk(paintrain01))
			Game.GetPlayer().RemovePerk(paintrain01)
			StartTimer(0.0001, 4)
		else
			Game.GetPlayer().AddPerk(paintrain01)
		endif
	endif
	if aiTimerID == 5
		if (Game.GetPlayer().HasPerk(paintrain02))
			Game.GetPlayer().RemovePerk(paintrain02)
			StartTimer(0.0001, 5)
		else
			Game.GetPlayer().AddPerk(paintrain02)
		endif
	endif
endevent
Edited by stonefisher
Link to comment
Share on other sites

  • Recently Browsing   0 members

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